diff --git a/cereal/custom.capnp b/cereal/custom.capnp index d3a7adf7..80333f34 100644 --- a/cereal/custom.capnp +++ b/cereal/custom.capnp @@ -76,10 +76,11 @@ struct FrogPilotCarState @0xf35cc4560bbf6ec2 { distanceVeryLongPressed @7 :Bool; ecoGear @8 :Bool; forceCoast @9 :Bool; - pauseLateral @10 :Bool; - pauseLongitudinal @11 :Bool; - sportGear @12 :Bool; - trafficModeEnabled @13 :Bool; + isParked @10 :Bool; + pauseLateral @11 :Bool; + pauseLongitudinal @12 :Bool; + sportGear @13 :Bool; + trafficModeEnabled @14 :Bool; } struct FrogPilotDeviceState @0xda96579883444c35 { @@ -108,8 +109,8 @@ struct FrogPilotOnroadEvent @0xa5cd762cd951a455 { immediateDisable @6 :Bool; preEnable @7 :Bool; permanent @8 :Bool; - overrideLateral @10 :Bool; - overrideLongitudinal @9 :Bool; + overrideLateral @9 :Bool; + overrideLongitudinal @10 :Bool; enum EventName { blockUser @0; @@ -194,16 +195,18 @@ struct FrogPilotRadarState @0xb86e6369214c01c8 { vRel @2 :Float32; aRel @3 :Float32; vLead @4 :Float32; - dPath @5 :Float32; - vLat @6 :Float32; - vLeadK @7 :Float32; - aLeadK @8 :Float32; - fcw @9 :Bool; - status @10 :Bool; - aLeadTau @11 :Float32; - modelProb @12 :Float32; - radar @13 :Bool; - radarTrackId @14 :Int32 = -1; + dPath @6 :Float32; + vLat @7 :Float32; + vLeadK @8 :Float32; + aLeadK @9 :Float32; + fcw @10 :Bool; + status @11 :Bool; + aLeadTau @12 :Float32; + modelProb @13 :Float32; + radar @14 :Bool; + radarTrackId @15 :Int32 = -1; + + aLeadDEPRECATED @5 :Float32; } } diff --git a/common/params_keys.h b/common/params_keys.h index 22019493..08340a03 100644 --- a/common/params_keys.h +++ b/common/params_keys.h @@ -156,6 +156,7 @@ inline static std::unordered_map keys = { {"AvailableModelNames", {PERSISTENT, STRING, "", "", 1}}, {"AvailableModels", {PERSISTENT, STRING, "", "", 1}}, {"BlacklistedModels", {PERSISTENT, STRING, "", "", 2}}, + {"BuildMetadata", {PERSISTENT, STRING, "", "", 0}}, {"BlindSpotMetrics", {PERSISTENT, BOOL, "1", "0", 3}}, {"BlindSpotPath", {PERSISTENT, BOOL, "1", "0", 1}}, {"BorderMetrics", {PERSISTENT, BOOL, "0", "0", 3}}, @@ -240,6 +241,7 @@ inline static std::unordered_map keys = { {"ForceStops", {PERSISTENT, BOOL, "0", "0", 2}}, {"ForceTorqueController", {PERSISTENT, BOOL, "0", "0", 3}}, {"FPSCounter", {PERSISTENT, BOOL, "1", "0", 3}}, + {"FrogPilotApiToken", {PERSISTENT | DONT_LOG, STRING, "", "", 0}}, {"FrogPilotCarParams", {CLEAR_ON_MANAGER_START | CLEAR_ON_ONROAD_TRANSITION, BYTES, "", ""}}, {"FrogPilotCarParamsPersistent", {PERSISTENT, BYTES, "", ""}}, {"FrogPilotDongleId", {PERSISTENT | DONT_LOG, STRING, "", "", 0}}, @@ -335,6 +337,8 @@ inline static std::unordered_map keys = { {"PauseLateralOnSignal", {PERSISTENT, BOOL, "0", "0", 1}}, {"PauseLateralSpeed", {PERSISTENT, FLOAT, "0.0", "0.0", 1}}, {"PedalsOnUI", {PERSISTENT, BOOL, "0", "0", 1}}, + {"PondPaired", {PERSISTENT, BOOL, "0", "0", 0}}, + {"PondUploadPending", {PERSISTENT, BOOL, "0", "0", 0}}, {"PreferredSchedule", {PERSISTENT, INT, "2", "0", 0}}, {"PreviousSpeedLimit", {PERSISTENT, FLOAT, "0.0", "0.0"}}, {"PromptDistractedVolume", {PERSISTENT, INT, "101", "101", 2}}, diff --git a/frogpilot/common/frogpilot_backups.py b/frogpilot/common/frogpilot_backups.py index e505cdc5..edaed470 100644 --- a/frogpilot/common/frogpilot_backups.py +++ b/frogpilot/common/frogpilot_backups.py @@ -51,9 +51,12 @@ def backup_toggles(params, boot_run=False): cleanup_backups(TOGGLE_BACKUPS, maximum_backups) if not changes_found or boot_run: - print("Toggles are identical to the previous backup. Aborting...") + if not changes_found: + print("Toggles are identical to the previous backup. Aborting...") return + params.put_bool("PondUploadPending", True) + destination = TOGGLE_BACKUPS / f"{datetime.datetime.now().strftime('%Y-%m-%d_%H-%M-%S')}_auto" create_backup(Path(params_backup.get_param_path()), destination, "Successfully backed up toggles!", "Failed to backup toggles...", params) diff --git a/frogpilot/common/frogpilot_functions.py b/frogpilot/common/frogpilot_functions.py index 0a747e96..fd6d965d 100644 --- a/frogpilot/common/frogpilot_functions.py +++ b/frogpilot/common/frogpilot_functions.py @@ -1,9 +1,7 @@ #!/usr/bin/env python3 -import io +import dataclasses import json -import random import requests -import string import threading import time @@ -15,53 +13,45 @@ from openpilot.common.params import Params from openpilot.common.time_helpers import system_time_valid from openpilot.system.athena.registration import register from openpilot.system.hardware import HARDWARE +from openpilot.system.version import get_build_metadata from openpilot.frogpilot.assets.theme_manager import ThemeManager from openpilot.frogpilot.common.frogpilot_backups import backup_frogpilot -from openpilot.frogpilot.common.frogpilot_utilities import is_FrogsGoMoo, run_cmd, use_konik_server +from openpilot.frogpilot.common.frogpilot_utilities import get_frogpilot_api_info, is_FrogsGoMoo, is_url_pingable, run_cmd, use_konik_server from openpilot.frogpilot.common.frogpilot_variables import ( - DISCORD_WEBHOOK_URL_REPORT, ERROR_LOGS_PATH, FROGS_GO_MOO_PATH, HD_LOGS_PATH, KONIK_LOGS_PATH, MAPS_PATH, THEME_SAVE_PATH, + ERROR_LOGS_PATH, FROGPILOT_API, FROGS_GO_MOO_PATH, HD_LOGS_PATH, KONIK_LOGS_PATH, MAPS_PATH, THEME_SAVE_PATH, FrogPilotVariables, get_frogpilot_toggles ) -def capture_report(discord_user, report, frogpilot_toggles): - if not DISCORD_WEBHOOK_URL_REPORT: +def capture_report(discord_user, report, params, frogpilot_toggles): + if not is_url_pingable(FROGPILOT_API): return + api_token, build_metadata, device_type, dongle_id = get_frogpilot_api_info() + error_file_path = ERROR_LOGS_PATH / "error.txt" error_content = "No error log found." if error_file_path.exists(): error_content = error_file_path.read_text()[:1000] - message = ( - f"**🚨 New Error Report**\n\n" - f"**User:** `{discord_user}`\n\n" - f"**Report:**\n```{report}```\n\n" - f"**Error Log:**\n```{error_content}```\n\n" - f"**Toggle Settings:**" - ) + payload = { + "api_token": api_token, + "build_metadata": build_metadata, + "device": device_type, + "discord_user": discord_user, + "error_content": error_content, + "frogpilot_dongle_id": dongle_id, + "frogpilot_toggles": frogpilot_toggles, + "report": report, + } try: - main_response = requests.post( - DISCORD_WEBHOOK_URL_REPORT, - data={"content": message}, - files={"file": ("frogpilot_toggles.json", io.BytesIO(json.dumps(frogpilot_toggles, indent=2).encode("utf-8")), "application/json")}, - timeout=10 - ) - main_response.raise_for_status() - - mention_response = requests.post( - DISCORD_WEBHOOK_URL_REPORT, - json={"content": "<@&1198482895342411846>"}, - timeout=10 - ) - mention_response.raise_for_status() - + response = requests.post(f"{FROGPILOT_API}/discord/report", json=payload, headers={"Content-Type": "application/json", "User-Agent": "frogpilot-api/1.0"}, timeout=30) + response.raise_for_status() + print("Successfully sent error report!") except requests.exceptions.RequestException as exception: - print(f"Error sending Discord message: {exception}") - except Exception as exception: - print(f"Unexpected error: {exception}") + print(f"Error sending report: {exception}") def frogpilot_boot_functions(build_metadata, params): @@ -82,6 +72,8 @@ def frogpilot_boot_functions(build_metadata, params): except (json.JSONDecodeError, TypeError, ValueError): pass + params.put("BuildMetadata", json.dumps(dataclasses.asdict(build_metadata))) + FrogPilotVariables() ThemeManager(params, params_memory, boot_run=True).update_active_theme(time_validated=system_time_valid(), frogpilot_toggles=get_frogpilot_toggles(), boot_run=True) @@ -114,8 +106,7 @@ def install_frogpilot(build_metadata, params): for path in paths: path.mkdir(parents=True, exist_ok=True) - if params.get("FrogPilotDongleId") is None: - params.put("FrogPilotDongleId", "".join(random.choices(string.ascii_lowercase + string.digits, k=16))) + register_device(build_metadata, params) update_boot_logo(frogpilot=True) @@ -126,6 +117,32 @@ def install_frogpilot(build_metadata, params): run_cmd(["sudo", "mount", "-o", f"remount,{mount_options}", "/persist"], "Successfully restored /persist mount options", "Failed to restore /persist mount options") +def register_device(build_metadata, params): + def register_thread(): + while not is_url_pingable(FROGPILOT_API): + time.sleep(60) + + payload = { + "api_token": params.get("FrogPilotApiToken"), + "build_metadata": dataclasses.asdict(build_metadata), + "device": HARDWARE.get_device_type(), + "dongle_id": params.get("DongleId"), + "frogpilot_dongle_id": params.get("FrogPilotDongleId"), + } + + try: + response = requests.post(f"{FROGPILOT_API}/register", json=payload, headers={"Content-Type": "application/json", "User-Agent": "frogpilot-api/1.0"}, timeout=10) + response.raise_for_status() + + data = response.json() + params.put("FrogPilotApiToken", data.get("api_token", "")) + params.put("FrogPilotDongleId", data.get("frogpilot_dongle_id")) + except Exception: + pass + + threading.Thread(target=register_thread, daemon=True).start() + + def uninstall_frogpilot(): update_boot_logo(stock=True) diff --git a/frogpilot/common/frogpilot_utilities.py b/frogpilot/common/frogpilot_utilities.py index 7d9362c3..fd59a92c 100644 --- a/frogpilot/common/frogpilot_utilities.py +++ b/frogpilot/common/frogpilot_utilities.py @@ -1,4 +1,5 @@ #!/usr/bin/env python3 +import dataclasses import json import math import numpy as np @@ -17,10 +18,13 @@ import openpilot.system.sentry as sentry from cereal import log, messaging from opendbc.can.parser import CANParser from opendbc.car.toyota.carcontroller import LOCK_CMD +from openpilot.common.params import Params from openpilot.common.realtime import DT_DMON, DT_HW +from openpilot.system.hardware import HARDWARE +from openpilot.system.version import get_build_metadata from panda import Panda -from openpilot.frogpilot.common.frogpilot_variables import EARTH_RADIUS, FROGS_GO_MOO_PATH, KONIK_PATH +from openpilot.frogpilot.common.frogpilot_variables import EARTH_RADIUS, FROGPILOT_API, FROGS_GO_MOO_PATH, KONIK_PATH class ThreadManager: def __init__(self): @@ -166,11 +170,40 @@ def flash_panda(params_memory): params_memory.remove("FlashPanda") +def get_frogpilot_api_info(): + params = Params() + + api_token = params.get("FrogPilotApiToken") + build_metadata = dataclasses.asdict(get_build_metadata()) + device_type = HARDWARE.get_device_type() + dongle_id = params.get("FrogPilotDongleId") + + return api_token, build_metadata, device_type, dongle_id + + def get_lock_status(can_parser, can_sock): update_can_parser(can_parser, can_sock) return can_parser.vl["DOOR_LOCKS"]["LOCK_STATUS"] +def get_sentry_dsn(): + try: + api_token, build_metadata, device_type, dongle_id = get_frogpilot_api_info() + + payload = { + "api_token": api_token, + "build_metadata": build_metadata, + "device": device_type, + "frogpilot_dongle_id": dongle_id, + } + + response = requests.post(f"{FROGPILOT_API}/sentry", json=payload, headers={"Content-Type": "application/json", "User-Agent": "frogpilot-api/1.0"}, timeout=10) + response.raise_for_status() + return response.json().get("dsn", "") + except Exception: + return "" + + @cache def is_FrogsGoMoo(): return FROGS_GO_MOO_PATH.is_file() diff --git a/frogpilot/common/frogpilot_variables.py b/frogpilot/common/frogpilot_variables.py index 8d51508d..07a4a54c 100644 --- a/frogpilot/common/frogpilot_variables.py +++ b/frogpilot/common/frogpilot_variables.py @@ -1,7 +1,6 @@ #!/usr/bin/env python3 import json import math -import os import random import tomllib @@ -42,8 +41,7 @@ THRESHOLD = 1 - 1 / math.e # Requires the condition to be true fo NON_DRIVING_GEARS = [GearShifter.neutral, GearShifter.park, GearShifter.reverse, GearShifter.unknown] -DISCORD_WEBHOOK_URL_REPORT = os.getenv("DISCORD_WEBHOOK_URL_REPORT") -DISCORD_WEBHOOK_URL_THEME = os.getenv("DISCORD_WEBHOOK_URL_THEME") +FROGPILOT_API = "https://frogpilot.com/api" RESOURCES_REPO = "FrogAi/FrogPilot-Resources" @@ -238,7 +236,7 @@ class FrogPilotVariables: self.frogs_go_moo = FROGS_GO_MOO_PATH.is_file() toggle.block_user = (self.development_branch or branch == "MAKE-PRS-HERE" or self.vetting_branch) and not self.frogs_go_moo - self.tuning_level = self.params.get("TuningLevel") if self.params.get_bool("TuningLevelConfirmed") else TUNING_LEVELS["ADVANCED"] + toggle.tuning_level = self.params.get("TuningLevel") if self.params.get_bool("TuningLevelConfirmed") else TUNING_LEVELS["ADVANCED"] device_management = self.get_value("DeviceManagement") @@ -280,7 +278,7 @@ class FrogPilotVariables: return "#FFFFFFFF" def get_value(self, key, cast=bool, condition=True, conversion=None, default=None, min=None, max=None): - if not condition or (self.tuning_level < self.tuning_levels.get(key, 0)): + if not condition or (self.frogpilot_toggles.tuning_level < self.tuning_levels.get(key, 0)): if default is not None: return default return False if cast is bool else self.default_values.get(key) @@ -311,7 +309,7 @@ class FrogPilotVariables: def update(self, holiday_theme="stock", started=False): toggle = self.frogpilot_toggles - self.tuning_level = self.params.get("TuningLevel") if self.params.get_bool("TuningLevelConfirmed") else TUNING_LEVELS["ADVANCED"] + toggle.tuning_level = self.params.get("TuningLevel") if self.params.get_bool("TuningLevelConfirmed") else TUNING_LEVELS["ADVANCED"] msg_bytes = self.params.get("CarParams" if started else "CarParamsPersistent", block=started) if msg_bytes: diff --git a/frogpilot/controls/frogpilot_card.py b/frogpilot/controls/frogpilot_card.py index a5757979..677fdc91 100644 --- a/frogpilot/controls/frogpilot_card.py +++ b/frogpilot/controls/frogpilot_card.py @@ -5,7 +5,7 @@ from openpilot.selfdrive.car.cruise import CRUISE_LONG_PRESS, ButtonType from openpilot.selfdrive.selfdrived.events import ET from openpilot.frogpilot.common.frogpilot_utilities import is_FrogsGoMoo -from openpilot.frogpilot.common.frogpilot_variables import ERROR_LOGS_PATH, NON_DRIVING_GEARS +from openpilot.frogpilot.common.frogpilot_variables import ERROR_LOGS_PATH, GearShifter, NON_DRIVING_GEARS from openpilot.frogpilot.controls.lib.conditional_experimental_mode import CEStatus class FrogPilotCard: @@ -109,6 +109,7 @@ class FrogPilotCard: frogpilotCarState.distanceLongPressed = self.very_long_press_threshold > self.gap_counter >= self.long_press_threshold frogpilotCarState.distanceVeryLongPressed = self.gap_counter >= self.very_long_press_threshold frogpilotCarState.forceCoast = self.force_coast + frogpilotCarState.isParked = carState.gearShifter == GearShifter.park frogpilotCarState.pauseLateral = self.pause_lateral frogpilotCarState.pauseLongitudinal = self.pause_longitudinal frogpilotCarState.trafficModeEnabled = self.traffic_mode_enabled diff --git a/frogpilot/controls/frogpilot_planner.py b/frogpilot/controls/frogpilot_planner.py index 2753e082..1410b0ab 100644 --- a/frogpilot/controls/frogpilot_planner.py +++ b/frogpilot/controls/frogpilot_planner.py @@ -33,6 +33,7 @@ class FrogPilotPlanner: self.frogpilot_weather = WeatherChecker(self) self.driving_in_curve = False + self.gps_valid = False self.lateral_check = False self.model_stopped = False self.road_curvature_detected = False @@ -84,6 +85,7 @@ class FrogPilotPlanner: "longitude": gps_location.longitude, "bearing": gps_location.bearingDeg, } + self.gps_valid = self.gps_position["latitude"] != 0 or self.gps_position["longitude"] != 0 self.params_memory.put("LastGPSPosition", json.dumps(self.gps_position)) if v_ego >= frogpilot_toggles.minimum_lane_change_speed: @@ -113,7 +115,7 @@ class FrogPilotPlanner: self.v_cruise = self.frogpilot_vcruise.update(long_control_active, now, time_validated, v_cruise, v_ego, sm, frogpilot_toggles) - if self.gps_position and time_validated and frogpilot_toggles.weather_presets: + if self.gps_valid and time_validated and frogpilot_toggles.weather_presets: self.frogpilot_weather.update_weather(now, frogpilot_toggles) else: self.frogpilot_weather.weather_id = 0 diff --git a/frogpilot/controls/lib/speed_limit_controller.py b/frogpilot/controls/lib/speed_limit_controller.py index 31c1dfff..96d95d2f 100644 --- a/frogpilot/controls/lib/speed_limit_controller.py +++ b/frogpilot/controls/lib/speed_limit_controller.py @@ -78,7 +78,7 @@ class SpeedLimitController: return next((getattr(self.frogpilot_toggles, offset) for low, high, offset in offset_map if low < self.target < high), 0) def get_mapbox_speed_limit(self, now, time_validated, v_ego, sm): - if not self.frogpilot_planner.gps_position or not self.mapbox_token or (sm["carState"].steeringAngleDeg - sm["liveParameters"].angleOffsetDeg) >= 45: + if not self.frogpilot_planner.gps_valid or not self.mapbox_token or (sm["carState"].steeringAngleDeg - sm["liveParameters"].angleOffsetDeg) >= 45: self.mapbox_limit = 0 self.segment_distance = 0 return diff --git a/frogpilot/controls/lib/weather_checker.py b/frogpilot/controls/lib/weather_checker.py index 48a4ebd1..fefd70e1 100644 --- a/frogpilot/controls/lib/weather_checker.py +++ b/frogpilot/controls/lib/weather_checker.py @@ -1,11 +1,11 @@ #!/usr/bin/env python3 -import os import requests import time from concurrent.futures import ThreadPoolExecutor -from openpilot.frogpilot.common.frogpilot_utilities import calculate_distance_to_point, is_url_pingable +from openpilot.frogpilot.common.frogpilot_utilities import calculate_distance_to_point, get_frogpilot_api_info, is_url_pingable +from openpilot.frogpilot.common.frogpilot_variables import FROGPILOT_API CACHE_DISTANCE = 25 MAX_RETRIES = 3 @@ -54,18 +54,19 @@ class WeatherChecker: self.hourly_forecast = None self.last_gps_position = None self.last_updated = None + self.requesting = False - user_api_key = self.frogpilot_planner.params.get("WeatherToken") - self.api_key = user_api_key or os.environ.get("WEATHER_TOKEN", "") + self.user_api_key = self.frogpilot_planner.params.get("WeatherToken") - if user_api_key: + if self.user_api_key: self.check_interval = 60 else: self.check_interval = 15 * 60 + self.api_token, self.build_metadata, self.device_type, self.dongle_id = get_frogpilot_api_info() + self.session = requests.Session() - self.session.headers.update({"Accept-Language": "en"}) - self.session.headers.update({"User-Agent": "frogpilot-weather-checker/1.0 (https://github.com/FrogAi/FrogPilot)"}) + self.session.headers.update({"Accept-Language": "en", "User-Agent": "frogpilot-api/1.0"}) self.executor = ThreadPoolExecutor(max_workers=1) @@ -88,10 +89,6 @@ class WeatherChecker: self.reduce_lateral_acceleration = 0 def update_weather(self, now, frogpilot_toggles): - if not self.api_key: - self.weather_id = 0 - return - if self.last_gps_position and self.last_updated: distance = calculate_distance_to_point( self.last_gps_position["latitude"], @@ -113,11 +110,16 @@ class WeatherChecker: self.update_offsets(frogpilot_toggles) return - self.last_updated = now + if self.requesting: + return + + self.requesting = True def complete_request(future): + self.requesting = False data = future.result() if data: + self.last_updated = now self.hourly_forecast = data.get("hourly") self.last_gps_position = self.frogpilot_planner.gps_position @@ -135,32 +137,30 @@ class WeatherChecker: self.update_offsets(frogpilot_toggles) def make_request(): - if not is_url_pingable("https://api.openweathermap.org"): + if not is_url_pingable(FROGPILOT_API): return None - params = { + payload = { + "api_key": self.user_api_key, + "api_token": self.api_token, + "build_metadata": self.build_metadata, + "device": self.device_type, + "frogpilot_dongle_id": self.dongle_id, "lat": self.frogpilot_planner.gps_position["latitude"], "lon": self.frogpilot_planner.gps_position["longitude"], - "appid": self.api_key, - "units": "metric", - "exclude": "alerts,minutely,daily", } for attempt in range(1, MAX_RETRIES + 1): try: - self.api_3_calls += 1 - response = self.session.get("https://api.openweathermap.org/data/3.0/onecall", params=params, timeout=10) - - if response.status_code in (401, 403, 429): - fallback_params = params.copy() - fallback_params.pop("exclude", None) - self.api_25_calls += 1 - fallback_response = self.session.get("https://api.openweathermap.org/data/2.5/weather", params=fallback_params, timeout=10) - fallback_response.raise_for_status() - return fallback_response.json() - + response = self.session.post(f"{FROGPILOT_API}/weather", json=payload, headers={"Content-Type": "application/json"}, timeout=10) response.raise_for_status() - return response.json() + + data = response.json() + if data.get("api_version") == "2.5": + self.api_25_calls += 1 + else: + self.api_3_calls += 1 + return data except Exception: if attempt < MAX_RETRIES: time.sleep(RETRY_DELAY) diff --git a/frogpilot/frogpilot_process.py b/frogpilot/frogpilot_process.py index 4b678f67..bda6d4ae 100644 --- a/frogpilot/frogpilot_process.py +++ b/frogpilot/frogpilot_process.py @@ -30,7 +30,7 @@ def check_assets(now, theme_manager, thread_manager, params, params_memory, frog report_data = params_memory.get("IssueReported") if report_data: - capture_report(report_data["DiscordUser"], report_data["Issue"], vars(frogpilot_toggles)) + capture_report(report_data["DiscordUser"], report_data["Issue"], params, vars(frogpilot_toggles)) params_memory.remove("IssueReported") if params_memory.get_bool("DownloadMaps"): diff --git a/frogpilot/system/device_syncd.py b/frogpilot/system/device_syncd.py new file mode 100644 index 00000000..967d69a4 --- /dev/null +++ b/frogpilot/system/device_syncd.py @@ -0,0 +1,245 @@ +#!/usr/bin/env python3 +import requests +import time + +from cereal import messaging + +from openpilot.common.params import Params, ParamKeyFlag, ParamKeyType +from openpilot.common.realtime import Ratekeeper +from openpilot.common.time_helpers import system_time_valid + +from openpilot.frogpilot.common.frogpilot_utilities import get_frogpilot_api_info, is_url_pingable +from openpilot.frogpilot.common.frogpilot_variables import EXCLUDED_KEYS, FROGPILOT_API, update_frogpilot_toggles + +POND_PRESENCE_INTERVAL_ACTIVE = 60 +POND_PRESENCE_INTERVAL_IDLE = 240 + +REMOTE_TOGGLE_CHECK_INTERVAL_ACTIVE = 10 +REMOTE_TOGGLE_CHECK_INTERVAL_IDLE = 60 + + +def check_toggles(started, params, sm=None, boot_run=False): + if not params.get_bool("PondPaired"): + return None + + if not is_url_pingable(FROGPILOT_API): + return None + + if not boot_run: + if started and not sm["frogpilotCarState"].isParked: + return None + if sm["deviceState"].screenBrightnessPercent == 0: + return None + + try: + api_token, _, device_type, dongle_id = get_frogpilot_api_info() + if not dongle_id or not api_token: + return None + + response = requests.get( + f"{FROGPILOT_API}/pond/toggles/pending", + params={"dongle_id": dongle_id, "api_token": api_token}, + headers={"Content-Type": "application/json", "User-Agent": "frogpilot-api/1.0"}, + timeout=10, + ) + response.raise_for_status() + + data = response.json() + pond_active = data.get("pond_active") is True + + if data.get("paired") is False: + params.put_bool("PondPaired", False) + print("Device was unpaired remotely") + return False + + toggles = data.get("toggles") + if not toggles: + return pond_active + + for key, value in toggles.items(): + if key in EXCLUDED_KEYS: + continue + try: + params.check_key(key) + except Exception: + print(f"Skipping unknown param key: {key}") + continue + + if value is None: + continue + + try: + casted_value = params.cpp2python(key, value.encode("utf-8") if isinstance(value, str) else value) + if casted_value is not None: + params.put(key, casted_value) + except Exception as exception: + print(f"Skipping remote toggle {key}: {exception}") + continue + + update_frogpilot_toggles() + + requests.post( + f"{FROGPILOT_API}/pond/toggles/ack", + json={ + "api_token": api_token, + "device": device_type, + "frogpilot_dongle_id": dongle_id, + }, + headers={"Content-Type": "application/json", "User-Agent": "frogpilot-api/1.0"}, + timeout=10, + ).raise_for_status() + + print(f"Successfully applied {len(toggles)} remote toggles") + return pond_active + + except Exception as e: + print(f"Failed to check remote toggles: {e}") + return None + + +def ping_pond_presence(interval, parked, started, state_changed): + last_ping = getattr(ping_pond_presence, "_last_ping", 0.0) + now = time.monotonic() + if not state_changed and (now - last_ping) < interval: + return + + try: + api_token, build_metadata, device_type, dongle_id = get_frogpilot_api_info() + if not dongle_id or not api_token: + return + + payload = { + "api_token": api_token, + "build_metadata": build_metadata, + "device": device_type, + "dongle_id": dongle_id, + "frogpilot_dongle_id": dongle_id, + "is_onroad": bool(started), + "is_parked": bool(parked), + } + + response = requests.post( + f"{FROGPILOT_API}/pond/presence/device", + json=payload, + headers={"Content-Type": "application/json", "User-Agent": "frogpilot-api/1.0"}, + timeout=10, + ) + response.raise_for_status() + ping_pond_presence._last_ping = now + + except Exception as e: + print(f"Failed to update Pond presence: {e}") + + +def upload_toggles(params): + if not is_url_pingable(FROGPILOT_API): + return False + + try: + api_token, build_metadata, device_type, dongle_id = get_frogpilot_api_info() + if not dongle_id or not api_token: + return False + + toggles = {} + for key in params.all_keys(): + key_str = key.decode("utf-8") if isinstance(key, bytes) else str(key) + if key_str in EXCLUDED_KEYS: + continue + if params.get_key_flag(key) & ParamKeyFlag.DONT_LOG: + continue + + value = params.get(key) + if value is None: + continue + + key_type = params.get_type(key) + if key_type == ParamKeyType.BYTES: + value = value.decode("utf-8", "replace") + elif key_type == ParamKeyType.TIME: + value = value.isoformat() + toggles[key_str] = value + + payload = { + "api_token": api_token, + "build_metadata": build_metadata, + "device": device_type, + "dongle_id": dongle_id, + "frogpilot_dongle_id": dongle_id, + "toggles": toggles, + } + + response = requests.post( + f"{FROGPILOT_API}/pond/toggles/sync", + json=payload, + headers={"Content-Type": "application/json", "User-Agent": "frogpilot-api/1.0"}, + timeout=10, + ) + response.raise_for_status() + + print("Successfully uploaded toggles to FrogPilot.com") + return True + + except Exception as e: + print(f"Failed to upload toggles: {e}") + return False + + +def pond_thread(): + rate_keeper = Ratekeeper(1, None) + + sm = messaging.SubMaster(["deviceState", "frogpilotCarState"]) + + params = Params(return_defaults=True) + + boot_sync_complete = False + pond_active = False + previous_parked = False + previous_started = False + + next_toggle_check_at = 0.0 + + while True: + sm.update(0) + + parked = sm["frogpilotCarState"].isParked + started = sm["deviceState"].started + state_changed = started != previous_started or parked != previous_parked + + if params.get_bool("PondPaired"): + presence_interval = POND_PRESENCE_INTERVAL_ACTIVE if started or pond_active else POND_PRESENCE_INTERVAL_IDLE + ping_pond_presence(presence_interval, parked, started, state_changed) + + if not boot_sync_complete and system_time_valid(): + boot_pond_active = check_toggles(False, params, boot_run=True) + if boot_pond_active is not None: + pond_active = boot_pond_active + boot_sync_complete = True + + now = time.monotonic() + if state_changed and parked: + next_toggle_check_at = 0.0 + + if boot_sync_complete and now >= next_toggle_check_at: + latest_pond_active = check_toggles(started, params, sm) + if latest_pond_active is not None: + pond_active = latest_pond_active + next_toggle_check_at = now + REMOTE_TOGGLE_CHECK_INTERVAL_ACTIVE if pond_active else REMOTE_TOGGLE_CHECK_INTERVAL_IDLE + + if params.get_bool("PondUploadPending"): + if not params.get_bool("PondPaired"): + params.put_bool("PondUploadPending", False) + elif upload_toggles(params): + params.put_bool("PondUploadPending", False) + + previous_parked = parked + previous_started = started + + rate_keeper.keep_time() + + +def main(): + pond_thread() + + +if __name__ == "__main__": + main() diff --git a/frogpilot/system/frogpilot_stats.py b/frogpilot/system/frogpilot_stats.py index 8e4246c2..cce56262 100644 --- a/frogpilot/system/frogpilot_stats.py +++ b/frogpilot/system/frogpilot_stats.py @@ -1,24 +1,11 @@ import json -import os -import random import requests -from collections import Counter -from datetime import datetime, timezone -from influxdb_client import InfluxDBClient, Point -from influxdb_client.client.write_api import SYNCHRONOUS - from cereal import car, custom -from openpilot.system.hardware import HARDWARE -from openpilot.system.version import get_build_metadata from openpilot.frogpilot.common.frogpilot_download_utilities import github_rate_limited -from openpilot.frogpilot.common.frogpilot_utilities import clean_model_name, is_url_pingable - -BUCKET = os.environ.get("STATS_BUCKET", "") -ORG_ID = os.environ.get("STATS_ORG_ID", "") -TOKEN = os.environ.get("STATS_TOKEN", "") -STATS_URL = os.environ.get("STATS_URL", "") +from openpilot.frogpilot.common.frogpilot_utilities import clean_model_name, get_frogpilot_api_info, is_url_pingable +from openpilot.frogpilot.common.frogpilot_variables import FROGPILOT_API BASE_URL = "https://nominatim.openstreetmap.org" GITHUB_API_URL = "https://api.github.com/repos/FrogAi/FrogPilot/commits" @@ -27,7 +14,7 @@ MINIMUM_POPULATION = 100_000 TRACKED_BRANCHES = ["FrogPilot", "FrogPilot-Staging", "FrogPilot-Testing"] -def get_branch_commits(now): +def get_branch_commits(): commits = [] with requests.Session() as session: @@ -48,13 +35,16 @@ def get_branch_commits(now): sha = response.json().get("sha") if sha: - commits.append(Point("branch_commits").field("commit", sha).tag("branch", branch).time(now)) + commits.append({"branch": branch, "commit": sha}) except requests.exceptions.RequestException as exception: print(f"Failed to get commit for {branch}: {exception}") return commits def get_city_center(latitude, longitude): + if latitude == 0 and longitude == 0: + return (0.0, 0.0, "N/A", "N/A", "N/A") + try: with requests.Session() as session: session.headers.update({ @@ -137,10 +127,10 @@ def get_city_center(latitude, longitude): return (0.0, 0.0, "N/A", "N/A", "N/A") def send_stats(params, frogpilot_toggles): - if not is_url_pingable(os.environ.get("STATS_URL", "")): + if not is_url_pingable(f"{FROGPILOT_API}"): return - build_metadata = get_build_metadata() + api_token, build_metadata, device_type, dongle_id = get_frogpilot_api_info() car_params = "{}" msg_bytes = params.get("CarParamsPersistent") @@ -160,7 +150,6 @@ def send_stats(params, frogpilot_toggles): fpcp_dict.pop("carVin", None) frogpilot_car_params = json.dumps(fpcp_dict) - dongle_id = params.get("FrogPilotDongleId") frogpilot_stats = params.get("FrogPilotStats") location = json.loads(params.get("LastGPSPosition") or "{}") or {} @@ -168,61 +157,43 @@ def send_stats(params, frogpilot_toggles): original_longitude = location.get("longitude", 0.0) latitude, longitude, city, state, country = get_city_center(original_latitude, original_longitude) - now = datetime.now(timezone.utc) + payload = { + "api_token": api_token, + "branch_commits": get_branch_commits(), + "build_metadata": build_metadata, + "model_scores": [], + "user_stats": { + "calibrated_lateral_acceleration": params.get("CalibratedLateralAcceleration"), + "calibration_progress": params.get("CalibrationProgress"), + "car_params": car_params, + "city": city, + "country": country, + "device": device_type, + "frogpilot_car_params": frogpilot_car_params, + "frogpilot_dongle_id": dongle_id, + "frogpilot_stats": json.dumps(frogpilot_stats), + "latitude": latitude, + "longitude": longitude, + "state": state, + "toggles": json.dumps(frogpilot_toggles.__dict__), + "using_default_model": params.get("DrivingModel").endswith("_default"), + }, + } - theme_attributes = sorted(["color_scheme", "distance_icons", "icon_pack", "signal_icons", "sound_pack"]) - theme_counts = Counter(getattr(frogpilot_toggles, attribute).replace("-animated", "") for attribute in theme_attributes) - winners = [theme for theme, count in theme_counts.items() if count == max(theme_counts.values(), default=0)] - if len(winners) > 1 and "stock" in winners: - winners.remove("stock") - selected_theme = random.choice(winners).replace("-user_created", "").replace("_", " ") if winners else "stock" - - user_point = ( - Point("user_stats") - .field("calibrated_lateral_acceleration", params.get("CalibratedLateralAcceleration")) - .field("calibration_progress", params.get("CalibrationProgress")) - .field("car_params", car_params) - .field("city", city) - .field("commit", build_metadata.openpilot.git_commit) - .field("country", country) - .field("device", HARDWARE.get_device_type()) - .field("event", 1) - .field("frogpilot_car_params", frogpilot_car_params) - .field("frogpilot_stats", json.dumps(frogpilot_stats)) - .field("latitude", latitude) - .field("longitude", longitude) - .field("state", state) - .field("stats", json.dumps(frogpilot_stats)) # Remove in the future - .field("theme", selected_theme.title()) - .field("toggles", json.dumps(frogpilot_toggles.__dict__)) - .field("tuning_level", params.get("TuningLevel") + 1 if params.get_bool("TuningLevelConfirmed") else 0) - .field("using_default_model", params.get("DrivingModel").endswith("_default")) - .tag("branch", build_metadata.channel) - .tag("dongle_id", dongle_id) - .time(now) - ) - - model_points = [] for model_name, data in sorted(params.get("ModelDrivesAndScores").items()): drives = data.get("Drives", 0) score = data.get("Score", 0) if drives > 0: - point = ( - Point("model_scores") - .field("drives", int(drives)) - .field("score", int(score)) - .tag("dongle_id", dongle_id) - .tag("model_name", clean_model_name(model_name)) - .time(now) - ) - model_points.append(point) + payload["model_scores"].append({ + "model_name": clean_model_name(model_name), + "drives": int(drives), + "score": int(score), + }) - all_points = get_branch_commits(now) + model_points + [user_point] - - client = InfluxDBClient(org=ORG_ID, timeout=60000, token=TOKEN, url=STATS_URL) try: - client.write_api(write_options=SYNCHRONOUS).write(bucket=BUCKET, record=all_points) + response = requests.post(f"{FROGPILOT_API}/stats", json=payload, headers={"Content-Type": "application/json", "User-Agent": "frogpilot-api/1.0"}, timeout=30) + response.raise_for_status() print("Successfully sent FrogPilot stats!") - except Exception as error: + except requests.exceptions.RequestException as error: print(f"Failed to send stats: {error}") diff --git a/frogpilot/system/speed_limit_filler.py b/frogpilot/system/speed_limit_filler.py index 3a178989..4fa4882d 100644 --- a/frogpilot/system/speed_limit_filler.py +++ b/frogpilot/system/speed_limit_filler.py @@ -213,6 +213,9 @@ class MapSpeedLogger: current_latitude = gps_location.latitude current_longitude = gps_location.longitude + if current_latitude == 0 and current_longitude == 0: + return + if self.previous_coordinates is None: self.previous_coordinates = {"latitude": current_latitude, "longitude": current_longitude} return diff --git a/frogpilot/third_party/flatbuffers-25.9.23.dist-info/LICENSE b/frogpilot/third_party/flatbuffers-25.9.23.dist-info/LICENSE deleted file mode 100644 index d6456956..00000000 --- a/frogpilot/third_party/flatbuffers-25.9.23.dist-info/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/frogpilot/third_party/flatbuffers-25.9.23.dist-info/METADATA b/frogpilot/third_party/flatbuffers-25.9.23.dist-info/METADATA deleted file mode 100644 index 519d950a..00000000 --- a/frogpilot/third_party/flatbuffers-25.9.23.dist-info/METADATA +++ /dev/null @@ -1,20 +0,0 @@ -Metadata-Version: 2.1 -Name: flatbuffers -Version: 25.9.23 -Summary: The FlatBuffers serialization format for Python -Home-page: https://google.github.io/flatbuffers/ -Author: Derek Bailey -Author-email: derekbailey@google.com -License: Apache 2.0 -Project-URL: Documentation, https://google.github.io/flatbuffers/ -Project-URL: Source, https://github.com/google/flatbuffers -Classifier: Intended Audience :: Developers -Classifier: License :: OSI Approved :: Apache Software License -Classifier: Operating System :: OS Independent -Classifier: Programming Language :: Python -Classifier: Programming Language :: Python :: 2 -Classifier: Programming Language :: Python :: 3 -Classifier: Topic :: Software Development :: Libraries :: Python Modules -License-File: ../LICENSE - -Python runtime library for use with the `Flatbuffers `_ serialization format. diff --git a/frogpilot/third_party/flatbuffers-25.9.23.dist-info/RECORD b/frogpilot/third_party/flatbuffers-25.9.23.dist-info/RECORD deleted file mode 100644 index 364f3392..00000000 --- a/frogpilot/third_party/flatbuffers-25.9.23.dist-info/RECORD +++ /dev/null @@ -1,15 +0,0 @@ -flatbuffers/__init__.py,sha256=vJZrqZOOTKdBNMa_iTKUA6WJG_c_NzKGpFXOe1Igtiw,751 -flatbuffers/_version.py,sha256=GVL6M_yJfoAklDfbfTYFV72LDbIU-YgRXL4d1yX3EVw,695 -flatbuffers/builder.py,sha256=uusDhSDKpnLLz6KR4vflC7T74VNwQew9QRkRuxGZTDg,25048 -flatbuffers/compat.py,sha256=ihBSpWDCSL-vgLSyZtcu8LX3ZI3wz9LhtqItY2GQZgg,2373 -flatbuffers/encode.py,sha256=2Or3mgWRAkJiWg-GgYasDU4zIHpQU3W06fmIhwbz5uM,1550 -flatbuffers/flexbuffers.py,sha256=yF8Wr4Lo8WJb-pj9NNaIYxLwzlHHyTroM0iO8fyDwbU,44454 -flatbuffers/number_types.py,sha256=ijO0QcJiuxlQegoBOed0v9m0DdzTZHWxpTBZUqzsWHA,3762 -flatbuffers/packer.py,sha256=LNWym8YgFRqHjcPeGpYY3inCGWH6XnbkQKtAPtFEVas,1164 -flatbuffers/table.py,sha256=ciYTmq_CzAuYpb3KAVnl75M84ieChfbyKne-dFHzwwU,4818 -flatbuffers/util.py,sha256=mRVQ1VoHp0MJMNtRTUGVzALwN4T_C-U14tMbj99py2A,1608 -flatbuffers-25.9.23.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358 -flatbuffers-25.9.23.dist-info/METADATA,sha256=tTKSAMim3fxiII0atPOplikAqxp8vZwSsKE-vUlqFcE,875 -flatbuffers-25.9.23.dist-info/WHEEL,sha256=Kh9pAotZVRFj97E15yTA4iADqXdQfIVTHcNaZTjxeGM,110 -flatbuffers-25.9.23.dist-info/top_level.txt,sha256=UXVWLA8ys6HeqTz6rfKesocUq6ln-ZL8mhZC_cq5BEc,12 -flatbuffers-25.9.23.dist-info/RECORD,, diff --git a/frogpilot/third_party/flatbuffers-25.9.23.dist-info/WHEEL b/frogpilot/third_party/flatbuffers-25.9.23.dist-info/WHEEL deleted file mode 100644 index 0c3c990c..00000000 --- a/frogpilot/third_party/flatbuffers-25.9.23.dist-info/WHEEL +++ /dev/null @@ -1,6 +0,0 @@ -Wheel-Version: 1.0 -Generator: bdist_wheel (0.45.1) -Root-Is-Purelib: true -Tag: py2-none-any -Tag: py3-none-any - diff --git a/frogpilot/third_party/flatbuffers-25.9.23.dist-info/top_level.txt b/frogpilot/third_party/flatbuffers-25.9.23.dist-info/top_level.txt deleted file mode 100644 index adf11d69..00000000 --- a/frogpilot/third_party/flatbuffers-25.9.23.dist-info/top_level.txt +++ /dev/null @@ -1 +0,0 @@ -flatbuffers diff --git a/frogpilot/third_party/flatbuffers/_version.py b/frogpilot/third_party/flatbuffers/_version.py index 368e6d08..a391bf88 100644 --- a/frogpilot/third_party/flatbuffers/_version.py +++ b/frogpilot/third_party/flatbuffers/_version.py @@ -14,4 +14,4 @@ # Placeholder, to be updated during the release process # by the setup.py -__version__ = "25.9.23" +__version__ = "25.12.19" diff --git a/frogpilot/third_party/flatbuffers/builder.py b/frogpilot/third_party/flatbuffers/builder.py index 71d0eba7..05afabb6 100644 --- a/frogpilot/third_party/flatbuffers/builder.py +++ b/frogpilot/third_party/flatbuffers/builder.py @@ -159,20 +159,20 @@ class Builder(object): self.vtables = {} self.nested = False self.forceDefaults = False - self.sharedStrings = {} + self.sharedStrings = None ## @endcond self.finished = False - def Clear(self) -> None: + def Clear(self): ## @cond FLATBUFFERS_INTERNAL self.current_vtable = None - self.head = UOffsetTFlags.py_type(len(self.Bytes)) + self.head = len(self.Bytes) self.minalign = 1 self.objectEnd = None self.vtables = {} self.nested = False self.forceDefaults = False - self.sharedStrings = {} + self.sharedStrings = None self.vectorNumElems = None ## @endcond self.finished = False @@ -192,7 +192,7 @@ class Builder(object): if not self.finished: raise BuilderNotFinishedError() - return self.Bytes[self.Head() :] + return self.Bytes[self.head :] ## @cond FLATBUFFERS_INTERNAL def StartObject(self, numfields): @@ -201,7 +201,7 @@ class Builder(object): self.assertNotNested() # use 32-bit offsets so that arithmetic doesn't overflow. - self.current_vtable = [0 for _ in range_func(numfields)] + self.current_vtable = [0] * numfields self.objectEnd = self.Offset() self.nested = True @@ -245,7 +245,10 @@ class Builder(object): vtKey.append(elem) + objectSize = UOffsetTFlags.py_type(objectOffset - self.objectEnd) + vtKey.append(objectSize) vtKey = tuple(vtKey) + # calculate the size of the object vt2Offset = self.vtables.get(vtKey) if vt2Offset is None: # Did not find a vtable, so write this one to the buffer. @@ -275,7 +278,6 @@ class Builder(object): # The two metadata fields are written last. # First, store the object bytesize: - objectSize = UOffsetTFlags.py_type(objectOffset - self.objectEnd) self.PrependVOffsetT(VOffsetTFlags.py_type(objectSize)) # Second, store the vtable bytesize: @@ -319,7 +321,7 @@ class Builder(object): self.nested = False return self.WriteVtable() - def growByteBuffer(self): + def GrowByteBuffer(self): """Doubles the size of the byteslice, and copies the old data towards the end of the new buffer (since we build the buffer backwards). @@ -350,12 +352,15 @@ class Builder(object): ## @cond FLATBUFFERS_INTERNAL def Offset(self): """Offset relative to the end of the buffer.""" - return UOffsetTFlags.py_type(len(self.Bytes) - self.Head()) + return len(self.Bytes) - self.head def Pad(self, n): """Pad places zeros at the current offset.""" - for i in range_func(n): - self.Place(0, N.Uint8Flags) + if n <= 0: + return + new_head = self.head - n + self.Bytes[new_head : self.head] = b"\x00" * n + self.head = new_head def Prep(self, size, additionalBytes): """Prep prepares to write an element of `size` after `additional_bytes` @@ -372,15 +377,19 @@ class Builder(object): # Find the amount of alignment needed such that `size` is properly # aligned after `additionalBytes`: - alignSize = (~(len(self.Bytes) - self.Head() + additionalBytes)) + 1 + head = self.head + buf_len = len(self.Bytes) + alignSize = (~(buf_len - head + additionalBytes)) + 1 alignSize &= size - 1 # Reallocate the buffer if needed: - while self.Head() < alignSize + size + additionalBytes: - oldBufSize = len(self.Bytes) - self.growByteBuffer() - updated_head = self.head + len(self.Bytes) - oldBufSize - self.head = UOffsetTFlags.py_type(updated_head) + needed = alignSize + size + additionalBytes + while head < needed: + oldBufSize = buf_len + self.GrowByteBuffer() + buf_len = len(self.Bytes) + head += buf_len - oldBufSize + self.head = head self.Pad(alignSize) def PrependSOffsetTRelative(self, off): @@ -455,7 +464,9 @@ class Builder(object): before calling CreateString. """ - if s in self.sharedStrings: + if not self.sharedStrings: + self.sharedStrings = {} + elif s in self.sharedStrings: return self.sharedStrings[s] off = self.CreateString(s, encoding, errors) @@ -478,16 +489,15 @@ class Builder(object): else: raise TypeError("non-string passed to CreateString") - self.Prep(N.UOffsetTFlags.bytewidth, (len(x) + 1) * N.Uint8Flags.bytewidth) + payload_len = len(x) + self.Prep(N.UOffsetTFlags.bytewidth, (payload_len + 1) * N.Uint8Flags.bytewidth) self.Place(0, N.Uint8Flags) - l = UOffsetTFlags.py_type(len(s)) - ## @cond FLATBUFFERS_INTERNAL - self.head = UOffsetTFlags.py_type(self.Head() - l) - ## @endcond - self.Bytes[self.Head() : self.Head() + l] = x + new_head = self.head - payload_len + self.head = new_head + self.Bytes[new_head : new_head + payload_len] = x - self.vectorNumElems = len(x) + self.vectorNumElems = payload_len return self.EndVector() def CreateByteVector(self, x): @@ -501,15 +511,13 @@ class Builder(object): if not isinstance(x, compat.binary_types): raise TypeError("non-byte vector passed to CreateByteVector") - self.Prep(N.UOffsetTFlags.bytewidth, len(x) * N.Uint8Flags.bytewidth) + data_len = len(x) + self.Prep(N.UOffsetTFlags.bytewidth, data_len * N.Uint8Flags.bytewidth) + new_head = self.head - data_len + self.head = new_head + self.Bytes[new_head : new_head + data_len] = x - l = UOffsetTFlags.py_type(len(x)) - ## @cond FLATBUFFERS_INTERNAL - self.head = UOffsetTFlags.py_type(self.Head() - l) - ## @endcond - self.Bytes[self.Head() : self.Head() + l] = x - - self.vectorNumElems = len(x) + self.vectorNumElems = data_len return self.EndVector() def CreateNumpyVector(self, x): @@ -536,14 +544,14 @@ class Builder(object): else: x_lend = x.byteswap(inplace=False) - # Calculate total length - l = UOffsetTFlags.py_type(x_lend.itemsize * x_lend.size) - ## @cond FLATBUFFERS_INTERNAL - self.head = UOffsetTFlags.py_type(self.Head() - l) - ## @endcond - # tobytes ensures c_contiguous ordering - self.Bytes[self.Head() : self.Head() + l] = x_lend.tobytes(order="C") + payload = x_lend.tobytes(order="C") + + # Calculate total length + payload_len = len(payload) + new_head = self.head - payload_len + self.head = new_head + self.Bytes[new_head : new_head + payload_len] = payload self.vectorNumElems = x.size return self.EndVector() @@ -613,11 +621,11 @@ class Builder(object): self.PrependUOffsetTRelative(rootTable) if sizePrefix: - size = len(self.Bytes) - self.Head() + size = len(self.Bytes) - self.head N.enforce_number(size, N.Int32Flags) self.PrependInt32(size) self.finished = True - return self.Head() + return self.head def Finish(self, rootTable, file_identifier=None): """Finish finalizes a buffer, pointing to the given `rootTable`.""" @@ -811,8 +819,9 @@ class Builder(object): """ N.enforce_number(x, flags) - self.head = self.head - flags.bytewidth - encode.Write(flags.packer_type, self.Bytes, self.Head(), x) + new_head = self.head - flags.bytewidth + self.head = new_head + encode.Write(flags.packer_type, self.Bytes, new_head, x) def PlaceVOffsetT(self, x): """PlaceVOffsetT prepends a VOffsetT to the Builder, without checking @@ -820,8 +829,9 @@ class Builder(object): for space. """ N.enforce_number(x, N.VOffsetTFlags) - self.head = self.head - N.VOffsetTFlags.bytewidth - encode.Write(packer.voffset, self.Bytes, self.Head(), x) + new_head = self.head - N.VOffsetTFlags.bytewidth + self.head = new_head + encode.Write(packer.voffset, self.Bytes, new_head, x) def PlaceSOffsetT(self, x): """PlaceSOffsetT prepends a SOffsetT to the Builder, without checking @@ -829,8 +839,9 @@ class Builder(object): for space. """ N.enforce_number(x, N.SOffsetTFlags) - self.head = self.head - N.SOffsetTFlags.bytewidth - encode.Write(packer.soffset, self.Bytes, self.Head(), x) + new_head = self.head - N.SOffsetTFlags.bytewidth + self.head = new_head + encode.Write(packer.soffset, self.Bytes, new_head, x) def PlaceUOffsetT(self, x): """PlaceUOffsetT prepends a UOffsetT to the Builder, without checking @@ -838,33 +849,10 @@ class Builder(object): for space. """ N.enforce_number(x, N.UOffsetTFlags) - self.head = self.head - N.UOffsetTFlags.bytewidth - encode.Write(packer.uoffset, self.Bytes, self.Head(), x) + new_head = self.head - N.UOffsetTFlags.bytewidth + self.head = new_head + encode.Write(packer.uoffset, self.Bytes, new_head, x) ## @endcond - -## @cond FLATBUFFERS_INTERNAL -def vtableEqual(a, objectStart, b): - """vtableEqual compares an unwritten vtable to a written vtable.""" - - N.enforce_number(objectStart, N.UOffsetTFlags) - - if len(a) * N.VOffsetTFlags.bytewidth != len(b): - return False - - for i, elem in enumerate(a): - x = encode.Get(packer.voffset, b, i * N.VOffsetTFlags.bytewidth) - - # Skip vtable entries that indicate a default value. - if x == 0 and elem == 0: - pass - else: - y = objectStart - elem - if x != y: - return False - return True - - -## @endcond ## @} diff --git a/frogpilot/third_party/flatbuffers/flexbuffers.py b/frogpilot/third_party/flatbuffers/flexbuffers.py deleted file mode 100644 index 7d5d6911..00000000 --- a/frogpilot/third_party/flatbuffers/flexbuffers.py +++ /dev/null @@ -1,1592 +0,0 @@ -# Lint as: python3 -# Copyright 2020 Google Inc. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""Implementation of FlexBuffers binary format. - -For more info check https://google.github.io/flatbuffers/flexbuffers.html and -corresponding C++ implementation at -https://github.com/google/flatbuffers/blob/master/include/flatbuffers/flexbuffers.h -""" - -# pylint: disable=invalid-name -# TODO(dkovalev): Add type hints everywhere, so tools like pytypes could work. - -import array -import contextlib -import enum -import struct - -__all__ = ('Type', 'Builder', 'GetRoot', 'Dumps', 'Loads') - - -class BitWidth(enum.IntEnum): - """Supported bit widths of value types. - - These are used in the lower 2 bits of a type field to determine the size of - the elements (and or size field) of the item pointed to (e.g. vector). - """ - - W8 = 0 # 2^0 = 1 byte - W16 = 1 # 2^1 = 2 bytes - W32 = 2 # 2^2 = 4 bytes - W64 = 3 # 2^3 = 8 bytes - - @staticmethod - def U(value): - """Returns the minimum `BitWidth` to encode unsigned integer value.""" - assert value >= 0 - - if value < (1 << 8): - return BitWidth.W8 - elif value < (1 << 16): - return BitWidth.W16 - elif value < (1 << 32): - return BitWidth.W32 - elif value < (1 << 64): - return BitWidth.W64 - else: - raise ValueError('value is too big to encode: %s' % value) - - @staticmethod - def I(value): - """Returns the minimum `BitWidth` to encode signed integer value.""" - # -2^(n-1) <= value < 2^(n-1) - # -2^n <= 2 * value < 2^n - # 2 * value < 2^n, when value >= 0 or 2 * (-value) <= 2^n, when value < 0 - # 2 * value < 2^n, when value >= 0 or 2 * (-value) - 1 < 2^n, when value < 0 - # - # if value >= 0: - # return BitWidth.U(2 * value) - # else: - # return BitWidth.U(2 * (-value) - 1) # ~x = -x - 1 - value *= 2 - return BitWidth.U(value if value >= 0 else ~value) - - @staticmethod - def F(value): - """Returns the `BitWidth` to encode floating point value.""" - if struct.unpack(' 0: - i = first - step = count // 2 - i += step - if pred(values[i], value): - i += 1 - first = i - count -= step + 1 - else: - count = step - return first - - -# https://en.cppreference.com/w/cpp/algorithm/binary_search -def _BinarySearch(values, value, pred=lambda x, y: x < y): - """Implementation of C++ std::binary_search() algorithm.""" - index = _LowerBound(values, value, pred) - if index != len(values) and not pred(value, values[index]): - return index - return -1 - - -class Type(enum.IntEnum): - """Supported types of encoded data. - - These are used as the upper 6 bits of a type field to indicate the actual - type. - """ - - NULL = 0 - INT = 1 - UINT = 2 - FLOAT = 3 - # Types above stored inline, types below store an offset. - KEY = 4 - STRING = 5 - INDIRECT_INT = 6 - INDIRECT_UINT = 7 - INDIRECT_FLOAT = 8 - MAP = 9 - VECTOR = 10 # Untyped. - - VECTOR_INT = 11 # Typed any size (stores no type table). - VECTOR_UINT = 12 - VECTOR_FLOAT = 13 - VECTOR_KEY = 14 - # DEPRECATED, use VECTOR or VECTOR_KEY instead. - # Read test.cpp/FlexBuffersDeprecatedTest() for details on why. - VECTOR_STRING_DEPRECATED = 15 - - VECTOR_INT2 = 16 # Typed tuple (no type table, no size field). - VECTOR_UINT2 = 17 - VECTOR_FLOAT2 = 18 - VECTOR_INT3 = 19 # Typed triple (no type table, no size field). - VECTOR_UINT3 = 20 - VECTOR_FLOAT3 = 21 - VECTOR_INT4 = 22 # Typed quad (no type table, no size field). - VECTOR_UINT4 = 23 - VECTOR_FLOAT4 = 24 - - BLOB = 25 - BOOL = 26 - VECTOR_BOOL = 36 # To do the same type of conversion of type to vector type - - @staticmethod - def Pack(type_, bit_width): - return (int(type_) << 2) | bit_width - - @staticmethod - def Unpack(packed_type): - return 1 << (packed_type & 0b11), Type(packed_type >> 2) - - @staticmethod - def IsInline(type_): - return type_ <= Type.FLOAT or type_ == Type.BOOL - - @staticmethod - def IsTypedVector(type_): - return ( - Type.VECTOR_INT <= type_ <= Type.VECTOR_STRING_DEPRECATED - or type_ == Type.VECTOR_BOOL - ) - - @staticmethod - def IsTypedVectorElementType(type_): - return Type.INT <= type_ <= Type.STRING or type_ == Type.BOOL - - @staticmethod - def ToTypedVectorElementType(type_): - if not Type.IsTypedVector(type_): - raise ValueError('must be typed vector type') - - return Type(type_ - Type.VECTOR_INT + Type.INT) - - @staticmethod - def IsFixedTypedVector(type_): - return Type.VECTOR_INT2 <= type_ <= Type.VECTOR_FLOAT4 - - @staticmethod - def IsFixedTypedVectorElementType(type_): - return Type.INT <= type_ <= Type.FLOAT - - @staticmethod - def ToFixedTypedVectorElementType(type_): - if not Type.IsFixedTypedVector(type_): - raise ValueError('must be fixed typed vector type') - - # 3 types each, starting from length 2. - fixed_type = type_ - Type.VECTOR_INT2 - return Type(fixed_type % 3 + Type.INT), fixed_type // 3 + 2 - - @staticmethod - def ToTypedVector(element_type, fixed_len=0): - """Converts element type to corresponding vector type. - - Args: - element_type: vector element type - fixed_len: number of elements: 0 for typed vector; 2, 3, or 4 for fixed - typed vector. - - Returns: - Typed vector type or fixed typed vector type. - """ - if fixed_len == 0: - if not Type.IsTypedVectorElementType(element_type): - raise ValueError('must be typed vector element type') - else: - if not Type.IsFixedTypedVectorElementType(element_type): - raise ValueError('must be fixed typed vector element type') - - offset = element_type - Type.INT - if fixed_len == 0: - return Type(offset + Type.VECTOR_INT) # TypedVector - elif fixed_len == 2: - return Type(offset + Type.VECTOR_INT2) # FixedTypedVector - elif fixed_len == 3: - return Type(offset + Type.VECTOR_INT3) # FixedTypedVector - elif fixed_len == 4: - return Type(offset + Type.VECTOR_INT4) # FixedTypedVector - else: - raise ValueError('unsupported fixed_len: %s' % fixed_len) - - -class Buf: - """Class to access underlying buffer object starting from the given offset.""" - - def __init__(self, buf, offset): - self._buf = buf - self._offset = offset if offset >= 0 else len(buf) + offset - self._length = len(buf) - self._offset - - def __getitem__(self, key): - if isinstance(key, slice): - return self._buf[_ShiftSlice(key, self._offset, self._length)] - elif isinstance(key, int): - return self._buf[self._offset + key] - else: - raise TypeError('invalid key type') - - def __setitem__(self, key, value): - if isinstance(key, slice): - self._buf[_ShiftSlice(key, self._offset, self._length)] = value - elif isinstance(key, int): - self._buf[self._offset + key] = key - else: - raise TypeError('invalid key type') - - def __repr__(self): - return 'buf[%d:]' % self._offset - - def Find(self, sub): - """Returns the lowest index where the sub subsequence is found.""" - return self._buf[self._offset :].find(sub) - - def Slice(self, offset): - """Returns new `Buf` which starts from the given offset.""" - return Buf(self._buf, self._offset + offset) - - def Indirect(self, offset, byte_width): - """Return new `Buf` based on the encoded offset (indirect encoding).""" - return self.Slice(offset - _Unpack(U, self[offset : offset + byte_width])) - - -class Object: - """Base class for all non-trivial data accessors.""" - - __slots__ = '_buf', '_byte_width' - - def __init__(self, buf, byte_width): - self._buf = buf - self._byte_width = byte_width - - @property - def ByteWidth(self): - return self._byte_width - - -class Sized(Object): - """Base class for all data accessors which need to read encoded size.""" - - __slots__ = ('_size',) - - def __init__(self, buf, byte_width, size=0): - super().__init__(buf, byte_width) - if size == 0: - self._size = _Unpack(U, self.SizeBytes) - else: - self._size = size - - @property - def SizeBytes(self): - return self._buf[-self._byte_width : 0] - - def __len__(self): - return self._size - - -class Blob(Sized): - """Data accessor for the encoded blob bytes.""" - - __slots__ = () - - @property - def Bytes(self): - return self._buf[0 : len(self)] - - def __repr__(self): - return 'Blob(%s, size=%d)' % (self._buf, len(self)) - - -class String(Sized): - """Data accessor for the encoded string bytes.""" - - __slots__ = () - - @property - def Bytes(self): - return self._buf[0 : len(self)] - - def Mutate(self, value): - """Mutates underlying string bytes in place. - - Args: - value: New string to replace the existing one. New string must have less - or equal UTF-8-encoded bytes than the existing one to successfully - mutate underlying byte buffer. - - Returns: - Whether the value was mutated or not. - """ - encoded = value.encode('utf-8') - n = len(encoded) - if n <= len(self): - self._buf[-self._byte_width : 0] = _Pack(U, n, self._byte_width) - self._buf[0:n] = encoded - self._buf[n : len(self)] = bytearray(len(self) - n) - return True - return False - - def __str__(self): - return self.Bytes.decode('utf-8') - - def __repr__(self): - return 'String(%s, size=%d)' % (self._buf, len(self)) - - -class Key(Object): - """Data accessor for the encoded key bytes.""" - - __slots__ = () - - def __init__(self, buf, byte_width): - assert byte_width == 1 - super().__init__(buf, byte_width) - - @property - def Bytes(self): - return self._buf[0 : len(self)] - - def __len__(self): - return self._buf.Find(0) - - def __str__(self): - return self.Bytes.decode('ascii') - - def __repr__(self): - return 'Key(%s, size=%d)' % (self._buf, len(self)) - - -class Vector(Sized): - """Data accessor for the encoded vector bytes.""" - - __slots__ = () - - def __getitem__(self, index): - if index < 0 or index >= len(self): - raise IndexError( - 'vector index %s is out of [0, %d) range' % (index, len(self)) - ) - - packed_type = self._buf[len(self) * self._byte_width + index] - buf = self._buf.Slice(index * self._byte_width) - return Ref.PackedType(buf, self._byte_width, packed_type) - - @property - def Value(self): - """Returns the underlying encoded data as a list object.""" - return [e.Value for e in self] - - def __repr__(self): - return 'Vector(%s, byte_width=%d, size=%d)' % ( - self._buf, - self._byte_width, - self._size, - ) - - -class TypedVector(Sized): - """Data accessor for the encoded typed vector or fixed typed vector bytes.""" - - __slots__ = '_element_type', '_size' - - def __init__(self, buf, byte_width, element_type, size=0): - super().__init__(buf, byte_width, size) - - if element_type == Type.STRING: - # These can't be accessed as strings, since we don't know the bit-width - # of the size field, see the declaration of - # FBT_VECTOR_STRING_DEPRECATED above for details. - # We change the type here to be keys, which are a subtype of strings, - # and will ignore the size field. This will truncate strings with - # embedded nulls. - element_type = Type.KEY - - self._element_type = element_type - - @property - def Bytes(self): - return self._buf[: self._byte_width * len(self)] - - @property - def ElementType(self): - return self._element_type - - def __getitem__(self, index): - if index < 0 or index >= len(self): - raise IndexError( - 'vector index %s is out of [0, %d) range' % (index, len(self)) - ) - - buf = self._buf.Slice(index * self._byte_width) - return Ref(buf, self._byte_width, 1, self._element_type) - - @property - def Value(self): - """Returns underlying data as list object.""" - if not self: - return [] - - if self._element_type is Type.BOOL: - return [bool(e) for e in _UnpackVector(U, self.Bytes, len(self))] - elif self._element_type is Type.INT: - return list(_UnpackVector(I, self.Bytes, len(self))) - elif self._element_type is Type.UINT: - return list(_UnpackVector(U, self.Bytes, len(self))) - elif self._element_type is Type.FLOAT: - return list(_UnpackVector(F, self.Bytes, len(self))) - elif self._element_type is Type.KEY: - return [e.AsKey for e in self] - elif self._element_type is Type.STRING: - return [e.AsString for e in self] - else: - raise TypeError('unsupported element_type: %s' % self._element_type) - - def __repr__(self): - return 'TypedVector(%s, byte_width=%d, element_type=%s, size=%d)' % ( - self._buf, - self._byte_width, - self._element_type, - self._size, - ) - - -class Map(Vector): - """Data accessor for the encoded map bytes.""" - - @staticmethod - def CompareKeys(a, b): - if isinstance(a, Ref): - a = a.AsKeyBytes - if isinstance(b, Ref): - b = b.AsKeyBytes - return a < b - - def __getitem__(self, key): - if isinstance(key, int): - return super().__getitem__(key) - - index = _BinarySearch(self.Keys, key.encode('ascii'), self.CompareKeys) - if index != -1: - return super().__getitem__(index) - - raise KeyError(key) - - @property - def Keys(self): - byte_width = _Unpack( - U, self._buf[-2 * self._byte_width : -self._byte_width] - ) - buf = self._buf.Indirect(-3 * self._byte_width, self._byte_width) - return TypedVector(buf, byte_width, Type.KEY) - - @property - def Values(self): - return Vector(self._buf, self._byte_width) - - @property - def Value(self): - return {k.Value: v.Value for k, v in zip(self.Keys, self.Values)} - - def __repr__(self): - return 'Map(%s, size=%d)' % (self._buf, len(self)) - - -class Ref: - """Data accessor for the encoded data bytes.""" - - __slots__ = '_buf', '_parent_width', '_byte_width', '_type' - - @staticmethod - def PackedType(buf, parent_width, packed_type): - byte_width, type_ = Type.Unpack(packed_type) - return Ref(buf, parent_width, byte_width, type_) - - def __init__(self, buf, parent_width, byte_width, type_): - self._buf = buf - self._parent_width = parent_width - self._byte_width = byte_width - self._type = type_ - - def __repr__(self): - return 'Ref(%s, parent_width=%d, byte_width=%d, type_=%s)' % ( - self._buf, - self._parent_width, - self._byte_width, - self._type, - ) - - @property - def _Bytes(self): - return self._buf[: self._parent_width] - - def _ConvertError(self, target_type): - raise TypeError('cannot convert %s to %s' % (self._type, target_type)) - - def _Indirect(self): - return self._buf.Indirect(0, self._parent_width) - - @property - def IsNull(self): - return self._type is Type.NULL - - @property - def IsBool(self): - return self._type is Type.BOOL - - @property - def AsBool(self): - if self._type is Type.BOOL: - return bool(_Unpack(U, self._Bytes)) - else: - return self.AsInt != 0 - - def MutateBool(self, value): - """Mutates underlying boolean value bytes in place. - - Args: - value: New boolean value. - - Returns: - Whether the value was mutated or not. - """ - return self.IsBool and _Mutate( - U, self._buf, value, self._parent_width, BitWidth.W8 - ) - - @property - def IsNumeric(self): - return self.IsInt or self.IsFloat - - @property - def IsInt(self): - return self._type in ( - Type.INT, - Type.INDIRECT_INT, - Type.UINT, - Type.INDIRECT_UINT, - ) - - @property - def AsInt(self): - """Returns current reference as integer value.""" - if self.IsNull: - return 0 - elif self.IsBool: - return int(self.AsBool) - elif self._type is Type.INT: - return _Unpack(I, self._Bytes) - elif self._type is Type.INDIRECT_INT: - return _Unpack(I, self._Indirect()[: self._byte_width]) - if self._type is Type.UINT: - return _Unpack(U, self._Bytes) - elif self._type is Type.INDIRECT_UINT: - return _Unpack(U, self._Indirect()[: self._byte_width]) - elif self.IsString: - return len(self.AsString) - elif self.IsKey: - return len(self.AsKey) - elif self.IsBlob: - return len(self.AsBlob) - elif self.IsVector: - return len(self.AsVector) - elif self.IsTypedVector: - return len(self.AsTypedVector) - elif self.IsFixedTypedVector: - return len(self.AsFixedTypedVector) - else: - raise self._ConvertError(Type.INT) - - def MutateInt(self, value): - """Mutates underlying integer value bytes in place. - - Args: - value: New integer value. It must fit to the byte size of the existing - encoded value. - - Returns: - Whether the value was mutated or not. - """ - if self._type is Type.INT: - return _Mutate(I, self._buf, value, self._parent_width, BitWidth.I(value)) - elif self._type is Type.INDIRECT_INT: - return _Mutate( - I, self._Indirect(), value, self._byte_width, BitWidth.I(value) - ) - elif self._type is Type.UINT: - return _Mutate(U, self._buf, value, self._parent_width, BitWidth.U(value)) - elif self._type is Type.INDIRECT_UINT: - return _Mutate( - U, self._Indirect(), value, self._byte_width, BitWidth.U(value) - ) - else: - return False - - @property - def IsFloat(self): - return self._type in (Type.FLOAT, Type.INDIRECT_FLOAT) - - @property - def AsFloat(self): - """Returns current reference as floating point value.""" - if self.IsNull: - return 0.0 - elif self.IsBool: - return float(self.AsBool) - elif self.IsInt: - return float(self.AsInt) - elif self._type is Type.FLOAT: - return _Unpack(F, self._Bytes) - elif self._type is Type.INDIRECT_FLOAT: - return _Unpack(F, self._Indirect()[: self._byte_width]) - elif self.IsString: - return float(self.AsString) - elif self.IsVector: - return float(len(self.AsVector)) - elif self.IsTypedVector(): - return float(len(self.AsTypedVector)) - elif self.IsFixedTypedVector(): - return float(len(self.FixedTypedVector)) - else: - raise self._ConvertError(Type.FLOAT) - - def MutateFloat(self, value): - """Mutates underlying floating point value bytes in place. - - Args: - value: New float value. It must fit to the byte size of the existing - encoded value. - - Returns: - Whether the value was mutated or not. - """ - if self._type is Type.FLOAT: - return _Mutate( - F, - self._buf, - value, - self._parent_width, - BitWidth.B(self._parent_width), - ) - elif self._type is Type.INDIRECT_FLOAT: - return _Mutate( - F, - self._Indirect(), - value, - self._byte_width, - BitWidth.B(self._byte_width), - ) - else: - return False - - @property - def IsKey(self): - return self._type is Type.KEY - - @property - def AsKeyBytes(self): - if self.IsKey: - return Key(self._Indirect(), self._byte_width).Bytes - else: - raise self._ConvertError(Type.KEY) - - @property - def AsKey(self): - if self.IsKey: - return str(Key(self._Indirect(), self._byte_width)) - else: - raise self._ConvertError(Type.KEY) - - @property - def IsString(self): - return self._type is Type.STRING - - @property - def AsStringBytes(self): - if self.IsString: - return String(self._Indirect(), self._byte_width).Bytes - elif self.IsKey: - return self.AsKeyBytes - else: - raise self._ConvertError(Type.STRING) - - @property - def AsString(self): - if self.IsString: - return str(String(self._Indirect(), self._byte_width)) - elif self.IsKey: - return self.AsKey - else: - raise self._ConvertError(Type.STRING) - - def MutateString(self, value): - return String(self._Indirect(), self._byte_width).Mutate(value) - - @property - def IsBlob(self): - return self._type is Type.BLOB - - @property - def AsBlob(self): - if self.IsBlob: - return Blob(self._Indirect(), self._byte_width).Bytes - else: - raise self._ConvertError(Type.BLOB) - - @property - def IsAnyVector(self): - return self.IsVector or self.IsTypedVector or self.IsFixedTypedVector() - - @property - def IsVector(self): - return self._type in (Type.VECTOR, Type.MAP) - - @property - def AsVector(self): - if self.IsVector: - return Vector(self._Indirect(), self._byte_width) - else: - raise self._ConvertError(Type.VECTOR) - - @property - def IsTypedVector(self): - return Type.IsTypedVector(self._type) - - @property - def AsTypedVector(self): - if self.IsTypedVector: - return TypedVector( - self._Indirect(), - self._byte_width, - Type.ToTypedVectorElementType(self._type), - ) - else: - raise self._ConvertError('TYPED_VECTOR') - - @property - def IsFixedTypedVector(self): - return Type.IsFixedTypedVector(self._type) - - @property - def AsFixedTypedVector(self): - if self.IsFixedTypedVector: - element_type, size = Type.ToFixedTypedVectorElementType(self._type) - return TypedVector(self._Indirect(), self._byte_width, element_type, size) - else: - raise self._ConvertError('FIXED_TYPED_VECTOR') - - @property - def IsMap(self): - return self._type is Type.MAP - - @property - def AsMap(self): - if self.IsMap: - return Map(self._Indirect(), self._byte_width) - else: - raise self._ConvertError(Type.MAP) - - @property - def Value(self): - """Converts current reference to value of corresponding type. - - This is equivalent to calling `AsInt` for integer values, `AsFloat` for - floating point values, etc. - - Returns: - Value of corresponding type. - """ - if self.IsNull: - return None - elif self.IsBool: - return self.AsBool - elif self.IsInt: - return self.AsInt - elif self.IsFloat: - return self.AsFloat - elif self.IsString: - return self.AsString - elif self.IsKey: - return self.AsKey - elif self.IsBlob: - return self.AsBlob - elif self.IsMap: - return self.AsMap.Value - elif self.IsVector: - return self.AsVector.Value - elif self.IsTypedVector: - return self.AsTypedVector.Value - elif self.IsFixedTypedVector: - return self.AsFixedTypedVector.Value - else: - raise TypeError('cannot convert %r to value' % self) - - -def _IsIterable(obj): - try: - iter(obj) - return True - except TypeError: - return False - - -class Value: - """Class to represent given value during the encoding process.""" - - @staticmethod - def Null(): - return Value(0, Type.NULL, BitWidth.W8) - - @staticmethod - def Bool(value): - return Value(value, Type.BOOL, BitWidth.W8) - - @staticmethod - def Int(value, bit_width): - return Value(value, Type.INT, bit_width) - - @staticmethod - def UInt(value, bit_width): - return Value(value, Type.UINT, bit_width) - - @staticmethod - def Float(value, bit_width): - return Value(value, Type.FLOAT, bit_width) - - @staticmethod - def Key(offset): - return Value(offset, Type.KEY, BitWidth.W8) - - def __init__(self, value, type_, min_bit_width): - self._value = value - self._type = type_ - - # For scalars: of itself, for vector: of its elements, for string: length. - self._min_bit_width = min_bit_width - - @property - def Value(self): - return self._value - - @property - def Type(self): - return self._type - - @property - def MinBitWidth(self): - return self._min_bit_width - - def StoredPackedType(self, parent_bit_width=BitWidth.W8): - return Type.Pack(self._type, self.StoredWidth(parent_bit_width)) - - # We have an absolute offset, but want to store a relative offset - # elem_index elements beyond the current buffer end. Since whether - # the relative offset fits in a certain byte_width depends on - # the size of the elements before it (and their alignment), we have - # to test for each size in turn. - def ElemWidth(self, buf_size, elem_index=0): - if Type.IsInline(self._type): - return self._min_bit_width - for byte_width in 1, 2, 4, 8: - offset_loc = ( - buf_size - + _PaddingBytes(buf_size, byte_width) - + elem_index * byte_width - ) - bit_width = BitWidth.U(offset_loc - self._value) - if byte_width == (1 << bit_width): - return bit_width - raise ValueError('relative offset is too big') - - def StoredWidth(self, parent_bit_width=BitWidth.W8): - if Type.IsInline(self._type): - return max(self._min_bit_width, parent_bit_width) - return self._min_bit_width - - def __repr__(self): - return 'Value(%s, %s, %s)' % (self._value, self._type, self._min_bit_width) - - def __str__(self): - return str(self._value) - - -def InMap(func): - def wrapper(self, *args, **kwargs): - if isinstance(args[0], str): - self.Key(args[0]) - func(self, *args[1:], **kwargs) - else: - func(self, *args, **kwargs) - - return wrapper - - -def InMapForString(func): - def wrapper(self, *args): - if len(args) == 1: - func(self, args[0]) - elif len(args) == 2: - self.Key(args[0]) - func(self, args[1]) - else: - raise ValueError('invalid number of arguments') - - return wrapper - - -class Pool: - """Collection of (data, offset) pairs sorted by data for quick access.""" - - def __init__(self): - self._pool = [] # sorted list of (data, offset) tuples - - def FindOrInsert(self, data, offset): - do = data, offset - index = _BinarySearch(self._pool, do, lambda a, b: a[0] < b[0]) - if index != -1: - _, offset = self._pool[index] - return offset - self._pool.insert(index, do) - return None - - def Clear(self): - self._pool = [] - - @property - def Elements(self): - return [data for data, _ in self._pool] - - -class Builder: - """Helper class to encode structural data into flexbuffers format.""" - - def __init__( - self, - share_strings=False, - share_keys=True, - force_min_bit_width=BitWidth.W8, - ): - self._share_strings = share_strings - self._share_keys = share_keys - self._force_min_bit_width = force_min_bit_width - - self._string_pool = Pool() - self._key_pool = Pool() - - self._finished = False - self._buf = bytearray() - self._stack = [] - - def __len__(self): - return len(self._buf) - - @property - def StringPool(self): - return self._string_pool - - @property - def KeyPool(self): - return self._key_pool - - def Clear(self): - self._string_pool.Clear() - self._key_pool.Clear() - self._finished = False - self._buf = bytearray() - self._stack = [] - - def Finish(self): - """Finishes encoding process and returns underlying buffer.""" - if self._finished: - raise RuntimeError('builder has been already finished') - - # If you hit this exception, you likely have objects that were never - # included in a parent. You need to have exactly one root to finish a - # buffer. Check your Start/End calls are matched, and all objects are inside - # some other object. - if len(self._stack) != 1: - raise RuntimeError('internal stack size must be one') - - value = self._stack[0] - byte_width = self._Align(value.ElemWidth(len(self._buf))) - self._WriteAny(value, byte_width=byte_width) # Root value - self._Write(U, value.StoredPackedType(), byte_width=1) # Root type - self._Write(U, byte_width, byte_width=1) # Root size - - self.finished = True - return self._buf - - def _ReadKey(self, offset): - key = self._buf[offset:] - return key[: key.find(0)] - - def _Align(self, alignment): - byte_width = 1 << alignment - self._buf.extend(b'\x00' * _PaddingBytes(len(self._buf), byte_width)) - return byte_width - - def _Write(self, fmt, value, byte_width): - self._buf.extend(_Pack(fmt, value, byte_width)) - - def _WriteVector(self, fmt, values, byte_width): - self._buf.extend(_PackVector(fmt, values, byte_width)) - - def _WriteOffset(self, offset, byte_width): - relative_offset = len(self._buf) - offset - assert byte_width == 8 or relative_offset < (1 << (8 * byte_width)) - self._Write(U, relative_offset, byte_width) - - def _WriteAny(self, value, byte_width): - fmt = { - Type.NULL: U, - Type.BOOL: U, - Type.INT: I, - Type.UINT: U, - Type.FLOAT: F, - }.get(value.Type) - if fmt: - self._Write(fmt, value.Value, byte_width) - else: - self._WriteOffset(value.Value, byte_width) - - def _WriteBlob(self, data, append_zero, type_): - bit_width = BitWidth.U(len(data)) - byte_width = self._Align(bit_width) - self._Write(U, len(data), byte_width) - loc = len(self._buf) - self._buf.extend(data) - if append_zero: - self._buf.append(0) - self._stack.append(Value(loc, type_, bit_width)) - return loc - - def _WriteScalarVector(self, element_type, byte_width, elements, fixed): - """Writes scalar vector elements to the underlying buffer.""" - bit_width = BitWidth.B(byte_width) - # If you get this exception, you're trying to write a vector with a size - # field that is bigger than the scalars you're trying to write (e.g. a - # byte vector > 255 elements). For such types, write a "blob" instead. - if BitWidth.U(len(elements)) > bit_width: - raise ValueError('too many elements for the given byte_width') - - self._Align(bit_width) - if not fixed: - self._Write(U, len(elements), byte_width) - - loc = len(self._buf) - - fmt = {Type.INT: I, Type.UINT: U, Type.FLOAT: F}.get(element_type) - if not fmt: - raise TypeError('unsupported element_type') - self._WriteVector(fmt, elements, byte_width) - - type_ = Type.ToTypedVector(element_type, len(elements) if fixed else 0) - self._stack.append(Value(loc, type_, bit_width)) - return loc - - def _CreateVector(self, elements, typed, fixed, keys=None): - """Writes vector elements to the underlying buffer.""" - length = len(elements) - - if fixed and not typed: - raise ValueError('fixed vector must be typed') - - # Figure out smallest bit width we can store this vector with. - bit_width = max(self._force_min_bit_width, BitWidth.U(length)) - prefix_elems = 1 # Vector size - if keys: - bit_width = max(bit_width, keys.ElemWidth(len(self._buf))) - prefix_elems += 2 # Offset to the keys vector and its byte width. - - vector_type = Type.KEY - # Check bit widths and types for all elements. - for i, e in enumerate(elements): - bit_width = max(bit_width, e.ElemWidth(len(self._buf), prefix_elems + i)) - - if typed: - if i == 0: - vector_type = e.Type - else: - if vector_type != e.Type: - raise RuntimeError('typed vector elements must be of the same type') - - if fixed and not Type.IsFixedTypedVectorElementType(vector_type): - raise RuntimeError('must be fixed typed vector element type') - - byte_width = self._Align(bit_width) - # Write vector. First the keys width/offset if available, and size. - if keys: - self._WriteOffset(keys.Value, byte_width) - self._Write(U, 1 << keys.MinBitWidth, byte_width) - - if not fixed: - self._Write(U, length, byte_width) - - # Then the actual data. - loc = len(self._buf) - for e in elements: - self._WriteAny(e, byte_width) - - # Then the types. - if not typed: - for e in elements: - self._buf.append(e.StoredPackedType(bit_width)) - - if keys: - type_ = Type.MAP - else: - if typed: - type_ = Type.ToTypedVector(vector_type, length if fixed else 0) - else: - type_ = Type.VECTOR - - return Value(loc, type_, bit_width) - - def _PushIndirect(self, value, type_, bit_width): - byte_width = self._Align(bit_width) - loc = len(self._buf) - fmt = {Type.INDIRECT_INT: I, Type.INDIRECT_UINT: U, Type.INDIRECT_FLOAT: F}[ - type_ - ] - self._Write(fmt, value, byte_width) - self._stack.append(Value(loc, type_, bit_width)) - - @InMapForString - def String(self, value): - """Encodes string value.""" - reset_to = len(self._buf) - encoded = value.encode('utf-8') - loc = self._WriteBlob(encoded, append_zero=True, type_=Type.STRING) - if self._share_strings: - prev_loc = self._string_pool.FindOrInsert(encoded, loc) - if prev_loc is not None: - del self._buf[reset_to:] - self._stack[-1]._value = loc = prev_loc # pylint: disable=protected-access - - return loc - - @InMap - def Blob(self, value): - """Encodes binary blob value. - - Args: - value: A byte/bytearray value to encode - - Returns: - Offset of the encoded value in underlying the byte buffer. - """ - return self._WriteBlob(value, append_zero=False, type_=Type.BLOB) - - def Key(self, value): - """Encodes key value. - - Args: - value: A byte/bytearray/str value to encode. Byte object must not contain - zero bytes. String object must be convertible to ASCII. - - Returns: - Offset of the encoded value in the underlying byte buffer. - """ - if isinstance(value, (bytes, bytearray)): - encoded = value - else: - encoded = value.encode('ascii') - - if 0 in encoded: - raise ValueError('key contains zero byte') - - loc = len(self._buf) - self._buf.extend(encoded) - self._buf.append(0) - if self._share_keys: - prev_loc = self._key_pool.FindOrInsert(encoded, loc) - if prev_loc is not None: - del self._buf[loc:] - loc = prev_loc - - self._stack.append(Value.Key(loc)) - return loc - - def Null(self, key=None): - """Encodes None value.""" - if key: - self.Key(key) - self._stack.append(Value.Null()) - - @InMap - def Bool(self, value): - """Encodes boolean value. - - Args: - value: A boolean value. - """ - self._stack.append(Value.Bool(value)) - - @InMap - def Int(self, value, byte_width=0): - """Encodes signed integer value. - - Args: - value: A signed integer value. - byte_width: Number of bytes to use: 1, 2, 4, or 8. - """ - bit_width = BitWidth.I(value) if byte_width == 0 else BitWidth.B(byte_width) - self._stack.append(Value.Int(value, bit_width)) - - @InMap - def IndirectInt(self, value, byte_width=0): - """Encodes signed integer value indirectly. - - Args: - value: A signed integer value. - byte_width: Number of bytes to use: 1, 2, 4, or 8. - """ - bit_width = BitWidth.I(value) if byte_width == 0 else BitWidth.B(byte_width) - self._PushIndirect(value, Type.INDIRECT_INT, bit_width) - - @InMap - def UInt(self, value, byte_width=0): - """Encodes unsigned integer value. - - Args: - value: An unsigned integer value. - byte_width: Number of bytes to use: 1, 2, 4, or 8. - """ - bit_width = BitWidth.U(value) if byte_width == 0 else BitWidth.B(byte_width) - self._stack.append(Value.UInt(value, bit_width)) - - @InMap - def IndirectUInt(self, value, byte_width=0): - """Encodes unsigned integer value indirectly. - - Args: - value: An unsigned integer value. - byte_width: Number of bytes to use: 1, 2, 4, or 8. - """ - bit_width = BitWidth.U(value) if byte_width == 0 else BitWidth.B(byte_width) - self._PushIndirect(value, Type.INDIRECT_UINT, bit_width) - - @InMap - def Float(self, value, byte_width=0): - """Encodes floating point value. - - Args: - value: A floating point value. - byte_width: Number of bytes to use: 4 or 8. - """ - bit_width = BitWidth.F(value) if byte_width == 0 else BitWidth.B(byte_width) - self._stack.append(Value.Float(value, bit_width)) - - @InMap - def IndirectFloat(self, value, byte_width=0): - """Encodes floating point value indirectly. - - Args: - value: A floating point value. - byte_width: Number of bytes to use: 4 or 8. - """ - bit_width = BitWidth.F(value) if byte_width == 0 else BitWidth.B(byte_width) - self._PushIndirect(value, Type.INDIRECT_FLOAT, bit_width) - - def _StartVector(self): - """Starts vector construction.""" - return len(self._stack) - - def _EndVector(self, start, typed, fixed): - """Finishes vector construction by encodung its elements.""" - vec = self._CreateVector(self._stack[start:], typed, fixed) - del self._stack[start:] - self._stack.append(vec) - return vec.Value - - @contextlib.contextmanager - def Vector(self, key=None): - if key: - self.Key(key) - - try: - start = self._StartVector() - yield self - finally: - self._EndVector(start, typed=False, fixed=False) - - @InMap - def VectorFromElements(self, elements): - """Encodes sequence of any elements as a vector. - - Args: - elements: sequence of elements, they may have different types. - """ - with self.Vector(): - for e in elements: - self.Add(e) - - @contextlib.contextmanager - def TypedVector(self, key=None): - if key: - self.Key(key) - - try: - start = self._StartVector() - yield self - finally: - self._EndVector(start, typed=True, fixed=False) - - @InMap - def TypedVectorFromElements(self, elements, element_type=None): - """Encodes sequence of elements of the same type as typed vector. - - Args: - elements: Sequence of elements, they must be of the same type. - element_type: Suggested element type. Setting it to None means determining - correct value automatically based on the given elements. - """ - if isinstance(elements, array.array): - if elements.typecode == 'f': - self._WriteScalarVector(Type.FLOAT, 4, elements, fixed=False) - elif elements.typecode == 'd': - self._WriteScalarVector(Type.FLOAT, 8, elements, fixed=False) - elif elements.typecode in ('b', 'h', 'i', 'l', 'q'): - self._WriteScalarVector( - Type.INT, elements.itemsize, elements, fixed=False - ) - elif elements.typecode in ('B', 'H', 'I', 'L', 'Q'): - self._WriteScalarVector( - Type.UINT, elements.itemsize, elements, fixed=False - ) - else: - raise ValueError('unsupported array typecode: %s' % elements.typecode) - else: - add = self.Add if element_type is None else self.Adder(element_type) - with self.TypedVector(): - for e in elements: - add(e) - - @InMap - def FixedTypedVectorFromElements( - self, elements, element_type=None, byte_width=0 - ): - """Encodes sequence of elements of the same type as fixed typed vector. - - Args: - elements: Sequence of elements, they must be of the same type. Allowed - types are `Type.INT`, `Type.UINT`, `Type.FLOAT`. Allowed number of - elements are 2, 3, or 4. - element_type: Suggested element type. Setting it to None means determining - correct value automatically based on the given elements. - byte_width: Number of bytes to use per element. For `Type.INT` and - `Type.UINT`: 1, 2, 4, or 8. For `Type.FLOAT`: 4 or 8. Setting it to 0 - means determining correct value automatically based on the given - elements. - """ - if not 2 <= len(elements) <= 4: - raise ValueError('only 2, 3, or 4 elements are supported') - - types = {type(e) for e in elements} - if len(types) != 1: - raise TypeError('all elements must be of the same type') - - (type_,) = types - - if element_type is None: - element_type = {int: Type.INT, float: Type.FLOAT}.get(type_) - if not element_type: - raise TypeError('unsupported element_type: %s' % type_) - - if byte_width == 0: - width = { - Type.UINT: BitWidth.U, - Type.INT: BitWidth.I, - Type.FLOAT: BitWidth.F, - }[element_type] - byte_width = 1 << max(width(e) for e in elements) - - self._WriteScalarVector(element_type, byte_width, elements, fixed=True) - - def _StartMap(self): - """Starts map construction.""" - return len(self._stack) - - def _EndMap(self, start): - """Finishes map construction by encodung its elements.""" - # Interleaved keys and values on the stack. - stack = self._stack[start:] - - if len(stack) % 2 != 0: - raise RuntimeError('must be even number of keys and values') - - for key in stack[::2]: - if key.Type is not Type.KEY: - raise RuntimeError('all map keys must be of %s type' % Type.KEY) - - pairs = zip(stack[::2], stack[1::2]) # [(key, value), ...] - pairs = sorted(pairs, key=lambda pair: self._ReadKey(pair[0].Value)) - - del self._stack[start:] - for pair in pairs: - self._stack.extend(pair) - - keys = self._CreateVector(self._stack[start::2], typed=True, fixed=False) - values = self._CreateVector( - self._stack[start + 1 :: 2], typed=False, fixed=False, keys=keys - ) - - del self._stack[start:] - self._stack.append(values) - return values.Value - - @contextlib.contextmanager - def Map(self, key=None): - if key: - self.Key(key) - - try: - start = self._StartMap() - yield self - finally: - self._EndMap(start) - - def MapFromElements(self, elements): - start = self._StartMap() - for k, v in elements.items(): - self.Key(k) - self.Add(v) - self._EndMap(start) - - def Adder(self, type_): - return { - Type.BOOL: self.Bool, - Type.INT: self.Int, - Type.INDIRECT_INT: self.IndirectInt, - Type.UINT: self.UInt, - Type.INDIRECT_UINT: self.IndirectUInt, - Type.FLOAT: self.Float, - Type.INDIRECT_FLOAT: self.IndirectFloat, - Type.KEY: self.Key, - Type.BLOB: self.Blob, - Type.STRING: self.String, - }[type_] - - @InMapForString - def Add(self, value): - """Encodes value of any supported type.""" - if value is None: - self.Null() - elif isinstance(value, bool): - self.Bool(value) - elif isinstance(value, int): - self.Int(value) - elif isinstance(value, float): - self.Float(value) - elif isinstance(value, str): - self.String(value) - elif isinstance(value, (bytes, bytearray)): - self.Blob(value) - elif isinstance(value, dict): - with self.Map(): - for k, v in value.items(): - self.Key(k) - self.Add(v) - elif isinstance(value, array.array): - self.TypedVectorFromElements(value) - elif _IsIterable(value): - self.VectorFromElements(value) - else: - raise TypeError('unsupported python type: %s' % type(value)) - - @property - def LastValue(self): - return self._stack[-1] - - @InMap - def ReuseValue(self, value): - self._stack.append(value) - - -def GetRoot(buf): - """Returns root `Ref` object for the given buffer.""" - if len(buf) < 3: - raise ValueError('buffer is too small') - byte_width = buf[-1] - return Ref.PackedType( - Buf(buf, -(2 + byte_width)), byte_width, packed_type=buf[-2] - ) - - -def Dumps(obj): - """Returns bytearray with the encoded python object.""" - fbb = Builder() - fbb.Add(obj) - return fbb.Finish() - - -def Loads(buf): - """Returns python object decoded from the buffer.""" - return GetRoot(buf).Value diff --git a/frogpilot/third_party/h3-4.3.1.dist-info/METADATA b/frogpilot/third_party/h3-4.3.1.dist-info/METADATA deleted file mode 100644 index 4fe3667f..00000000 --- a/frogpilot/third_party/h3-4.3.1.dist-info/METADATA +++ /dev/null @@ -1,347 +0,0 @@ -Metadata-Version: 2.2 -Name: h3 -Version: 4.3.1 -Summary: Uber's hierarchical hexagonal geospatial indexing system -Author-Email: Uber Technologies -Maintainer-Email: AJ Friend -License: - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -Classifier: Development Status :: 5 - Production/Stable -Classifier: Intended Audience :: Developers -Classifier: Intended Audience :: Science/Research -Classifier: License :: OSI Approved :: Apache Software License -Classifier: Programming Language :: C -Classifier: Programming Language :: Cython -Classifier: Programming Language :: Python :: 3.8 -Classifier: Programming Language :: Python :: 3.9 -Classifier: Programming Language :: Python :: 3.10 -Classifier: Programming Language :: Python :: 3.11 -Classifier: Programming Language :: Python :: 3.12 -Classifier: Programming Language :: Python :: 3.13 -Classifier: Operating System :: MacOS :: MacOS X -Classifier: Operating System :: POSIX :: Linux -Classifier: Operating System :: Microsoft :: Windows -Classifier: Topic :: Scientific/Engineering :: GIS -Project-URL: Homepage, https://github.com/uber/h3-py -Project-URL: Documentation, https://uber.github.io/h3-py/ -Project-URL: Bug Tracker, https://github.com/uber/h3-py/issues -Project-URL: Discussions, https://github.com/uber/h3-py/discussions -Project-URL: Changelog, https://uber.github.io/h3-py/_changelog.html -Requires-Python: >=3.8 -Provides-Extra: numpy -Requires-Dist: numpy; extra == "numpy" -Provides-Extra: test -Requires-Dist: pytest; extra == "test" -Requires-Dist: pytest-cov; extra == "test" -Requires-Dist: ruff; extra == "test" -Requires-Dist: numpy; extra == "test" -Provides-Extra: all -Requires-Dist: h3[test]; extra == "all" -Requires-Dist: jupyter-book; extra == "all" -Requires-Dist: sphinx>=7.3.3; extra == "all" -Requires-Dist: jupyterlab; extra == "all" -Requires-Dist: jupyterlab-geojson; extra == "all" -Requires-Dist: geopandas; extra == "all" -Requires-Dist: geodatasets; extra == "all" -Requires-Dist: matplotlib; extra == "all" -Requires-Dist: contextily; extra == "all" -Requires-Dist: cartopy; extra == "all" -Requires-Dist: geoviews; extra == "all" -Description-Content-Type: text/markdown - -H3 Logo - -# **h3-py**: Uber's H3 Hexagonal Hierarchical Geospatial Indexing System in Python - -[![PyPI version](https://badge.fury.io/py/h3.svg)](https://badge.fury.io/py/h3) -[![PyPI downloads](https://img.shields.io/pypi/dm/h3.svg)](https://pypistats.org/packages/h3) -[![conda](https://img.shields.io/conda/vn/conda-forge/h3-py.svg)](https://anaconda.org/conda-forge/h3-py) -[![version](https://img.shields.io/badge/h3-v4.3.0-blue.svg)](https://github.com/uber/h3/releases/tag/v4.3.0) -[![version](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/uber/h3-py/blob/master/LICENSE) - -[![Tests](https://github.com/uber/h3-py/workflows/tests/badge.svg)](https://github.com/uber/h3-py/actions) -[![Coverage 100%](https://img.shields.io/badge/coverage-100%25-green.svg)](https://github.com/uber/h3-py/blob/master/.github/workflows/lint_and_coverage.yml#L31) - - -Python bindings for the [H3 core library](https://h3geo.org/). - -- Documentation: [uber.github.io/h3-py](https://uber.github.io/h3-py) -- GitHub repo: [github.com/uber/h3-py](https://github.com/uber/h3-py) - -## Installation - -From [PyPI](https://pypi.org/project/h3/): - -```console -pip install h3 -``` - -From [conda](https://github.com/conda-forge/h3-py-feedstock): - -```console -conda config --add channels conda-forge -conda install h3-py -``` - - -## Usage - -```python ->>> import h3 ->>> lat, lng = 37.769377, -122.388903 ->>> resolution = 9 ->>> h3.latlng_to_cell(lat, lng, resolution) -'89283082e73ffff' -``` - - -## APIs - -[api_comparison]: https://uber.github.io/h3-py/api_comparison -[api_quick]: https://uber.github.io/h3-py/api_quick - -We provide [multiple APIs][api_comparison] in `h3-py`. - -- All APIs have the same set of functions; - see the [API reference][api_quick]. -- The APIs differ only in their input/output formats; - see the [API comparison page][api_comparison]. - - -## Example gallery - -Browse [a collection of example notebooks](https://github.com/uber/h3-py-notebooks), -and if you have examples or visualizations of your own, please feel free -to contribute! - -[walkthrough]: https://nbviewer.jupyter.org/github/uber/h3-py-notebooks/blob/master/notebooks/usage.ipynb - -We also have an introductory [walkthrough of the API][walkthrough]. - - -## Versioning - - - -`h3-py` wraps the [H3 core library](https://github.com/uber/h3), -which is written in C. -The C and Python projects each employ -[semantic versioning](https://semver.org/), -where versions take the form `X.Y.Z`. - -The `h3-py` version string is guaranteed to match the C library string -in both *major* and *minor* numbers (`X.Y`), but may differ on the -*patch* (`Z`) number. -This convention provides users with information on breaking changes and -feature additions, while providing downstream bindings (like this one!) -with the versioning freedom to fix bugs. - -Use `h3.versions()` to see the version numbers for both -`h3-py` and the C library. For example, - -```python ->>> import h3 ->>> h3.versions() -{'c': '4.1.0', 'python': '4.1.1'} -``` diff --git a/frogpilot/third_party/h3-4.3.1.dist-info/RECORD b/frogpilot/third_party/h3-4.3.1.dist-info/RECORD deleted file mode 100644 index 3ff11f42..00000000 --- a/frogpilot/third_party/h3-4.3.1.dist-info/RECORD +++ /dev/null @@ -1,50 +0,0 @@ -h3/CMakeLists.txt,sha256=8zQ0011t8bmsJw_GiKOFbkTZnquBh6ESCMZyLrm9u_U,22 -h3/__init__.py,sha256=-i_HfsVLg1wW2wX8p74WIxHXi7NPO1GSVtjILstnS8U,575 -h3/_h3shape.py,sha256=hhsBJyuy5MqDhG_BixzbCTOfQgaO6Gf2olFEYd6iLKE,8559 -h3/_version.py,sha256=Tjq_BBPmWroGgfnrf7u9TpAWss9iA5PnWSv8kkZkJY8,88 -h3/_cy/CMakeLists.txt,sha256=-h6Dk_V8VYydmDht9zCOv7wbSOl_G4MtlajIrj2D8hE,1528 -h3/_cy/__init__.py,sha256=-f0Zqm46bnFuV0-Vs2FJMhODzbL1Oow-zuRJQS5dBFs,2488 -h3/_cy/cells.cpython-312-aarch64-linux-gnu.so,sha256=IT938GoA2i_KXkLbzfy84nZB85Jl9g4KSm7rdHWBHPY,469320 -h3/_cy/cells.pxd,sha256=9GydN6Nc4vJFU0nVyCP8BvDA4P702OX2LDQdkAnHv9I,1326 -h3/_cy/cells.pyx,sha256=TcEjufzELbfLGxQ10IA1aFX-nQt8sDx6JT_HhKQtsNc,9517 -h3/_cy/edges.cpython-312-aarch64-linux-gnu.so,sha256=8nCk6r3A9PISVMLdzHTiatYt3dqNDeFkQ-sfemWmvYM,402824 -h3/_cy/edges.pxd,sha256=_zUOkV8aeWhk_xjicSWBDHNOp3vMEeg8o2Da06iYn38,561 -h3/_cy/edges.pyx,sha256=1ECoK-OP3_BplwLZqwqNwItMLNIja6kVMzMeo7maHz8,2487 -h3/_cy/error_system.cpython-312-aarch64-linux-gnu.so,sha256=R4fc8to7fKrP7QBXX5KB7SXQzasH_vo81f7U6bGs1mk,202360 -h3/_cy/error_system.pxd,sha256=Dd2LjHcmlkCcs5Tr_HSp7xcn8YsQq2Evk4HxtIZF9m4,109 -h3/_cy/error_system.pyx,sha256=gyg7NPuY2nfsj2QnJC11OTZUCXLvNybpcgNC25Jor7E,6908 -h3/_cy/h3api.h,sha256=lQHNByNGZG6AkVjpIB2OZEv7fnAbBfCGqe4oqx0Hgd0,26418 -h3/_cy/h3lib.pxd,sha256=d37c0MiHuWQL28ogaxiLjKq1P4lh_gdIPRZrjizHi2g,6955 -h3/_cy/latlng.cpython-312-aarch64-linux-gnu.so,sha256=Nr-18UTddm3XyqtmVqrxgbWPbihilri0Od-gE2FRr1Q,471768 -h3/_cy/latlng.pxd,sha256=WjOjY4jH_2lK6hnaVXCusqLg2DvvZ4rvAJyXeCQd2uk,266 -h3/_cy/latlng.pyx,sha256=FW8L4LEr6l7qhsRL28mFakVLHnfqSCKQDQ6Ued-nLks,8370 -h3/_cy/memory.cpython-312-aarch64-linux-gnu.so,sha256=FXPAzIgzILQh4LxXlOchgkLY6_kpFWmzb3zsIFFL9lg,336208 -h3/_cy/memory.pxd,sha256=jXGN68hdcPUyA_yFCesZxCksHwmHMO4Ah-I9ZwYBvXs,236 -h3/_cy/memory.pyx,sha256=KZo65H3rXn290iH05ZNkyt78mKEGIaVjzmgYdOon_PU,7103 -h3/_cy/to_multipoly.cpython-312-aarch64-linux-gnu.so,sha256=4r6p7uq0B_Ln85xK_P9HvC59LtTR-ZAXGYXMG8CUwBk,402440 -h3/_cy/to_multipoly.pyx,sha256=bpaP3rGl5mtWTp1aH0ksL-gMi_tobSxjnZvxX6B2R4o,1369 -h3/_cy/util.cpython-312-aarch64-linux-gnu.so,sha256=zIQQ7i19XEZiT4I6hMg3RdnXxb0ZDjRCU1ohQ9pwoxY,267856 -h3/_cy/util.pxd,sha256=9JeCVVOOxfd3QoK4q_W-yIhmEASq_X2Y-A_Crn2bvZg,346 -h3/_cy/util.pyx,sha256=9woUsIwPG18UmjDbw8QFNnIXT62HMOUKGUmGIKt_ONo,2348 -h3/_cy/vertex.cpython-312-aarch64-linux-gnu.so,sha256=5-tDMKX5uWCv-2W3gVPhAwFbcB8f5q092KLuUa5oChA,337024 -h3/_cy/vertex.pxd,sha256=lnRECjEFpohFr7iB6d2UrTN-s37UzXnSpaP_UV5866I,229 -h3/_cy/vertex.pyx,sha256=_26ur2q3CZzb0BGQ85Lvbjq9dRWscvjAsKlgmCAqVHc,910 -h3/api/__init__.py,sha256=X6P438-1N_2jWlFKNZ8q_jUop7ICRhwwa4I0RuxtQIQ,114 -h3/api/basic_int/__init__.py,sha256=pg0QGCIGIyT0WTnD2vDqP-LyW0m5E1qd9F19l6wf3Rs,25924 -h3/api/basic_int/_convert.py,sha256=GmVFFTT-mMHJ_Newx-6aF8TAtKBTrXglMx5RNV9w0Nk,187 -h3/api/basic_str/__init__.py,sha256=pg0QGCIGIyT0WTnD2vDqP-LyW0m5E1qd9F19l6wf3Rs,25924 -h3/api/basic_str/_convert.py,sha256=9B7uHdbUJhDb0GUEdSg-dUQpNCmvPviK6_DX99YS5UE,256 -h3/api/memview_int/__init__.py,sha256=pg0QGCIGIyT0WTnD2vDqP-LyW0m5E1qd9F19l6wf3Rs,25924 -h3/api/memview_int/_convert.py,sha256=ef5Omw0GJsUlR8r66O1p8f9IEEhCeTdDjlvN2A0urjA,105 -h3/api/numpy_int/__init__.py,sha256=pg0QGCIGIyT0WTnD2vDqP-LyW0m5E1qd9F19l6wf3Rs,25924 -h3/api/numpy_int/_convert.py,sha256=dhZLocPjucl6Uu872k1tAcuWXBRT29oUG8qFMoleulE,288 -include/h3/h3api.h,sha256=lQHNByNGZG6AkVjpIB2OZEv7fnAbBfCGqe4oqx0Hgd0,26418 -lib64/libh3.a,sha256=daDl9sRycc5tHGPbiHyd-IYfmyaXFQKnB-xES26wv4Q,170004 -lib64/cmake/h3/h3Config.cmake,sha256=QwISc49jy-ZH9Ba1YCQnick54sapi_pZDEJjDJyMrb4,959 -lib64/cmake/h3/h3ConfigVersion.cmake,sha256=Nf3JY8h9E9o1YHZ9TuUc_XN5CyS3yxa4pp5PTIEViKM,2762 -lib64/cmake/h3/h3Targets-release.cmake,sha256=pnJffyu5LDg0GeSMTTwBoVLamlDKo8XrjrCEyN7aP0w,797 -lib64/cmake/h3/h3Targets.cmake,sha256=K18pICoM546T1tLsCSvdLlnLf1-GyFYPqMq8G0mZobM,4217 -h3-4.3.1.dist-info/METADATA,sha256=XJDmH460i2LSmjPAibQR_6XHyedrvDe_0tXZM3v-7n0,18459 -h3-4.3.1.dist-info/WHEEL,sha256=uOikQdbS4EYP0OE7pa4p-weSIqjfixseckdKxHaHlvE,198 -h3-4.3.1.dist-info/RECORD,, -h3-4.3.1.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358 diff --git a/frogpilot/third_party/h3-4.3.1.dist-info/WHEEL b/frogpilot/third_party/h3-4.3.1.dist-info/WHEEL deleted file mode 100644 index e433f053..00000000 --- a/frogpilot/third_party/h3-4.3.1.dist-info/WHEEL +++ /dev/null @@ -1,7 +0,0 @@ -Wheel-Version: 1.0 -Generator: scikit-build-core 0.11.5 -Root-Is-Purelib: false -Tag: cp312-cp312-manylinux_2_17_aarch64 -Tag: cp312-cp312-manylinux2014_aarch64 -Tag: cp312-cp312-manylinux_2_28_aarch64 - diff --git a/frogpilot/third_party/h3-4.3.1.dist-info/licenses/LICENSE b/frogpilot/third_party/h3-4.3.1.dist-info/licenses/LICENSE deleted file mode 100644 index d6456956..00000000 --- a/frogpilot/third_party/h3-4.3.1.dist-info/licenses/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/frogpilot/third_party/h3/CMakeLists.txt b/frogpilot/third_party/h3/CMakeLists.txt deleted file mode 100644 index 9d48e667..00000000 --- a/frogpilot/third_party/h3/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(_cy) diff --git a/frogpilot/third_party/h3/__init__.py b/frogpilot/third_party/h3/__init__.py index 4f7cb32f..1e4f4b8d 100644 --- a/frogpilot/third_party/h3/__init__.py +++ b/frogpilot/third_party/h3/__init__.py @@ -26,4 +26,8 @@ from ._cy import ( H3MemoryAllocError, H3MemoryBoundsError, H3OptionInvalidError, + H3IndexInvalidError, + H3BaseCellDomainError, + H3DigitDomainError, + H3DeletedDigitError, ) diff --git a/frogpilot/third_party/h3/_cy/CMakeLists.txt b/frogpilot/third_party/h3/_cy/CMakeLists.txt deleted file mode 100644 index 2cb2b6f3..00000000 --- a/frogpilot/third_party/h3/_cy/CMakeLists.txt +++ /dev/null @@ -1,53 +0,0 @@ -list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) - -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) - -macro(add_cython_file filename) - add_custom_command( - OUTPUT "${filename}.c" - COMMENT - "Making ${CMAKE_CURRENT_BINARY_DIR}/${filename}.c from ${CMAKE_CURRENT_SOURCE_DIR}/${filename}.pyx" - COMMAND Python::Interpreter -m cython - "${CMAKE_CURRENT_SOURCE_DIR}/${filename}.pyx" --output-file "${filename}.c" -I ${CMAKE_CURRENT_SOURCE_DIR} - DEPENDS "${filename}.pyx" - VERBATIM) - - python_add_library(${filename} MODULE "${filename}.c" WITH_SOABI) - - set_property(TARGET ${filename} PROPERTY C_STANDARD 99) - target_link_libraries(${filename} PRIVATE h3) - install(TARGETS ${filename} LIBRARY DESTINATION ${SKBUILD_PROJECT_NAME}/_cy) -endmacro() - -# GLOB pattern is recommended against -# https://cmake.org/cmake/help/v3.14/command/file.html?highlight=file#filesystem -add_cython_file(cells) -add_cython_file(edges) -add_cython_file(error_system) -add_cython_file(latlng) -add_cython_file(memory) -add_cython_file(vertex) - -add_cython_file(to_multipoly) -add_cython_file(util) - -# Include pyx and pxd files in distribution for use by Cython API -install( - FILES - cells.pxd - cells.pyx - edges.pxd - edges.pyx - error_system.pyx - h3lib.pxd - latlng.pxd - latlng.pyx - memory.pxd - memory.pyx - util.pxd - util.pyx - vertex.pxd - vertex.pyx - DESTINATION - ${SKBUILD_PROJECT_NAME}/_cy -) diff --git a/frogpilot/third_party/h3/_cy/__init__.py b/frogpilot/third_party/h3/_cy/__init__.py index 627f3b97..70fa087c 100644 --- a/frogpilot/third_party/h3/_cy/__init__.py +++ b/frogpilot/third_party/h3/_cy/__init__.py @@ -14,10 +14,13 @@ function interface and input conversion (string to int, for instance). """ from .cells import ( + is_valid_index, is_valid_cell, is_pentagon, get_base_cell_number, get_resolution, + get_index_digit, + construct_cell, cell_to_parent, grid_distance, grid_disk, @@ -109,4 +112,11 @@ from .error_system import ( H3MemoryAllocError, H3MemoryBoundsError, H3OptionInvalidError, + H3IndexInvalidError, + H3BaseCellDomainError, + H3DigitDomainError, + H3DeletedDigitError, + + get_H3_ERROR_END, + error_code_to_exception, ) diff --git a/frogpilot/third_party/h3/_cy/cells.cpython-312-aarch64-linux-gnu.so b/frogpilot/third_party/h3/_cy/cells.cpython-312-aarch64-linux-gnu.so index b0207a5c..b039cde6 100644 Binary files a/frogpilot/third_party/h3/_cy/cells.cpython-312-aarch64-linux-gnu.so and b/frogpilot/third_party/h3/_cy/cells.cpython-312-aarch64-linux-gnu.so differ diff --git a/frogpilot/third_party/h3/_cy/cells.pxd b/frogpilot/third_party/h3/_cy/cells.pxd deleted file mode 100644 index 06b35ee6..00000000 --- a/frogpilot/third_party/h3/_cy/cells.pxd +++ /dev/null @@ -1,27 +0,0 @@ -from .h3lib cimport bool, int64_t, H3int - -cpdef bool is_valid_cell(H3int h) -cpdef bool is_pentagon(H3int h) -cpdef int get_base_cell_number(H3int h) except -1 -cpdef int get_resolution(H3int h) except -1 -cpdef int grid_distance(H3int h1, H3int h2) except -1 -cpdef H3int[:] grid_disk(H3int h, int k) -cpdef H3int[:] grid_ring(H3int h, int k) -cpdef H3int cell_to_parent(H3int h, res=*) except 0 -cpdef int64_t cell_to_children_size(H3int h, res=*) except -1 -cpdef H3int[:] cell_to_children(H3int h, res=*) -cpdef H3int cell_to_center_child(H3int h, res=*) except 0 -cpdef int64_t cell_to_child_pos(H3int child, int parent_res) except -1 -cpdef H3int child_pos_to_cell(H3int parent, int child_res, int64_t child_pos) except 0 -cpdef H3int[:] compact_cells(const H3int[:] hu) -cpdef H3int[:] uncompact_cells(const H3int[:] hc, int res) -cpdef int64_t get_num_cells(int resolution) except -1 -cpdef double average_hexagon_area(int resolution, unit=*) except -1 -cpdef double cell_area(H3int h, unit=*) except -1 -cpdef H3int[:] grid_path_cells(H3int start, H3int end) -cpdef bool is_res_class_iii(H3int h) -cpdef H3int[:] get_pentagons(int res) -cpdef H3int[:] get_res0_cells() -cpdef get_icosahedron_faces(H3int h) -cpdef (int, int) cell_to_local_ij(H3int origin, H3int h) except * -cpdef H3int local_ij_to_cell(H3int origin, int i, int j) except 0 diff --git a/frogpilot/third_party/h3/_cy/cells.pyx b/frogpilot/third_party/h3/_cy/cells.pyx deleted file mode 100644 index 928b665c..00000000 --- a/frogpilot/third_party/h3/_cy/cells.pyx +++ /dev/null @@ -1,419 +0,0 @@ -cimport h3lib -from .h3lib cimport bool, int64_t, H3int, H3ErrorCodes - -from .util cimport ( - check_cell, - check_res, # we don't use? - check_distance, -) - -from .error_system cimport ( - check_for_error, - check_for_error_msg, -) - -from .memory cimport ( - H3MemoryManager, - int_mv, -) - -# todo: add notes about Cython exception handling - - -# bool is a python type, so we don't need the except clause -cpdef bool is_valid_cell(H3int h): - """Validates an H3 cell (hexagon or pentagon) - - Returns - ------- - boolean - """ - return h3lib.isValidCell(h) == 1 - - -cpdef bool is_pentagon(H3int h): - return h3lib.isPentagon(h) == 1 - - -cpdef int get_base_cell_number(H3int h) except -1: - check_cell(h) - - return h3lib.getBaseCellNumber(h) - - -cpdef int get_resolution(H3int h) except -1: - """Returns the resolution of an H3 Index - 0--15 - """ - check_cell(h) - - return h3lib.getResolution(h) - - -cpdef int grid_distance(H3int h1, H3int h2) except -1: - """ Compute the grid distance between two cells - """ - cdef: - int64_t distance - - check_cell(h1) - check_cell(h2) - - check_for_error( - h3lib.gridDistance(h1, h2, &distance) - ) - - return distance - -cpdef H3int[:] grid_disk(H3int h, int k): - """ Return cells at grid distance `<= k` from `h`. - """ - cdef: - int64_t n - - check_cell(h) - check_distance(k) - - check_for_error( - h3lib.maxGridDiskSize(k, &n) - ) - - hmm = H3MemoryManager(n) - check_for_error( - h3lib.gridDisk(h, k, hmm.ptr) - ) - mv = hmm.to_mv() - - return mv - - -cpdef H3int[:] grid_ring(H3int h, int k): - """ Return cells at grid distance `== k` from `h`. - Collection is "hollow" for k >= 1. - """ - check_cell(h) - check_distance(k) - - n = 6*k if k > 0 else 1 - hmm = H3MemoryManager(n) - check_for_error( - h3lib.gridRing(h, k, hmm.ptr) - ) - mv = hmm.to_mv() - - return mv - - -cpdef H3int cell_to_parent(H3int h, res=None) except 0: - cdef: - H3int parent - - check_cell(h) - if res is None: - res = get_resolution(h) - 1 - - err = h3lib.cellToParent(h, res, &parent) - if err: - msg = 'Invalid parent resolution {} for cell {}.' - msg = msg.format(res, hex(h)) - check_for_error_msg(err, msg) - - return parent - - -cpdef int64_t cell_to_children_size(H3int h, res=None) except -1: - cdef: - int64_t n - - check_cell(h) - if res is None: - res = get_resolution(h) + 1 - - err = h3lib.cellToChildrenSize(h, res, &n) - if err: - msg = 'Invalid child resolution {} for cell {}.' - msg = msg.format(res, hex(h)) - check_for_error_msg(err, msg) - - return n - - -cpdef H3int[:] cell_to_children(H3int h, res=None): - check_cell(h) - if res is None: - res = get_resolution(h) + 1 - - n = cell_to_children_size(h, res) - - hmm = H3MemoryManager(n) - check_for_error( - h3lib.cellToChildren(h, res, hmm.ptr) - ) - mv = hmm.to_mv() - - return mv - - - -cpdef H3int cell_to_center_child(H3int h, res=None) except 0: - cdef: - H3int child - - check_cell(h) - if res is None: - res = get_resolution(h) + 1 - - err = h3lib.cellToCenterChild(h, res, &child) - if err: - msg = 'Invalid child resolution {} for cell {}.' - msg = msg.format(res, hex(h)) - check_for_error_msg(err, msg) - - return child - - -cpdef int64_t cell_to_child_pos(H3int child, int parent_res) except -1: - cdef: - int64_t child_pos - - check_cell(child) - err = h3lib.cellToChildPos(child, parent_res, &child_pos) - if err: - msg = "Couldn't find child pos of cell {} at res {}." - msg = msg.format(hex(child), parent_res) - check_for_error_msg(err, msg) - - return child_pos - - -cpdef H3int child_pos_to_cell(H3int parent, int child_res, int64_t child_pos) except 0: - cdef: - H3int child - - check_cell(parent) - err = h3lib.childPosToCell(child_pos, parent, child_res, &child) - if err: - msg = "Couldn't find child with pos {} at res {} from parent {}." - msg = msg.format(child_pos, child_res, hex(parent)) - check_for_error_msg(err, msg) - - return child - - -cpdef H3int[:] compact_cells(const H3int[:] hu): - # todo: fix this with my own Cython object "wrapper" class? - # everything has a .ptr interface? - # todo: the Clib can handle 0-len arrays because it **avoids** - # dereferencing the pointer, but Cython's syntax of - # `&hu[0]` **requires** a dereference. For Cython, checking for array - # length of zero and returning early seems like the easiest solution. - # note: open to better ideas! - - if len(hu) == 0: - return H3MemoryManager(0).to_mv() - - for h in hu: ## todo: should we have an array version? would that be faster? - check_cell(h) - - cdef size_t n = len(hu) - hmm = H3MemoryManager(n) - check_for_error( - h3lib.compactCells(&hu[0], hmm.ptr, n) - ) - mv = hmm.to_mv() - - return mv - - -# todo: https://stackoverflow.com/questions/50684977/cython-exception-type-for-a-function-returning-a-typed-memoryview -# apparently, memoryviews are python objects, so we don't need to do the except clause -cpdef H3int[:] uncompact_cells(const H3int[:] hc, int res): - # todo: the Clib can handle 0-len arrays because it **avoids** - # dereferencing the pointer, but Cython's syntax of - # `&hc[0]` **requires** a dereference. For Cython, checking for array - # length of zero and returning early seems like the easiest solution. - # note: open to better ideas! - cdef: - int64_t n - - - if len(hc) == 0: - return H3MemoryManager(0).to_mv() - - for h in hc: - check_cell(h) - - check_for_error( - h3lib.uncompactCellsSize(&hc[0], len(hc), res, &n) - ) - - hmm = H3MemoryManager(n) - check_for_error( - h3lib.uncompactCells( - &hc[0], # todo: symmetry here with the wrapper object might be nice. hc.ptr / hc.n - len(hc), - hmm.ptr, - hmm.n, - res - ) - ) - - mv = hmm.to_mv() - - return mv - - -cpdef int64_t get_num_cells(int resolution) except -1: - cdef: - int64_t num_cells - - check_for_error( - h3lib.getNumCells(resolution, &num_cells) - ) - - return num_cells - - -cpdef double average_hexagon_area(int resolution, unit='km^2') except -1: - cdef: - double area - - check_for_error( - h3lib.getHexagonAreaAvgKm2(resolution, &area) - ) - - # todo: multiple units - convert = { - 'km^2': 1.0, - 'm^2': 1000*1000.0 - } - - try: - area *= convert[unit] - except: - raise ValueError('Unknown unit: {}'.format(unit)) - - return area - - -cpdef double cell_area(H3int h, unit='km^2') except -1: - cdef: - double area - - if unit == 'rads^2': - err = h3lib.cellAreaRads2(h, &area) - elif unit == 'km^2': - err = h3lib.cellAreaKm2(h, &area) - elif unit == 'm^2': - err = h3lib.cellAreaM2(h, &area) - else: - raise ValueError('Unknown unit: {}'.format(unit)) - - check_for_error(err) - - return area - - -cdef _could_not_find_line(err, start, end): - msg = "Couldn't find line between cells {} and {}" - msg = msg.format(hex(start), hex(end)) - - check_for_error_msg(err, msg) - -cpdef H3int[:] grid_path_cells(H3int start, H3int end): - cdef: - int64_t n - - # todo: can we segfault here with invalid inputs? - # Can we trust the c library to validate the start/end cells? - # probably applies to all size/work pairs of functions... - err = h3lib.gridPathCellsSize(start, end, &n) - - _could_not_find_line(err, start, end) - - hmm = H3MemoryManager(n) - err = h3lib.gridPathCells(start, end, hmm.ptr) - - _could_not_find_line(err, start, end) - - # todo: probably here too? - mv = hmm.to_mv() - - return mv - -cpdef bool is_res_class_iii(H3int h): - return h3lib.isResClassIII(h) == 1 - - -cpdef H3int[:] get_pentagons(int res): - n = h3lib.pentagonCount() - - hmm = H3MemoryManager(n) - check_for_error( - h3lib.getPentagons(res, hmm.ptr) - ) - mv = hmm.to_mv() - - return mv - - -cpdef H3int[:] get_res0_cells(): - n = h3lib.res0CellCount() - - hmm = H3MemoryManager(n) - check_for_error( - h3lib.getRes0Cells(hmm.ptr) - ) - mv = hmm.to_mv() - - return mv - -# oh, this is returning a set?? -# todo: convert to int[:]? -cpdef get_icosahedron_faces(H3int h): - cdef: - int n - int[:] faces ## todo: weird, this needs to be specified to avoid errors. cython bug? - - check_for_error( - h3lib.maxFaceCount(h, &n) - ) - - faces = int_mv(n) - check_for_error( - h3lib.getIcosahedronFaces(h, &faces[0]) - ) - - # todo: wait? do faces start from 0 or 1? - # we could do this check/processing in the int_mv object - out = [f for f in faces if f >= 0] - - return out - - -cpdef (int, int) cell_to_local_ij(H3int origin, H3int h) except *: - cdef: - h3lib.CoordIJ c - - err = h3lib.cellToLocalIj(origin, h, 0, &c) - if err: - msg = "Couldn't find local (i,j) between cells {} and {}." - msg = msg.format(hex(origin), hex(h)) - check_for_error_msg(err, msg) - - return c.i, c.j - -cpdef H3int local_ij_to_cell(H3int origin, int i, int j) except 0: - cdef: - h3lib.CoordIJ c - H3int out - - c.i, c.j = i, j - - err = h3lib.localIjToCell(origin, &c, 0, &out) - if err: - msg = "Couldn't find cell at local ({},{}) from cell {}." - msg = msg.format(i, j, hex(origin)) - check_for_error_msg(err, msg) - - return out diff --git a/frogpilot/third_party/h3/_cy/edges.cpython-312-aarch64-linux-gnu.so b/frogpilot/third_party/h3/_cy/edges.cpython-312-aarch64-linux-gnu.so index 0865612e..9c4c4ff6 100644 Binary files a/frogpilot/third_party/h3/_cy/edges.cpython-312-aarch64-linux-gnu.so and b/frogpilot/third_party/h3/_cy/edges.cpython-312-aarch64-linux-gnu.so differ diff --git a/frogpilot/third_party/h3/_cy/edges.pxd b/frogpilot/third_party/h3/_cy/edges.pxd deleted file mode 100644 index b7fcf849..00000000 --- a/frogpilot/third_party/h3/_cy/edges.pxd +++ /dev/null @@ -1,11 +0,0 @@ -from .h3lib cimport bool, H3int - -cpdef bool are_neighbor_cells(H3int h1, H3int h2) -cpdef H3int cells_to_directed_edge(H3int origin, H3int destination) except * -cpdef bool is_valid_directed_edge(H3int e) -cpdef H3int get_directed_edge_origin(H3int e) except 1 -cpdef H3int get_directed_edge_destination(H3int e) except 1 -cpdef (H3int, H3int) directed_edge_to_cells(H3int e) except * -cpdef H3int[:] origin_to_directed_edges(H3int origin) -cpdef double average_hexagon_edge_length(int resolution, unit=*) except -1 -cpdef double edge_length(H3int e, unit=*) except -1 diff --git a/frogpilot/third_party/h3/_cy/edges.pyx b/frogpilot/third_party/h3/_cy/edges.pyx deleted file mode 100644 index bd0aa7c0..00000000 --- a/frogpilot/third_party/h3/_cy/edges.pyx +++ /dev/null @@ -1,114 +0,0 @@ -cimport h3lib -from .h3lib cimport bool, H3int - -from .error_system cimport check_for_error - -from .memory cimport H3MemoryManager - -# todo: make bint -cpdef bool are_neighbor_cells(H3int h1, H3int h2): - cdef: - int out - - err = h3lib.areNeighborCells(h1, h2, &out) - - # note: we are intentionally not raising an error here, and just - # returning false. - # todo: is this choice consistent across the Python and C libs? - if err: - return False - - return out == 1 - - -cpdef H3int cells_to_directed_edge(H3int origin, H3int destination) except *: - cdef: - int neighbor_out - H3int out - - check_for_error( - h3lib.cellsToDirectedEdge(origin, destination, &out) - ) - - return out - - -cpdef bool is_valid_directed_edge(H3int e): - return h3lib.isValidDirectedEdge(e) == 1 - -cpdef H3int get_directed_edge_origin(H3int e) except 1: - cdef: - H3int out - - check_for_error( - h3lib.getDirectedEdgeOrigin(e, &out) - ) - - return out - -cpdef H3int get_directed_edge_destination(H3int e) except 1: - cdef: - H3int out - - check_for_error( - h3lib.getDirectedEdgeDestination(e, &out) - ) - - return out - -cpdef (H3int, H3int) directed_edge_to_cells(H3int e) except *: - # todo: use directed_edge_to_cells in h3lib - return get_directed_edge_origin(e), get_directed_edge_destination(e) - -cpdef H3int[:] origin_to_directed_edges(H3int origin): - """ Returns the 6 (or 5 for pentagons) directed edges - for the given origin cell - """ - - hmm = H3MemoryManager(6) - check_for_error( - h3lib.originToDirectedEdges(origin, hmm.ptr) - ) - mv = hmm.to_mv() - - return mv - - -cpdef double average_hexagon_edge_length(int resolution, unit='km') except -1: - cdef: - double length - - check_for_error( - h3lib.getHexagonEdgeLengthAvgKm(resolution, &length) - ) - - # todo: multiple units - convert = { - 'km': 1.0, - 'm': 1000.0 - } - - try: - length *= convert[unit] - except: - raise ValueError('Unknown unit: {}'.format(unit)) - - return length - - -cpdef double edge_length(H3int e, unit='km') except -1: - cdef: - double length - - if unit == 'rads': - err = h3lib.edgeLengthRads(e, &length) - elif unit == 'km': - err = h3lib.edgeLengthKm(e, &length) - elif unit == 'm': - err = h3lib.edgeLengthM(e, &length) - else: - raise ValueError('Unknown unit: {}'.format(unit)) - - check_for_error(err) - - return length diff --git a/frogpilot/third_party/h3/_cy/error_system.cpython-312-aarch64-linux-gnu.so b/frogpilot/third_party/h3/_cy/error_system.cpython-312-aarch64-linux-gnu.so index 9d73f453..3fb7834b 100644 Binary files a/frogpilot/third_party/h3/_cy/error_system.cpython-312-aarch64-linux-gnu.so and b/frogpilot/third_party/h3/_cy/error_system.cpython-312-aarch64-linux-gnu.so differ diff --git a/frogpilot/third_party/h3/_cy/error_system.pxd b/frogpilot/third_party/h3/_cy/error_system.pxd deleted file mode 100644 index af8c709b..00000000 --- a/frogpilot/third_party/h3/_cy/error_system.pxd +++ /dev/null @@ -1,3 +0,0 @@ -from .h3lib cimport H3Error -cdef check_for_error(H3Error err) -cdef check_for_error_msg(H3Error err, str msg) diff --git a/frogpilot/third_party/h3/_cy/error_system.pyx b/frogpilot/third_party/h3/_cy/error_system.pyx deleted file mode 100644 index fbdd9185..00000000 --- a/frogpilot/third_party/h3/_cy/error_system.pyx +++ /dev/null @@ -1,231 +0,0 @@ -""" -Exceptions from the h3-py library have three possible sources: - -- the Python code -- the Cython code -- the underlying H3 C library code - -The Python and Cython `h3-py` code will only raise standard Python -built-in exceptions; **no custom** exception classes will be used. - -Conversely, many functions in the H3 C library return a `uint32_t` -error code (aliased as type `H3Error`). -When these errors happen (and `h3-py` can't recover from them internally), -they are passed up to the Python/Cython code, where their -`uint32_t` error values are converted to **custom** Python exception types. -These custom exception classes all inherit from `H3BaseException`. - -There is a 1-1 correspondence between the concrete subclasses of -`H3BaseException` and the H3 C library `H3ErrorCodes` values. -The correspondence is intentional, so that the user can refer to the -H3 C library documentation on these errors. - -The (`uint32_t` <-> Exception) correspondence should be clear from -the names of each error/exception, but the explicit mapping is given by -a dictionary in the code below. - -Note that some "abstract" subclasses of `H3BaseException` are also included to -group the exceptions by type. (We say "abstract" because Python has no easy -way to make true abstract exception classes.) - -These "abstract" exceptions will never be raised directly by `h3-py`, but they -allow the user to catch general groups of errors. -Note that `h3-py` will only ever directly raise -the "concrete" exception classes. - -Summarizing, all exceptions originating from the C library inherit from -`H3BaseException`, which has both "abstract" and "concrete" subclasses. - -**Abstract classes**: - -- H3BaseException -- H3ValueError -- H3MemoryError -- H3GridNavigationError - -**Concrete classes**: - -- H3FailedError -- H3DomainError -- H3LatLngDomainError -- H3ResDomainError -- H3CellInvalidError -- H3DirEdgeInvalidError -- H3UndirEdgeInvalidError -- H3VertexInvalidError -- H3PentagonError -- H3DuplicateInputError -- H3NotNeighborsError -- H3ResMismatchError -- H3MemoryAllocError -- H3MemoryBoundsError -- H3OptionInvalidError - - -# TODO: add tests verifying that concrete exception classes have the right error codes associated with them -""" - -from contextlib import contextmanager - -from .h3lib cimport ( - H3Error, - - # H3ErrorCodes enum values - E_SUCCESS, - E_FAILED, - E_DOMAIN, - E_LATLNG_DOMAIN, - E_RES_DOMAIN, - E_CELL_INVALID, - E_DIR_EDGE_INVALID, - E_UNDIR_EDGE_INVALID, - E_VERTEX_INVALID, - E_PENTAGON, - E_DUPLICATE_INPUT, - E_NOT_NEIGHBORS, - E_RES_MISMATCH, - E_MEMORY_ALLOC, - E_MEMORY_BOUNDS, - E_OPTION_INVALID, -) - -@contextmanager -def _the_error(obj): - """ - Syntactic maple syrup for grouping exception definitions. - The associated `with` statement ends up as a not-half-bad - approximation to a valid sentence fragment. - - This provides sort of a "pretend scope", in that it allows for - block indentation which helps to visually indicate the "scope" - of the `... as e` statement. Just note that Python doesn't treat the - `with` block as a "true" separate scope. - - Note that this doesn't actually do anything context-manager-y, outside - of the variable assignment and block indentation. - """ - yield obj - - -# -# Base exception for C library error codes -# -class H3BaseException(Exception): - """ Base H3 exception class. - - Concrete subclasses of this class correspond to specific - error codes from the C library. - - Base/abstract subclasses will have `h3_error_code = None`, while - concrete subclasses will have `h3_error_code` equal to their associated - C library error code. - """ - h3_error_code = None - - -# -# A few "abstract" exceptions; organizational. -# -with _the_error(H3BaseException) as e: - class H3ValueError(e, ValueError): ... - class H3MemoryError(e, MemoryError): ... - class H3GridNavigationError(e, RuntimeError): ... - - -# -# Concrete exceptions -# -class UnknownH3ErrorCode(H3BaseException): - """ - Indicates that the h3-py Python bindings have received an - unrecognized error code from the C library. - - This should never happen. Please report if you get this error. - - Note that this exception is *outside* of the - H3BaseException class hierarchy. - """ - pass - -with _the_error(H3BaseException) as e: - class H3FailedError(e): ... - -with _the_error(H3GridNavigationError) as e: - class H3PentagonError(e): ... - -with _the_error(H3MemoryError) as e: - class H3MemoryAllocError(e): ... - class H3MemoryBoundsError(e): ... - -with _the_error(H3ValueError) as e: - class H3DomainError(e): ... - class H3LatLngDomainError(e): ... - class H3ResDomainError(e): ... - class H3CellInvalidError(e): ... - class H3DirEdgeInvalidError(e): ... - class H3UndirEdgeInvalidError(e): ... - class H3VertexInvalidError(e): ... - class H3DuplicateInputError(e): ... - class H3NotNeighborsError(e): ... - class H3ResMismatchError(e): ... - class H3OptionInvalidError(e): ... - - -""" -This defines a mapping between uint32_t error codes and concrete Python -exception classes. -Note that we intentionally omit E_SUCCESS, as it isn't an actual error. -""" -error_mapping = { - E_FAILED: H3FailedError, - E_DOMAIN: H3DomainError, - E_LATLNG_DOMAIN: H3LatLngDomainError, - E_RES_DOMAIN: H3ResDomainError, - E_CELL_INVALID: H3CellInvalidError, - E_DIR_EDGE_INVALID: H3DirEdgeInvalidError, - E_UNDIR_EDGE_INVALID: H3UndirEdgeInvalidError, - E_VERTEX_INVALID: H3VertexInvalidError, - E_PENTAGON: H3PentagonError, - E_DUPLICATE_INPUT: H3DuplicateInputError, - E_NOT_NEIGHBORS: H3NotNeighborsError, - E_RES_MISMATCH: H3ResMismatchError, - E_MEMORY_ALLOC: H3MemoryAllocError, - E_MEMORY_BOUNDS: H3MemoryBoundsError, - E_OPTION_INVALID: H3OptionInvalidError, -} - -# Go back and modify the class definitions so that each concrete exception -# stores its associated error code. -for code, ex in error_mapping.items(): - ex.h3_error_code = code - - -# -# Helper functions -# - -# TODO: Move the helpers to util? -# TODO: Unclear how/where to expose these functions. cdef/cpdef? - -cdef code_to_exception(H3Error err): - if err == E_SUCCESS: - return None - elif err in error_mapping: - return error_mapping[err] - else: - raise UnknownH3ErrorCode(err) - -cdef check_for_error(H3Error err): - ex = code_to_exception(err) - if ex: - raise ex - -# todo: There's no easy way to do `*args` in `cdef` functions, but I'm also -# not sure this even needs to be a Cython `cdef` function at all, or that -# any of the other helper functions need to be in Cython. -# todo: Revisit after we've played with this a bit. -# todo: also: maybe the extra messages aren't that much more helpful... -cdef check_for_error_msg(H3Error err, str msg): - ex = code_to_exception(err) - if ex: - raise ex(msg) diff --git a/frogpilot/third_party/h3/_cy/h3api.h b/frogpilot/third_party/h3/_cy/h3api.h deleted file mode 100644 index 719b252e..00000000 --- a/frogpilot/third_party/h3/_cy/h3api.h +++ /dev/null @@ -1,809 +0,0 @@ -/* - * Copyright 2016-2021 Uber Technologies, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** @file h3api.h - * @brief Primary H3 core library entry points. - * - * This file defines the public API of the H3 library. Incompatible changes to - * these functions require the library's major version be increased. - */ - -#ifndef H3API_H -#define H3API_H - -/* - * Preprocessor code to support renaming (prefixing) the public API. - * All public functions should be wrapped in H3_EXPORT so they can be - * renamed. - */ -#ifdef H3_PREFIX -#define XTJOIN(a, b) a##b -#define TJOIN(a, b) XTJOIN(a, b) - -/* export joins the user provided prefix with our exported function name */ -#define H3_EXPORT(name) TJOIN(H3_PREFIX, name) -#else -#define H3_EXPORT(name) name -#endif - -/* Windows DLL requires attributes indicating what to export */ -#if _WIN32 && BUILD_SHARED_LIBS -#if BUILDING_H3 -#define DECLSPEC __declspec(dllexport) -#else -#define DECLSPEC __declspec(dllimport) -#endif -#else -#define DECLSPEC -#endif - -/* For uint64_t */ -#include -/* For size_t */ -#include - -/* - * H3 is compiled as C, not C++ code. `extern "C"` is needed for C++ code - * to be able to use the library. - */ -#ifdef __cplusplus -extern "C" { -#endif - -/** @brief Identifier for an object (cell, edge, etc) in the H3 system. - * - * The H3Index fits within a 64-bit unsigned integer. - */ -typedef uint64_t H3Index; - -/** - * Invalid index used to indicate an error from latLngToCell and related - * functions or missing data in arrays of H3 indices. Analogous to NaN in - * floating point. - */ -#define H3_NULL 0 - -/** @brief Result code (success or specific error) from an H3 operation */ -typedef uint32_t H3Error; - -typedef enum { - E_SUCCESS = 0, // Success (no error) - E_FAILED = - 1, // The operation failed but a more specific error is not available - E_DOMAIN = 2, // Argument was outside of acceptable range (when a more - // specific error code is not available) - E_LATLNG_DOMAIN = - 3, // Latitude or longitude arguments were outside of acceptable range - E_RES_DOMAIN = 4, // Resolution argument was outside of acceptable range - E_CELL_INVALID = 5, // `H3Index` cell argument was not valid - E_DIR_EDGE_INVALID = 6, // `H3Index` directed edge argument was not valid - E_UNDIR_EDGE_INVALID = - 7, // `H3Index` undirected edge argument was not valid - E_VERTEX_INVALID = 8, // `H3Index` vertex argument was not valid - E_PENTAGON = 9, // Pentagon distortion was encountered which the algorithm - // could not handle it - E_DUPLICATE_INPUT = 10, // Duplicate input was encountered in the arguments - // and the algorithm could not handle it - E_NOT_NEIGHBORS = 11, // `H3Index` cell arguments were not neighbors - E_RES_MISMATCH = - 12, // `H3Index` cell arguments had incompatible resolutions - E_MEMORY_ALLOC = 13, // Necessary memory allocation failed - E_MEMORY_BOUNDS = 14, // Bounds of provided memory were not large enough - E_OPTION_INVALID = 15 // Mode or flags argument was not valid. -} H3ErrorCodes; - -/** @defgroup describeH3Error describeH3Error - * Functions for describeH3Error - * @{ - */ -/** @brief converts the provided H3Error value into a description string */ -DECLSPEC const char *H3_EXPORT(describeH3Error)(H3Error err); -/** @} */ - -/* library version numbers generated from VERSION file */ -// clang-format off -#define H3_VERSION_MAJOR 4 -#define H3_VERSION_MINOR 3 -#define H3_VERSION_PATCH 0 -// clang-format on - -/** Maximum number of cell boundary vertices; worst case is pentagon: - * 5 original verts + 5 edge crossings - */ -#define MAX_CELL_BNDRY_VERTS 10 - -/** @struct LatLng - @brief latitude/longitude in radians -*/ -typedef struct { - double lat; ///< latitude in radians - double lng; ///< longitude in radians -} LatLng; - -/** @struct CellBoundary - @brief cell boundary in latitude/longitude -*/ -typedef struct { - int numVerts; ///< number of vertices - LatLng verts[MAX_CELL_BNDRY_VERTS]; ///< vertices in ccw order -} CellBoundary; - -/** @struct GeoLoop - * @brief similar to CellBoundary, but requires more alloc work - */ -typedef struct { - int numVerts; - LatLng *verts; -} GeoLoop; - -/** @struct GeoPolygon - * @brief Simplified core of GeoJSON Polygon coordinates definition - */ -typedef struct { - GeoLoop geoloop; ///< exterior boundary of the polygon - int numHoles; ///< number of elements in the array pointed to by holes - GeoLoop *holes; ///< interior boundaries (holes) in the polygon -} GeoPolygon; - -/** @struct GeoMultiPolygon - * @brief Simplified core of GeoJSON MultiPolygon coordinates definition - */ -typedef struct { - int numPolygons; - GeoPolygon *polygons; -} GeoMultiPolygon; - -/** - * Values representing polyfill containment modes, to be used in - * the `flags` bit field for `polygonToCellsExperimental`. - */ -typedef enum { - CONTAINMENT_CENTER = 0, ///< Cell center is contained in the shape - CONTAINMENT_FULL = 1, ///< Cell is fully contained in the shape - CONTAINMENT_OVERLAPPING = 2, ///< Cell overlaps the shape at any point - CONTAINMENT_OVERLAPPING_BBOX = 3, ///< Cell bounding box overlaps shape - CONTAINMENT_INVALID = 4 ///< This mode is invalid and should not be used -} ContainmentMode; - -/** @struct LinkedLatLng - * @brief A coordinate node in a linked geo structure, part of a linked list - */ -typedef struct LinkedLatLng LinkedLatLng; -struct LinkedLatLng { - LatLng vertex; - LinkedLatLng *next; -}; - -/** @struct LinkedGeoLoop - * @brief A loop node in a linked geo structure, part of a linked list - */ -typedef struct LinkedGeoLoop LinkedGeoLoop; -struct LinkedGeoLoop { - LinkedLatLng *first; - LinkedLatLng *last; - LinkedGeoLoop *next; -}; - -/** @struct LinkedGeoPolygon - * @brief A polygon node in a linked geo structure, part of a linked list. - */ -typedef struct LinkedGeoPolygon LinkedGeoPolygon; -struct LinkedGeoPolygon { - LinkedGeoLoop *first; - LinkedGeoLoop *last; - LinkedGeoPolygon *next; -}; - -/** @struct CoordIJ - * @brief IJ hexagon coordinates - * - * Each axis is spaced 120 degrees apart. - */ -typedef struct { - int i; ///< i component - int j; ///< j component -} CoordIJ; - -/** @defgroup latLngToCell latLngToCell - * Functions for latLngToCell - * @{ - */ -/** @brief find the H3 index of the resolution res cell containing the lat/lng - */ -DECLSPEC H3Error H3_EXPORT(latLngToCell)(const LatLng *g, int res, - H3Index *out); -/** @} */ - -/** @defgroup cellToLatLng cellToLatLng - * Functions for cellToLatLng - * @{ - */ -/** @brief find the lat/lng center point g of the cell h3 */ -DECLSPEC H3Error H3_EXPORT(cellToLatLng)(H3Index h3, LatLng *g); -/** @} */ - -/** @defgroup cellToBoundary cellToBoundary - * Functions for cellToBoundary - * @{ - */ -/** @brief give the cell boundary in lat/lng coordinates for the cell h3 */ -DECLSPEC H3Error H3_EXPORT(cellToBoundary)(H3Index h3, CellBoundary *gp); -/** @} */ - -/** @defgroup gridDisk gridDisk - * Functions for gridDisk - * @{ - */ -/** @brief maximum number of hexagons in k-ring */ -DECLSPEC H3Error H3_EXPORT(maxGridDiskSize)(int k, int64_t *out); - -/** @brief hexagons neighbors in all directions, assuming no pentagons */ -DECLSPEC H3Error H3_EXPORT(gridDiskUnsafe)(H3Index origin, int k, H3Index *out); -/** @} */ - -/** @brief hexagons neighbors in all directions, assuming no pentagons, - * reporting distance from origin */ -DECLSPEC H3Error H3_EXPORT(gridDiskDistancesUnsafe)(H3Index origin, int k, - H3Index *out, - int *distances); - -/** @brief hexagons neighbors in all directions reporting distance from origin - */ -DECLSPEC H3Error H3_EXPORT(gridDiskDistancesSafe)(H3Index origin, int k, - H3Index *out, int *distances); - -/** @brief collection of hex rings sorted by ring for all given hexagons */ -DECLSPEC H3Error H3_EXPORT(gridDisksUnsafe)(H3Index *h3Set, int length, int k, - H3Index *out); - -/** @brief hexagon neighbors in all directions */ -DECLSPEC H3Error H3_EXPORT(gridDisk)(H3Index origin, int k, H3Index *out); -/** @} */ - -/** @defgroup gridDiskDistances gridDiskDistances - * Functions for gridDiskDistances - * @{ - */ -/** @brief hexagon neighbors in all directions, reporting distance from origin - */ -DECLSPEC H3Error H3_EXPORT(gridDiskDistances)(H3Index origin, int k, - H3Index *out, int *distances); -/** @} */ - -/** @defgroup gridRing gridRing - * Functions for gridRing - * @{ - */ -/** @brief maximum number of hexagons in hollow k-ring */ -DECLSPEC H3Error H3_EXPORT(maxGridRingSize)(int k, int64_t *out); - -/** @brief hollow hexagon ring k distance from origin */ -DECLSPEC H3Error H3_EXPORT(gridRingUnsafe)(H3Index origin, int k, H3Index *out); - -/** @brief hollow hexagon ring k distance from origin */ -DECLSPEC H3Error H3_EXPORT(gridRing)(H3Index origin, int k, H3Index *out); -/** @} */ - -/** @defgroup polygonToCells polygonToCells - * Functions for polygonToCells - * @{ - */ -/** @brief maximum number of cells that could be in the polygon */ -DECLSPEC H3Error H3_EXPORT(maxPolygonToCellsSize)(const GeoPolygon *geoPolygon, - int res, uint32_t flags, - int64_t *out); - -/** @brief cells within the given polygon */ -DECLSPEC H3Error H3_EXPORT(polygonToCells)(const GeoPolygon *geoPolygon, - int res, uint32_t flags, - H3Index *out); -/** @} */ - -/** @defgroup polygonToCellsExperimental polygonToCellsExperimental - * Functions for polygonToCellsExperimental. - * This is an experimental-only API and is subject to change in minor versions. - * @{ - */ -/** @brief maximum number of cells that could be in the polygon */ -DECLSPEC H3Error H3_EXPORT(maxPolygonToCellsSizeExperimental)( - const GeoPolygon *polygon, int res, uint32_t flags, int64_t *out); - -/** @brief cells within the given polygon */ -DECLSPEC H3Error H3_EXPORT(polygonToCellsExperimental)( - const GeoPolygon *polygon, int res, uint32_t flags, int64_t size, - H3Index *out); -/** @} */ - -/** @defgroup cellsToMultiPolygon cellsToMultiPolygon - * Functions for cellsToMultiPolygon (currently a binding-only concept) - * @{ - */ -/** @brief Create a LinkedGeoPolygon from a set of contiguous hexagons */ -DECLSPEC H3Error H3_EXPORT(cellsToLinkedMultiPolygon)(const H3Index *h3Set, - const int numHexes, - LinkedGeoPolygon *out); - -/** @brief Free all memory created for a LinkedGeoPolygon */ -DECLSPEC void H3_EXPORT(destroyLinkedMultiPolygon)(LinkedGeoPolygon *polygon); -/** @} */ - -/** @defgroup degsToRads degsToRads - * Functions for degsToRads - * @{ - */ -/** @brief converts degrees to radians */ -DECLSPEC double H3_EXPORT(degsToRads)(double degrees); -/** @} */ - -/** @defgroup radsToDegs radsToDegs - * Functions for radsToDegs - * @{ - */ -/** @brief converts radians to degrees */ -DECLSPEC double H3_EXPORT(radsToDegs)(double radians); -/** @} */ - -/** @defgroup greatCircleDistance greatCircleDistance - * Functions for distance - * @{ - */ -/** @brief "great circle distance" between pairs of LatLng points in radians*/ -DECLSPEC double H3_EXPORT(greatCircleDistanceRads)(const LatLng *a, - const LatLng *b); - -/** @brief "great circle distance" between pairs of LatLng points in - * kilometers*/ -DECLSPEC double H3_EXPORT(greatCircleDistanceKm)(const LatLng *a, - const LatLng *b); - -/** @brief "great circle distance" between pairs of LatLng points in meters*/ -DECLSPEC double H3_EXPORT(greatCircleDistanceM)(const LatLng *a, - const LatLng *b); -/** @} */ - -/** @defgroup getHexagonAreaAvg getHexagonAreaAvg - * Functions for getHexagonAreaAvg - * @{ - */ -/** @brief average hexagon area in square kilometers (excludes pentagons) */ -DECLSPEC H3Error H3_EXPORT(getHexagonAreaAvgKm2)(int res, double *out); - -/** @brief average hexagon area in square meters (excludes pentagons) */ -DECLSPEC H3Error H3_EXPORT(getHexagonAreaAvgM2)(int res, double *out); -/** @} */ - -/** @defgroup cellArea cellArea - * Functions for cellArea - * @{ - */ -/** @brief exact area for a specific cell (hexagon or pentagon) in radians^2 */ -DECLSPEC H3Error H3_EXPORT(cellAreaRads2)(H3Index h, double *out); - -/** @brief exact area for a specific cell (hexagon or pentagon) in kilometers^2 - */ -DECLSPEC H3Error H3_EXPORT(cellAreaKm2)(H3Index h, double *out); - -/** @brief exact area for a specific cell (hexagon or pentagon) in meters^2 */ -DECLSPEC H3Error H3_EXPORT(cellAreaM2)(H3Index h, double *out); -/** @} */ - -/** @defgroup getHexagonEdgeLengthAvg getHexagonEdgeLengthAvg - * Functions for getHexagonEdgeLengthAvg - * @{ - */ -/** @brief average hexagon edge length in kilometers (excludes pentagons) */ -DECLSPEC H3Error H3_EXPORT(getHexagonEdgeLengthAvgKm)(int res, double *out); - -/** @brief average hexagon edge length in meters (excludes pentagons) */ -DECLSPEC H3Error H3_EXPORT(getHexagonEdgeLengthAvgM)(int res, double *out); -/** @} */ - -/** @defgroup edgeLength edgeLength - * Functions for edgeLength - * @{ - */ -/** @brief exact length for a specific directed edge in radians*/ -DECLSPEC H3Error H3_EXPORT(edgeLengthRads)(H3Index edge, double *length); - -/** @brief exact length for a specific directed edge in kilometers*/ -DECLSPEC H3Error H3_EXPORT(edgeLengthKm)(H3Index edge, double *length); - -/** @brief exact length for a specific directed edge in meters*/ -DECLSPEC H3Error H3_EXPORT(edgeLengthM)(H3Index edge, double *length); -/** @} */ - -/** @defgroup getNumCells getNumCells - * Functions for getNumCells - * @{ - */ -/** @brief number of cells (hexagons and pentagons) for a given resolution - * - * It works out to be `2 + 120*7^r` for resolution `r`. - * - * # Mathematical notes - * - * Let h(n) be the number of children n levels below - * a single *hexagon*. - * - * Then h(n) = 7^n. - * - * Let p(n) be the number of children n levels below - * a single *pentagon*. - * - * Then p(0) = 1, and p(1) = 6, since each pentagon - * has 5 hexagonal immediate children and 1 pentagonal - * immediate child. - * - * In general, we have the recurrence relation - * - * p(n) = 5*h(n-1) + p(n-1) - * = 5*7^(n-1) + p(n-1). - * - * Working through the recurrence, we get that - * - * p(n) = 1 + 5*\sum_{k=1}^n 7^{k-1} - * = 1 + 5*(7^n - 1)/6, - * - * using the closed form for a geometric series. - * - * Using the closed forms for h(n) and p(n), we can - * get a closed form for the total number of cells - * at resolution r: - * - * c(r) = 12*p(r) + 110*h(r) - * = 2 + 120*7^r. - * - * - * @param res H3 cell resolution - * - * @return number of cells at resolution `res` - */ -DECLSPEC H3Error H3_EXPORT(getNumCells)(int res, int64_t *out); -/** @} */ - -/** @defgroup getRes0Cells getRes0Cells - * Functions for getRes0Cells - * @{ - */ -/** @brief returns the number of resolution 0 cells (hexagons and pentagons) */ -DECLSPEC int H3_EXPORT(res0CellCount)(void); - -/** @brief provides all base cells in H3Index format*/ -DECLSPEC H3Error H3_EXPORT(getRes0Cells)(H3Index *out); -/** @} */ - -/** @defgroup getPentagons getPentagons - * Functions for getPentagons - * @{ - */ -/** @brief returns the number of pentagons per resolution */ -DECLSPEC int H3_EXPORT(pentagonCount)(void); - -/** @brief generates all pentagons at the specified resolution */ -DECLSPEC H3Error H3_EXPORT(getPentagons)(int res, H3Index *out); -/** @} */ - -/** @defgroup getResolution getResolution - * Functions for getResolution - * @{ - */ -/** @brief returns the resolution of the provided H3 index - * Works on both cells and directed edges. */ -DECLSPEC int H3_EXPORT(getResolution)(H3Index h); -/** @} */ - -/** @defgroup getBaseCellNumber getBaseCellNumber - * Functions for getBaseCellNumber - * @{ - */ -/** @brief returns the base cell "number" (0 to 121) of the provided H3 cell - * - * Note: Technically works on H3 edges, but will return base cell of the - * origin cell. */ -DECLSPEC int H3_EXPORT(getBaseCellNumber)(H3Index h); -/** @} */ - -/** @defgroup stringToH3 stringToH3 - * Functions for stringToH3 - * @{ - */ -/** @brief converts the canonical string format to H3Index format */ -DECLSPEC H3Error H3_EXPORT(stringToH3)(const char *str, H3Index *out); -/** @} */ - -/** @defgroup h3ToString h3ToString - * Functions for h3ToString - * @{ - */ -/** @brief converts an H3Index to a canonical string */ -DECLSPEC H3Error H3_EXPORT(h3ToString)(H3Index h, char *str, size_t sz); -/** @} */ - -/** @defgroup isValidCell isValidCell - * Functions for isValidCell - * @{ - */ -/** @brief confirms if an H3Index is a valid cell (hexagon or pentagon) - * In particular, returns 0 (False) for H3 directed edges or invalid data - */ -DECLSPEC int H3_EXPORT(isValidCell)(H3Index h); -/** @} */ - -/** @defgroup cellToParent cellToParent - * Functions for cellToParent - * @{ - */ -/** @brief returns the parent (or grandparent, etc) cell of the given cell - */ -DECLSPEC H3Error H3_EXPORT(cellToParent)(H3Index h, int parentRes, - H3Index *parent); -/** @} */ - -/** @defgroup cellToChildren cellToChildren - * Functions for cellToChildren - * @{ - */ -/** @brief determines the exact number of children (or grandchildren, etc) - * that would be returned for the given cell */ -DECLSPEC H3Error H3_EXPORT(cellToChildrenSize)(H3Index h, int childRes, - int64_t *out); - -/** @brief provides the children (or grandchildren, etc) of the given cell */ -DECLSPEC H3Error H3_EXPORT(cellToChildren)(H3Index h, int childRes, - H3Index *children); -/** @} */ - -/** @defgroup cellToCenterChild cellToCenterChild - * Functions for cellToCenterChild - * @{ - */ -/** @brief returns the center child of the given cell at the specified - * resolution */ -DECLSPEC H3Error H3_EXPORT(cellToCenterChild)(H3Index h, int childRes, - H3Index *child); -/** @} */ - -/** @defgroup cellToChildPos cellToChildPos - * Functions for cellToChildPos - * @{ - */ -/** @brief Returns the position of the cell within an ordered list of all - * children of the cell's parent at the specified resolution */ -DECLSPEC H3Error H3_EXPORT(cellToChildPos)(H3Index child, int parentRes, - int64_t *out); -/** @} */ - -/** @defgroup childPosToCell childPosToCell - * Functions for childPosToCell - * @{ - */ -/** @brief Returns the child cell at a given position within an ordered list of - * all children at the specified resolution */ -DECLSPEC H3Error H3_EXPORT(childPosToCell)(int64_t childPos, H3Index parent, - int childRes, H3Index *child); -/** @} */ - -/** @defgroup compactCells compactCells - * Functions for compactCells - * @{ - */ -/** @brief compacts the given set of hexagons as best as possible */ -DECLSPEC H3Error H3_EXPORT(compactCells)(const H3Index *h3Set, - H3Index *compactedSet, - const int64_t numHexes); -/** @} */ - -/** @defgroup uncompactCells uncompactCells - * Functions for uncompactCells - * @{ - */ -/** @brief determines the exact number of hexagons that will be uncompacted - * from the compacted set */ -DECLSPEC H3Error H3_EXPORT(uncompactCellsSize)(const H3Index *compactedSet, - const int64_t numCompacted, - const int res, int64_t *out); - -/** @brief uncompacts the compacted hexagon set */ -DECLSPEC H3Error H3_EXPORT(uncompactCells)(const H3Index *compactedSet, - const int64_t numCompacted, - H3Index *outSet, - const int64_t numOut, const int res); -/** @} */ - -/** @defgroup isResClassIII isResClassIII - * Functions for isResClassIII - * @{ - */ -/** @brief determines if a hexagon is Class III (or Class II) */ -DECLSPEC int H3_EXPORT(isResClassIII)(H3Index h); -/** @} */ - -/** @defgroup isPentagon isPentagon - * Functions for isPentagon - * @{ - */ -/** @brief determines if an H3 cell is a pentagon */ -DECLSPEC int H3_EXPORT(isPentagon)(H3Index h); -/** @} */ - -/** @defgroup getIcosahedronFaces getIcosahedronFaces - * Functions for getIcosahedronFaces - * @{ - */ -/** @brief Max number of icosahedron faces intersected by an index */ -DECLSPEC H3Error H3_EXPORT(maxFaceCount)(H3Index h3, int *out); - -/** @brief Find all icosahedron faces intersected by a given H3 index */ -DECLSPEC H3Error H3_EXPORT(getIcosahedronFaces)(H3Index h3, int *out); -/** @} */ - -/** @defgroup areNeighborCells areNeighborCells - * Functions for areNeighborCells - * @{ - */ -/** @brief returns whether or not the provided hexagons border */ -DECLSPEC H3Error H3_EXPORT(areNeighborCells)(H3Index origin, - H3Index destination, int *out); -/** @} */ - -/** @defgroup cellsToDirectedEdge cellsToDirectedEdge - * Functions for cellsToDirectedEdge - * @{ - */ -/** @brief returns the directed edge H3Index for the specified origin and - * destination */ -DECLSPEC H3Error H3_EXPORT(cellsToDirectedEdge)(H3Index origin, - H3Index destination, - H3Index *out); -/** @} */ - -/** @defgroup isValidDirectedEdge isValidDirectedEdge - * Functions for isValidDirectedEdge - * @{ - */ -/** @brief returns whether the H3Index is a valid directed edge */ -DECLSPEC int H3_EXPORT(isValidDirectedEdge)(H3Index edge); -/** @} */ - -/** @defgroup getDirectedEdgeOrigin \ - * getDirectedEdgeOrigin - * Functions for getDirectedEdgeOrigin - * @{ - */ -/** @brief Returns the origin hexagon H3Index from the directed edge - * H3Index */ -DECLSPEC H3Error H3_EXPORT(getDirectedEdgeOrigin)(H3Index edge, H3Index *out); -/** @} */ - -/** @defgroup getDirectedEdgeDestination \ - * getDirectedEdgeDestination - * Functions for getDirectedEdgeDestination - * @{ - */ -/** @brief Returns the destination hexagon H3Index from the directed edge - * H3Index */ -DECLSPEC H3Error H3_EXPORT(getDirectedEdgeDestination)(H3Index edge, - H3Index *out); -/** @} */ - -/** @defgroup directedEdgeToCells \ - * directedEdgeToCells - * Functions for directedEdgeToCells - * @{ - */ -/** @brief Returns the origin and destination hexagons from the directed - * edge H3Index */ -DECLSPEC H3Error H3_EXPORT(directedEdgeToCells)(H3Index edge, - H3Index *originDestination); -/** @} */ - -/** @defgroup originToDirectedEdges \ - * originToDirectedEdges - * Functions for originToDirectedEdges - * @{ - */ -/** @brief Returns the 6 (or 5 for pentagons) edges associated with the H3Index - */ -DECLSPEC H3Error H3_EXPORT(originToDirectedEdges)(H3Index origin, - H3Index *edges); -/** @} */ - -/** @defgroup directedEdgeToBoundary directedEdgeToBoundary - * Functions for directedEdgeToBoundary - * @{ - */ -/** @brief Returns the CellBoundary containing the coordinates of the edge */ -DECLSPEC H3Error H3_EXPORT(directedEdgeToBoundary)(H3Index edge, - CellBoundary *gb); -/** @} */ - -/** @defgroup cellToVertex cellToVertex - * Functions for cellToVertex - * @{ - */ -/** @brief Returns a single vertex for a given cell, as an H3 index */ -DECLSPEC H3Error H3_EXPORT(cellToVertex)(H3Index origin, int vertexNum, - H3Index *out); -/** @} */ - -/** @defgroup cellToVertexes cellToVertexes - * Functions for cellToVertexes - * @{ - */ -/** @brief Returns all vertexes for a given cell, as H3 indexes */ -DECLSPEC H3Error H3_EXPORT(cellToVertexes)(H3Index origin, H3Index *vertexes); -/** @} */ - -/** @defgroup vertexToLatLng vertexToLatLng - * Functions for vertexToLatLng - * @{ - */ -/** @brief Returns a single vertex for a given cell, as an H3 index */ -DECLSPEC H3Error H3_EXPORT(vertexToLatLng)(H3Index vertex, LatLng *point); -/** @} */ - -/** @defgroup isValidVertex isValidVertex - * Functions for isValidVertex - * @{ - */ -/** @brief Whether the input is a valid H3 vertex */ -DECLSPEC int H3_EXPORT(isValidVertex)(H3Index vertex); -/** @} */ - -/** @defgroup gridDistance gridDistance - * Functions for gridDistance - * @{ - */ -/** @brief Returns grid distance between two indexes */ -DECLSPEC H3Error H3_EXPORT(gridDistance)(H3Index origin, H3Index h3, - int64_t *distance); -/** @} */ - -/** @defgroup gridPathCells gridPathCells - * Functions for gridPathCells - * @{ - */ -/** @brief Number of indexes in a line connecting two indexes */ -DECLSPEC H3Error H3_EXPORT(gridPathCellsSize)(H3Index start, H3Index end, - int64_t *size); - -/** @brief Line of h3 indexes connecting two indexes */ -DECLSPEC H3Error H3_EXPORT(gridPathCells)(H3Index start, H3Index end, - H3Index *out); -/** @} */ - -/** @defgroup cellToLocalIj cellToLocalIj - * Functions for cellToLocalIj - * @{ - */ -/** @brief Returns two dimensional coordinates for the given index */ -DECLSPEC H3Error H3_EXPORT(cellToLocalIj)(H3Index origin, H3Index h3, - uint32_t mode, CoordIJ *out); -/** @} */ - -/** @defgroup localIjToCell localIjToCell - * Functions for localIjToCell - * @{ - */ -/** @brief Returns index for the given two dimensional coordinates */ -DECLSPEC H3Error H3_EXPORT(localIjToCell)(H3Index origin, const CoordIJ *ij, - uint32_t mode, H3Index *out); -/** @} */ - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif diff --git a/frogpilot/third_party/h3/_cy/h3lib.pxd b/frogpilot/third_party/h3/_cy/h3lib.pxd deleted file mode 100644 index e94f655b..00000000 --- a/frogpilot/third_party/h3/_cy/h3lib.pxd +++ /dev/null @@ -1,193 +0,0 @@ -# cython: c_string_type=unicode, c_string_encoding=utf8 -from cpython cimport bool -from libc.stdint cimport uint32_t, uint64_t, int64_t - -ctypedef object H3str - -cdef extern from 'h3api.h': - cdef int H3_VERSION_MAJOR - cdef int H3_VERSION_MINOR - cdef int H3_VERSION_PATCH - - ctypedef uint64_t H3int 'H3Index' - - ctypedef uint32_t H3Error - ctypedef enum H3ErrorCodes: - E_SUCCESS = 0 - E_FAILED = 1 - E_DOMAIN = 2 - E_LATLNG_DOMAIN = 3 - E_RES_DOMAIN = 4 - E_CELL_INVALID = 5 - E_DIR_EDGE_INVALID = 6 - E_UNDIR_EDGE_INVALID = 7 - E_VERTEX_INVALID = 8 - E_PENTAGON = 9 - E_DUPLICATE_INPUT = 10 - E_NOT_NEIGHBORS = 11 - E_RES_MISMATCH = 12 - E_MEMORY_ALLOC = 13 - E_MEMORY_BOUNDS = 14 - E_OPTION_INVALID = 15 - - ctypedef struct LatLng: - double lat # in radians - double lng # in radians - - ctypedef struct CellBoundary: - int num_verts 'numVerts' - LatLng verts[10] # MAX_CELL_BNDRY_VERTS - - ctypedef struct CoordIJ: - int i - int j - - ctypedef struct LinkedLatLng: - LatLng data 'vertex' - LinkedLatLng *next - - # renaming these for clarity - ctypedef struct LinkedGeoLoop: - LinkedLatLng *data 'first' - LinkedLatLng *_data_last 'last' # not needed in Cython bindings - LinkedGeoLoop *next - - ctypedef struct LinkedGeoPolygon: - LinkedGeoLoop *data 'first' - LinkedGeoLoop *_data_last 'last' # not needed in Cython bindings - LinkedGeoPolygon *next - - ctypedef struct GeoLoop: - int numVerts - LatLng *verts - - ctypedef struct GeoPolygon: - GeoLoop geoloop - int numHoles - GeoLoop *holes - - int isValidCell(H3int h) nogil - int isPentagon(H3int h) nogil - int isResClassIII(H3int h) nogil - int isValidDirectedEdge(H3int edge) nogil - int isValidVertex(H3int v) nogil - - double degsToRads(double degrees) nogil - double radsToDegs(double radians) nogil - - int getResolution(H3int h) nogil - int getBaseCellNumber(H3int h) nogil - - H3Error latLngToCell(const LatLng *g, int res, H3int *out) nogil - H3Error cellToLatLng(H3int h, LatLng *) nogil - H3Error gridDistance(H3int h1, H3int h2, int64_t *distance) nogil - - H3Error cellToVertex(H3int cell, int vertexNum, H3int *out) nogil - H3Error cellToVertexes(H3int cell, H3int *vertexes) nogil - H3Error vertexToLatLng(H3int vertex, LatLng *coord) nogil - - H3Error maxGridDiskSize(int k, int64_t *out) nogil # num/out/N? - H3Error gridDisk(H3int h, int k, H3int *out) nogil - - H3Error cellToParent( H3int h, int parentRes, H3int *parent) nogil - H3Error cellToCenterChild(H3int h, int childRes, H3int *child) nogil - H3Error cellToChildPos(H3int child, int parentRes, int64_t *out) nogil - H3Error childPosToCell(int64_t childPos, H3int parent, int childRes, H3int *child) nogil - - H3Error cellToChildrenSize(H3int h, int childRes, int64_t *num) nogil # num/out/N? - H3Error cellToChildren( H3int h, int childRes, H3int *children) nogil - - H3Error compactCells( - const H3int *cells_u, - H3int *cells_c, - const int num_u - ) nogil - H3Error uncompactCellsSize( - const H3int *cells_c, - const int64_t num_c, - const int res, - int64_t *num_u - ) nogil - H3Error uncompactCells( - const H3int *cells_c, - const int num_c, - H3int *cells_u, - const int num_u, - const int res - ) nogil - - H3Error getNumCells(int res, int64_t *out) nogil - int pentagonCount() nogil - int res0CellCount() nogil - H3Error getPentagons(int res, H3int *out) nogil - H3Error getRes0Cells(H3int *out) nogil - - H3Error gridPathCellsSize(H3int start, H3int end, int64_t *size) nogil - H3Error gridPathCells(H3int start, H3int end, H3int *out) nogil - - H3Error getHexagonAreaAvgKm2(int res, double *out) nogil - H3Error getHexagonAreaAvgM2(int res, double *out) nogil - - H3Error cellAreaRads2(H3int h, double *out) nogil - H3Error cellAreaKm2(H3int h, double *out) nogil - H3Error cellAreaM2(H3int h, double *out) nogil - - H3Error maxFaceCount(H3int h, int *out) nogil - H3Error getIcosahedronFaces(H3int h3, int *out) nogil - - H3Error cellToLocalIj(H3int origin, H3int h3, uint32_t mode, CoordIJ *out) nogil - H3Error localIjToCell(H3int origin, const CoordIJ *ij, uint32_t mode, H3int *out) nogil - - H3Error gridDiskDistances(H3int origin, int k, H3int *out, int *distances) nogil - H3Error gridRing(H3int origin, int k, H3int *out) nogil - H3Error gridRingUnsafe(H3int origin, int k, H3int *out) nogil - - H3Error areNeighborCells(H3int origin, H3int destination, int *out) nogil - H3Error cellsToDirectedEdge(H3int origin, H3int destination, H3int *out) nogil - H3Error getDirectedEdgeOrigin(H3int edge, H3int *out) nogil - H3Error getDirectedEdgeDestination(H3int edge, H3int *out) nogil - H3Error originToDirectedEdges(H3int origin, H3int *edges) nogil - # todo: directedEdgeToCells - - H3Error getHexagonEdgeLengthAvgKm(int res, double *out) nogil - H3Error getHexagonEdgeLengthAvgM(int res, double *out) nogil - - H3Error edgeLengthRads(H3int edge, double *out) nogil - H3Error edgeLengthKm(H3int edge, double *out) nogil - H3Error edgeLengthM(H3int edge, double *out) nogil - - H3Error cellToBoundary(H3int h3, CellBoundary *gp) nogil - H3Error directedEdgeToBoundary(H3int edge, CellBoundary *gb) nogil - - double greatCircleDistanceRads(const LatLng *a, const LatLng *b) nogil - double greatCircleDistanceKm(const LatLng *a, const LatLng *b) nogil - double greatCircleDistanceM(const LatLng *a, const LatLng *b) nogil - - H3Error cellsToLinkedMultiPolygon(const H3int *h3Set, const int numCells, LinkedGeoPolygon *out) - void destroyLinkedMultiPolygon(LinkedGeoPolygon *polygon) - - H3Error maxPolygonToCellsSize(const GeoPolygon *geoPolygon, int res, uint32_t flags, uint64_t *count) - H3Error polygonToCells(const GeoPolygon *geoPolygon, int res, uint32_t flags, H3int *out) - - H3Error maxPolygonToCellsSizeExperimental(const GeoPolygon *geoPolygon, int res, uint32_t flags, uint64_t *count) - H3Error polygonToCellsExperimental(const GeoPolygon *geoPolygon, int res, uint32_t flags, uint64_t sz, H3int *out) - - # ctypedef struct GeoMultiPolygon: - # int numPolygons - # GeoPolygon *polygons - - # int hexRange(H3int origin, int k, H3int *out) - - # int hexRangeDistances(H3int origin, int k, H3int *out, int *distances) - - # int hexRanges(H3int *h3Set, int length, int k, H3int *out) - - # void h3SetToLinkedGeo(const H3int *h3Set, const int numCells, LinkedGeoPolygon *out) - - # void destroyLinkedPolygon(LinkedGeoPolygon *polygon) - - # H3int stringToH3(const char *str) - - # void h3ToString(H3int h, char *str, size_t sz) - - # void getH3intesFromUnidirectionalEdge(H3int edge, H3int *originDestination) diff --git a/frogpilot/third_party/h3/_cy/latlng.cpython-312-aarch64-linux-gnu.so b/frogpilot/third_party/h3/_cy/latlng.cpython-312-aarch64-linux-gnu.so index 133658ff..f8b6bfaa 100644 Binary files a/frogpilot/third_party/h3/_cy/latlng.cpython-312-aarch64-linux-gnu.so and b/frogpilot/third_party/h3/_cy/latlng.cpython-312-aarch64-linux-gnu.so differ diff --git a/frogpilot/third_party/h3/_cy/latlng.pxd b/frogpilot/third_party/h3/_cy/latlng.pxd deleted file mode 100644 index 40dfc349..00000000 --- a/frogpilot/third_party/h3/_cy/latlng.pxd +++ /dev/null @@ -1,7 +0,0 @@ -from .h3lib cimport H3int - -cpdef H3int latlng_to_cell(double lat, double lng, int res) except 1 -cpdef (double, double) cell_to_latlng(H3int h) except * -cpdef double great_circle_distance( - double lat1, double lng1, - double lat2, double lng2, unit=*) except -1 diff --git a/frogpilot/third_party/h3/_cy/latlng.pyx b/frogpilot/third_party/h3/_cy/latlng.pyx deleted file mode 100644 index d83a9d3d..00000000 --- a/frogpilot/third_party/h3/_cy/latlng.pyx +++ /dev/null @@ -1,325 +0,0 @@ -from libc.stdint cimport uint64_t - -cimport h3lib -from h3lib cimport bool, H3int - -from .util cimport ( - check_cell, - check_edge, - check_res, - deg2coord, - coord2deg -) - -from .error_system cimport check_for_error - -from .memory cimport H3MemoryManager - -# TODO: We might be OK with taking the GIL for the functions in this module -from libc.stdlib cimport ( - # malloc as h3_malloc, # not used - calloc as h3_calloc, - realloc as h3_realloc, - free as h3_free, -) - - -cpdef H3int latlng_to_cell(double lat, double lng, int res) except 1: - cdef: - h3lib.LatLng c - H3int out - - c = deg2coord(lat, lng) - - check_for_error( - h3lib.latLngToCell(&c, res, &out) - ) - - return out - - -cpdef (double, double) cell_to_latlng(H3int h) except *: - """Map an H3 cell into its centroid geo-coordinate (lat/lng)""" - cdef: - h3lib.LatLng c - - check_cell(h) - # todo: think about: if you give this an invalid cell, should it still return a lat/lng? - # idea: safe and unsafe APIs? - - check_for_error( - h3lib.cellToLatLng(h, &c) - ) - - return coord2deg(c) - - -cdef h3lib.GeoLoop make_geoloop(latlngs) except *: - """ - The returned `GeoLoop` must be freed with a call to `free_geoloop`. - - Parameters - ---------- - latlngs : list or tuple - GeoLoop: A sequence of >= 3 (lat, lng) pairs where the last - element may or may not be same as the first (to form a closed loop). - The order of the pairs may be either clockwise or counterclockwise. - """ - cdef: - h3lib.GeoLoop gl - - gl.numVerts = len(latlngs) - - # todo: need for memory management - # can automatically free? - gl.verts = h3_calloc(gl.numVerts, sizeof(h3lib.LatLng)) - - for i, (lat, lng) in enumerate(latlngs): - gl.verts[i] = deg2coord(lat, lng) - - return gl - - -cdef free_geoloop(h3lib.GeoLoop* gl): - h3_free(gl.verts) - gl.verts = NULL - - -cdef class GeoPolygon: - cdef: - h3lib.GeoPolygon gp - - def __cinit__(self, outer, holes=None): - """ - - Parameters - ---------- - outer : list or tuple - GeoLoop - A GeoLoop is a sequence of >= 3 (lat, lng) pairs where the last - element may or may not be same as the first (to form a closed loop). - The order of the pairs may be either clockwise or counterclockwise. - holes : list or tuple - A sequence of GeoLoops - """ - if holes is None: - holes = [] - - self.gp.geoloop = make_geoloop(outer) - self.gp.numHoles = len(holes) - self.gp.holes = NULL - - if len(holes) > 0: - self.gp.holes = h3_calloc(len(holes), sizeof(h3lib.GeoLoop)) - for i, hole in enumerate(holes): - self.gp.holes[i] = make_geoloop(hole) - - - def __dealloc__(self): - free_geoloop(&self.gp.geoloop) - - for i in range(self.gp.numHoles): - free_geoloop(&self.gp.holes[i]) - - h3_free(self.gp.holes) - - -def polygon_to_cells(outer, int res, holes=None): - """ Get the set of cells whose center is contained in a polygon. - - The polygon is defined similarity to the GeoJson standard, with an exterior - `outer` ring of lat/lng points, and a list of `holes`, each of which are also - rings of lat/lng points. - - Each ring may be in clockwise or counter-clockwise order - (right-hand rule or not), and may or may not be a closed loop (where the last - element is equal to the first). - The GeoJSON spec requires the right-hand rule and a closed loop, but - this function relaxes those constraints. - - Unlike the GeoJson standard, the elements of the lat/lng pairs of each - ring are in lat/lng order, instead of lng/lat order. - - We'll handle translation to different formats in the Python code, - rather than the Cython code. - - Parameters - ---------- - outer : list or tuple - A ring given by a sequence of lat/lng pairs. - res : int - The resolution of the output hexagons - holes : list or tuple - A collection of rings, each given by a sequence of lat/lng pairs. - These describe any the "holes" in the polygon. - """ - cdef: - uint64_t n - - check_res(res) - - if not outer: - return H3MemoryManager(0).to_mv() - - gp = GeoPolygon(outer, holes=holes) - - check_for_error( - h3lib.maxPolygonToCellsSize(&gp.gp, res, 0, &n) - ) - - hmm = H3MemoryManager(n) - check_for_error( - h3lib.polygonToCells(&gp.gp, res, 0, hmm.ptr) - ) - mv = hmm.to_mv() - - return mv - - -def polygons_to_cells(polygons, int res): - mvs = [ - polygon_to_cells(outer=poly.outer, res=res, holes=poly.holes) - for poly in polygons - ] - - n = sum(map(len, mvs)) - hmm = H3MemoryManager(n) - - # probably super inefficient, but it is working! - # tood: move this to C - k = 0 - for mv in mvs: - for v in mv: - hmm.ptr[k] = v - k += 1 - - return hmm.to_mv() - - -def polygon_to_cells_experimental(outer, int res, int flag, holes=None): - """ Get the set of cells whose center is contained in a polygon. - - The polygon is defined similarity to the GeoJson standard, with an exterior - `outer` ring of lat/lng points, and a list of `holes`, each of which are also - rings of lat/lng points. - - Each ring may be in clockwise or counter-clockwise order - (right-hand rule or not), and may or may not be a closed loop (where the last - element is equal to the first). - The GeoJSON spec requires the right-hand rule and a closed loop, but - this function relaxes those constraints. - - Unlike the GeoJson standard, the elements of the lat/lng pairs of each - ring are in lat/lng order, instead of lng/lat order. - - We'll handle translation to different formats in the Python code, - rather than the Cython code. - - Parameters - ---------- - outer : list or tuple - A ring given by a sequence of lat/lng pairs. - res : int - The resolution of the output hexagons - flag : int - Polygon to cells flag, such as containment mode. - holes : list or tuple - A collection of rings, each given by a sequence of lat/lng pairs. - These describe any the "holes" in the polygon. - """ - cdef: - uint64_t n - - check_res(res) - - if not outer: - return H3MemoryManager(0).to_mv() - - gp = GeoPolygon(outer, holes=holes) - - check_for_error( - h3lib.maxPolygonToCellsSizeExperimental(&gp.gp, res, flag, &n) - ) - - hmm = H3MemoryManager(n) - check_for_error( - h3lib.polygonToCellsExperimental(&gp.gp, res, flag, n, hmm.ptr) - ) - mv = hmm.to_mv() - - return mv - - -def polygons_to_cells_experimental(polygons, int res, int flag): - mvs = [ - polygon_to_cells_experimental(outer=poly.outer, res=res, holes=poly.holes, flag=flag) - for poly in polygons - ] - - n = sum(map(len, mvs)) - hmm = H3MemoryManager(n) - - # probably super inefficient, but it is working! - # tood: move this to C - k = 0 - for mv in mvs: - for v in mv: - hmm.ptr[k] = v - k += 1 - - return hmm.to_mv() - - -def cell_to_boundary(H3int h): - """Compose an array of geo-coordinates that outlines a hexagonal cell""" - cdef: - h3lib.CellBoundary gb - - check_cell(h) - - h3lib.cellToBoundary(h, &gb) - - verts = tuple( - coord2deg(gb.verts[i]) - for i in range(gb.num_verts) - ) - - return verts - - -def directed_edge_to_boundary(H3int edge): - """ Returns the CellBoundary containing the coordinates of the edge - """ - cdef: - h3lib.CellBoundary gb - - check_edge(edge) - - h3lib.directedEdgeToBoundary(edge, &gb) - - # todo: move this verts transform into the CellBoundary object - verts = tuple( - coord2deg(gb.verts[i]) - for i in range(gb.num_verts) - ) - - return verts - - -cpdef double great_circle_distance( - double lat1, double lng1, - double lat2, double lng2, unit='km') except -1: - - a = deg2coord(lat1, lng1) - b = deg2coord(lat2, lng2) - - if unit == 'rads': - d = h3lib.greatCircleDistanceRads(&a, &b) - elif unit == 'km': - d = h3lib.greatCircleDistanceKm(&a, &b) - elif unit == 'm': - d = h3lib.greatCircleDistanceM(&a, &b) - else: - raise ValueError('Unknown unit: {}'.format(unit)) - - return d diff --git a/frogpilot/third_party/h3/_cy/memory.cpython-312-aarch64-linux-gnu.so b/frogpilot/third_party/h3/_cy/memory.cpython-312-aarch64-linux-gnu.so index 60a02d66..1b3bf2b6 100644 Binary files a/frogpilot/third_party/h3/_cy/memory.cpython-312-aarch64-linux-gnu.so and b/frogpilot/third_party/h3/_cy/memory.cpython-312-aarch64-linux-gnu.so differ diff --git a/frogpilot/third_party/h3/_cy/memory.pxd b/frogpilot/third_party/h3/_cy/memory.pxd deleted file mode 100644 index 5e259e25..00000000 --- a/frogpilot/third_party/h3/_cy/memory.pxd +++ /dev/null @@ -1,12 +0,0 @@ -from .h3lib cimport H3int - -cdef class H3MemoryManager: - cdef: - size_t n - H3int* ptr - - cdef H3int[:] to_mv(self) - cdef H3int[:] to_mv_keep_zeros(self) - -cdef int[:] int_mv(size_t n) -cpdef H3int[:] iter_to_mv(cells) diff --git a/frogpilot/third_party/h3/_cy/memory.pyx b/frogpilot/third_party/h3/_cy/memory.pyx deleted file mode 100644 index 0852105f..00000000 --- a/frogpilot/third_party/h3/_cy/memory.pyx +++ /dev/null @@ -1,248 +0,0 @@ -from cython.view cimport array -from .h3lib cimport H3int - -""" -### Memory allocation options - -We have a few options for the memory allocation functions. -There's a trade-off between using the Python allocators which let Python -track memory usage and offers some optimizations vs the system -allocators, which do not need to acquire the GIL. -""" - -""" -System allocation functions. These do not acquire the GIL. -""" -from libc.stdlib cimport ( - # malloc as h3_malloc, # not used - calloc as h3_calloc, - realloc as h3_realloc, - free as h3_free, -) - - -""" -PyMem_Raw* functions should just be wrappers around system allocators -also given in libc.stdlib. These functions do not acquire the GIL. - -Note that these do not have a calloc function until py 3.5 and Cython 3.0, -so we would need to zero-out memory manually. - -https://python.readthedocs.io/en/stable/c-api/memory.html#raw-memory-interface -""" -# from cpython.mem cimport ( -# PyMem_RawMalloc as h3_malloc, -# # PyMem_RawCalloc as h3_calloc, # only in Python >=3.5 (and Cython >=3.0?) -# PyMem_RawRealloc as h3_realloc, -# PyMem_RawFree as h3_free, -# ) - - -""" -These functions use the Python allocator (instead of the system allocator), -which offers some optimizations for Python, and allows Python to track -memory usage. However, these functions must acquire the GIL. - -Note that these do not have a calloc function until py 3.5 and Cython 3.0, -so we would need to zero-out memory manually. - -https://cython.readthedocs.io/en/stable/src/tutorial/memory_allocation.html -https://python.readthedocs.io/en/stable/c-api/memory.html#memory-interface -""" -# from cpython.mem cimport ( -# PyMem_Malloc as h3_malloc, -# # PyMem_Calloc as h3_calloc, # only in Python >=3.5 (and Cython >=3.0?) -# PyMem_Realloc as h3_realloc, -# PyMem_Free as h3_free, -# ) - - -cdef size_t move_nonzeros(H3int* a, size_t n): - """ Move nonzero elements to front of array `a` of length `n`. - Return the number of nonzero elements. - - Loop invariant: Everything *before* `i` or *after* `j` is "done". - Move `i` and `j` inwards until they equal, and exit. - You can move `i` forward until there's a zero in front of it. - You can move `j` backward until there's a nonzero to the left of it. - Anything to the right of `j` is "junk" that can be reallocated. - - | a | b | 0 | c | d | ... | - ^ ^ - i j - - - | a | b | d | c | d | ... | - ^ ^ - i j - """ - cdef: - size_t i = 0 - size_t j = n - - while i < j: - if a[j-1] == 0: - j -= 1 - continue - - if a[i] != 0: - i += 1 - continue - - # if we're here, we know: - # a[i] == 0 - # a[j-1] != 0 - # i < j - # so we can swap! (actually, move a[j-1] -> a[i]) - a[i] = a[j-1] - j -= 1 - - return i - - -cdef H3int[:] empty_memory_view(): - # todo: get rid of this? - # there's gotta be a better way to do this... - # create an empty cython.view.array? - cdef: - H3int a[1] - - return (a)[:0] - - -cdef _remove_zeros(H3MemoryManager x): - x.n = move_nonzeros(x.ptr, x.n) - - if x.n == 0: - h3_free(x.ptr) - x.ptr = NULL - else: - x.ptr = h3_realloc(x.ptr, x.n*sizeof(H3int)) - if not x.ptr: - raise MemoryError() - - -cdef H3int[:] _copy_to_mv(const H3int* ptr, size_t n): - cdef: - array arr - - arr = ptr - arr.callback_free_data = h3_free - - return arr - - -cdef H3int[:] _create_mv(H3MemoryManager x): - if x.n == 0: - h3_free(x.ptr) - x.ptr = NULL - mv = empty_memory_view() - else: - mv = _copy_to_mv(x.ptr, x.n) - - # responsibility for the memory moves from this object to the array/memoryview - x.ptr = NULL - x.n = 0 - - return mv - - -""" -TODO: The not None declaration for the argument automatically rejects None values as input, which would otherwise be allowed. The reason why None is allowed by default is that it is conveniently used for return arguments: - https://cython.readthedocs.io/en/latest/src/userguide/memoryviews.html#syntax - -TODO: potential optimization: https://cython.readthedocs.io/en/latest/src/userguide/memoryviews.html#performance-disabling-initialization-checks - -## future improvements: - -- abolish any appearance of &thing[0]. (i.e., identical interfaces) -- can i make the interface for all these memory views identical? -""" - -cdef class H3MemoryManager: - """ - Cython object in charge of allocating and freeing memory for arrays - of H3 indexes. - - Initially allocates memory and provides access through `self.ptr` and - `self.n`. - - The `to_mv()` function removes responsibility for the allocated memory - from this object to a memory view object. A memory view object automatically - deallocates its memory during garbage collection. - - If the H3MemoryManager is garbage collected before running `to_mv()`, - it will deallocate its memory itself. - - This pattern is useful for a few reasons: - - - provide convenient access to the raw memory pointer and length for passing - to h3lib functions - - remove zeroes from the array output (some h3lib functions may return - results with zeros/H3NULL values) - - cython and python array types have weird interfaces; memoryviews are - much cleaner - - If we find a better way to do these then this class may no longer be - necessary. - - TODO: consider a context manager pattern - """ - def __cinit__(self, size_t n): - self.n = n - self.ptr = h3_calloc(self.n, sizeof(H3int)) - - if not self.ptr: - raise MemoryError() - - cdef H3int[:] to_mv_keep_zeros(self): - # todo: this could be a private method - return _create_mv(self) - - cdef H3int[:] to_mv(self): - _remove_zeros(self) - return _create_mv(self) - - def __dealloc__(self): - # If the memory has been handed off to a memoryview, this pointer - # should be NULL, and deallocing on NULL is fine. - # If the pointer is *not* NULL, then this means the MemoryManager - # has is still responsible for the memory (it hasn't given the memory away to another object). - h3_free(self.ptr) - - -""" -todo: combine with the H3MemoryManager using fused types? -https://cython.readthedocs.io/en/stable/src/userguide/fusedtypes.html -""" -cdef int[:] int_mv(size_t n): - cdef: - array arr - - if n == 0: - raise MemoryError() - else: - ptr = h3_calloc(n, sizeof(int)) - if ptr is NULL: - raise MemoryError() - - arr = ptr - arr.callback_free_data = h3_free - - return arr - - -cpdef H3int[:] iter_to_mv(cells): - """ cells needs to be an iterable that knows its size... - or should we have it match the np.fromiter function, which infers if not available? - """ - cdef: - H3int[:] mv - - n = len(cells) - mv = H3MemoryManager(n).to_mv_keep_zeros() - - for i,h in enumerate(cells): - mv[i] = h - - return mv diff --git a/frogpilot/third_party/h3/_cy/to_multipoly.cpython-312-aarch64-linux-gnu.so b/frogpilot/third_party/h3/_cy/to_multipoly.cpython-312-aarch64-linux-gnu.so index 081d3f83..58d05941 100644 Binary files a/frogpilot/third_party/h3/_cy/to_multipoly.cpython-312-aarch64-linux-gnu.so and b/frogpilot/third_party/h3/_cy/to_multipoly.cpython-312-aarch64-linux-gnu.so differ diff --git a/frogpilot/third_party/h3/_cy/to_multipoly.pyx b/frogpilot/third_party/h3/_cy/to_multipoly.pyx deleted file mode 100644 index db29baa5..00000000 --- a/frogpilot/third_party/h3/_cy/to_multipoly.pyx +++ /dev/null @@ -1,60 +0,0 @@ -cimport h3lib -from h3lib cimport H3int -from .util cimport check_cell, coord2deg - - -# todo: it's driving me crazy that these three functions are all essentially the same linked list walker... -# grumble: no way to do iterators in with cdef functions! -cdef walk_polys(const h3lib.LinkedGeoPolygon* L): - out = [] - while L: - out += [walk_loops(L.data)] - L = L.next - - return out - - -cdef walk_loops(const h3lib.LinkedGeoLoop* L): - out = [] - while L: - out += [walk_coords(L.data)] - L = L.next - - return out - - -cdef walk_coords(const h3lib.LinkedLatLng* L): - out = [] - while L: - out += [coord2deg(L.data)] - L = L.next - - return out - -# todo: tuples instead of lists? -def _to_multi_polygon(const H3int[:] cells): - cdef: - h3lib.LinkedGeoPolygon polygon - - for h in cells: - check_cell(h) - - h3lib.cellsToLinkedMultiPolygon(&cells[0], len(cells), &polygon) - - out = walk_polys(&polygon) - - # we're still responsible for cleaning up the passed in `polygon`, - # but not a problem here, since it is stack allocated - h3lib.destroyLinkedMultiPolygon(&polygon) - - return out - - -def cells_to_multi_polygon(const H3int[:] cells): - # todo: gotta be a more elegant way to handle these... - if len(cells) == 0: - return [] - - multipoly = _to_multi_polygon(cells) - - return multipoly diff --git a/frogpilot/third_party/h3/_cy/util.cpython-312-aarch64-linux-gnu.so b/frogpilot/third_party/h3/_cy/util.cpython-312-aarch64-linux-gnu.so index 4f3eab6e..88b58c96 100644 Binary files a/frogpilot/third_party/h3/_cy/util.cpython-312-aarch64-linux-gnu.so and b/frogpilot/third_party/h3/_cy/util.cpython-312-aarch64-linux-gnu.so differ diff --git a/frogpilot/third_party/h3/_cy/util.pxd b/frogpilot/third_party/h3/_cy/util.pxd deleted file mode 100644 index 4d7d962c..00000000 --- a/frogpilot/third_party/h3/_cy/util.pxd +++ /dev/null @@ -1,13 +0,0 @@ -from .h3lib cimport H3int, H3str, LatLng - -cdef LatLng deg2coord(double lat, double lng) nogil -cdef (double, double) coord2deg(LatLng c) nogil - -cpdef H3int str_to_int(H3str h) except? 0 -cpdef H3str int_to_str(H3int x) - -cdef check_cell(H3int h) -cdef check_edge(H3int e) -cdef check_res(int res) -cdef check_vertex(H3int v) -cdef check_distance(int k) diff --git a/frogpilot/third_party/h3/_cy/util.pyx b/frogpilot/third_party/h3/_cy/util.pyx deleted file mode 100644 index 7b8a9f20..00000000 --- a/frogpilot/third_party/h3/_cy/util.pyx +++ /dev/null @@ -1,89 +0,0 @@ -from .h3lib cimport H3int, H3str, isValidCell, isValidDirectedEdge, isValidVertex - -cimport h3lib - -from .error_system import ( - H3ResDomainError, - H3DomainError, - H3DirEdgeInvalidError, - H3CellInvalidError, - H3VertexInvalidError -) - -cdef h3lib.LatLng deg2coord(double lat, double lng) nogil: - cdef: - h3lib.LatLng c - - c.lat = h3lib.degsToRads(lat) - c.lng = h3lib.degsToRads(lng) - - return c - - -cdef (double, double) coord2deg(h3lib.LatLng c) nogil: - return ( - h3lib.radsToDegs(c.lat), - h3lib.radsToDegs(c.lng) - ) - - -cpdef basestring c_version(): - v = ( - h3lib.H3_VERSION_MAJOR, - h3lib.H3_VERSION_MINOR, - h3lib.H3_VERSION_PATCH, - ) - - return '{}.{}.{}'.format(*v) - - -cpdef H3int str_to_int(H3str h) except? 0: - return int(h, 16) - - -cpdef H3str int_to_str(H3int x): - """ Convert H3 integer to hex string representation - - Need to be careful in Python 2 because `hex(x)` may return a string - with a trailing `L` character (denoting a "large" integer). - The formatting approach below avoids this. - - Also need to be careful about unicode/str differences. - """ - return '{:x}'.format(x) - - -cdef check_cell(H3int h): - """ Check if valid H3 "cell" (hexagon or pentagon). - - Does not check if a valid H3 edge, for example. - - Since this function is used by multiple interfaces (int or str), - we want the error message to be informative to the user - in either case. - - We use the builtin `hex` function instead of `int_to_str` to - prepend `0x` to indicate that this **integer** representation - is incorrect, but in a format that is easily compared to - `str` inputs. - """ - if isValidCell(h) == 0: - raise H3CellInvalidError('Integer is not a valid H3 cell: {}'.format(hex(h))) - -cdef check_edge(H3int e): - if isValidDirectedEdge(e) == 0: - raise H3DirEdgeInvalidError('Integer is not a valid H3 edge: {}'.format(hex(e))) - -cdef check_vertex(H3int v): - if isValidVertex(v) == 0: - raise H3VertexInvalidError('Integer is not a valid H3 vertex: {}'.format(hex(v))) - -cdef check_res(int res): - if (res < 0) or (res > 15): - raise H3ResDomainError(res) - -cdef check_distance(int k): - if k < 0: - raise H3DomainError( - 'Grid distances must be nonnegative. Received: {}'.format(k) - ) diff --git a/frogpilot/third_party/h3/_cy/vertex.cpython-312-aarch64-linux-gnu.so b/frogpilot/third_party/h3/_cy/vertex.cpython-312-aarch64-linux-gnu.so index 25556dc1..65514cd2 100644 Binary files a/frogpilot/third_party/h3/_cy/vertex.cpython-312-aarch64-linux-gnu.so and b/frogpilot/third_party/h3/_cy/vertex.cpython-312-aarch64-linux-gnu.so differ diff --git a/frogpilot/third_party/h3/_cy/vertex.pxd b/frogpilot/third_party/h3/_cy/vertex.pxd deleted file mode 100644 index 98d890ce..00000000 --- a/frogpilot/third_party/h3/_cy/vertex.pxd +++ /dev/null @@ -1,6 +0,0 @@ -from .h3lib cimport bool, H3int - -cpdef H3int cell_to_vertex(H3int h, int vertex_num) except 1 -cpdef H3int[:] cell_to_vertexes(H3int h) -cpdef (double, double) vertex_to_latlng(H3int v) except * -cpdef bool is_valid_vertex(H3int v) diff --git a/frogpilot/third_party/h3/_cy/vertex.pyx b/frogpilot/third_party/h3/_cy/vertex.pyx deleted file mode 100644 index 26a674af..00000000 --- a/frogpilot/third_party/h3/_cy/vertex.pyx +++ /dev/null @@ -1,54 +0,0 @@ -cimport h3lib -from h3lib cimport bool, H3int - -from .util cimport ( - check_cell, - check_vertex, - coord2deg -) - -from .error_system cimport check_for_error - -from .memory cimport H3MemoryManager - - -cpdef H3int cell_to_vertex(H3int h, int vertex_num) except 1: - cdef: - H3int out - - check_cell(h) - - check_for_error( - h3lib.cellToVertex(h, vertex_num, &out) - ) - - return out - -cpdef H3int[:] cell_to_vertexes(H3int h): - cdef: - H3int out - - check_cell(h) - - hmm = H3MemoryManager(6) - check_for_error( - h3lib.cellToVertexes(h, hmm.ptr) - ) - mv = hmm.to_mv() - - return mv - -cpdef (double, double) vertex_to_latlng(H3int v) except *: - cdef: - h3lib.LatLng c - - check_vertex(v) - - check_for_error( - h3lib.vertexToLatLng(v, &c) - ) - - return coord2deg(c) - -cpdef bool is_valid_vertex(H3int v): - return h3lib.isValidVertex(v) == 1 diff --git a/frogpilot/third_party/h3/_version.py b/frogpilot/third_party/h3/_version.py index 712565a5..30357c8b 100644 --- a/frogpilot/third_party/h3/_version.py +++ b/frogpilot/third_party/h3/_version.py @@ -1,3 +1 @@ -from importlib import metadata - -__version__ = metadata.version(__package__ or __name__) +__version__ = "4.4.2" diff --git a/frogpilot/third_party/h3/api/basic_int/__init__.py b/frogpilot/third_party/h3/api/basic_int/__init__.py index 09f7deb8..47f1c7ec 100644 --- a/frogpilot/third_party/h3/api/basic_int/__init__.py +++ b/frogpilot/third_party/h3/api/basic_int/__init__.py @@ -1,5 +1,6 @@ # This file is **symlinked** across the APIs to ensure they are exactly the same. from typing import Literal +from array import array from ... import _cy from ..._h3shape import ( @@ -128,6 +129,20 @@ def average_hexagon_edge_length(res, unit='km'): return _cy.average_hexagon_edge_length(res, unit) +def is_valid_index(h): + """Validates *any* H3 index (cell, vertex, or directed edge). + + Returns + ------- + bool + """ + try: + h = _in_scalar(h) + return _cy.is_valid_index(h) + except (ValueError, TypeError): + return False + + def is_valid_cell(h): """ Validates an H3 cell (hexagon or pentagon). @@ -736,10 +751,124 @@ def get_base_cell_number(h): Returns ------- int + + Examples + -------- + >>> h = construct_cell(57, 2, 1, 4) + >>> h + '83728cfffffffff' + >> get_base_cell_number(h) + 57 """ return _cy.get_base_cell_number(_in_scalar(h)) +def get_index_digit(h, res): + """ + Get the index digit of a cell at the given resolution. + + Parameters + ---------- + h : H3Cell + Cell whose index digit will be returned. + res : int + Resolution (``>= 1``) at which to read the digit. + + Returns + ------- + int + The index digit at the requested resolution. + + Examples + -------- + >>> h = construct_cell(7, 2, 1, 4) + >>> h + '830e8cfffffffff' + >>> get_index_digit(h, 1) + 2 + >>> get_index_digit(h, 2) + 1 + >>> get_index_digit(h, 3) + 4 + """ + return _cy.get_index_digit(_in_scalar(h), res) + + +def construct_cell(base_cell_number, *digits, res=None): + """ + Construct cell from base cell and digits. + + Parameters + ---------- + base_cell_number : int + Base cell *number* (``0`` to ``121``). + *digits : int + Sequence of index digits (``0`` to ``6``). + Length of digits will be the resulting resolution of the output cell. + res : int, optional + Resolution of the constructed cell. If provided, it must equal + ``len(digits)``; otherwise it is inferred from the number of digits. + + Returns + ------- + H3Cell + The constructed cell. + + Examples + -------- + >>> construct_cell(7, 2, 1, 4) # resolution 3 cell + '830e8cfffffffff' + + >>> construct_cell(15, 0, 0, 5, 3) # resolution 4 cell + '841e057ffffffff' + + >>> construct_cell(15, 0, 0, 5, 3, res=4) + '841e057ffffffff' + """ + if (res is not None) and (len(digits) != res): + raise ValueError('Resolution must match number of digits.') + + digits = array('i', digits) + o = _cy.construct_cell(base_cell_number, digits) + return _out_scalar(o) + + +def deconstruct_cell(h): + """ + Deconstruct cell into base cell and digits. + + Parameters + ---------- + h : H3Cell + Cell to deconstruct. + + Returns + ------- + list of int + [base_cell_number, digit1, digit2, ..., digitN] + + Examples + -------- + >>> h = construct_cell(7, 2, 1, 4) # resolution 3 cell + >>> h + '830e8cfffffffff' + >>> deconstruct_cell(h) + (7, 2, 1, 4) + + >>> h = construct_cell(15, 0, 0, 5, 3) # resolution 4 cell + >>> h + '841e057ffffffff' + >>> deconstruct_cell(h) + (15, 0, 0, 5, 3) + >>> construct_cell(*deconstruct_cell(h), 0) == cell_to_center_child(h) + """ + res = get_resolution(h) + bc = get_base_cell_number(h) + digits = [get_index_digit(h, r + 1) for r in range(res)] + + return [bc, *digits] + + def are_neighbor_cells(h1, h2): """ Returns ``True`` if ``h1`` and ``h2`` are neighboring cells. diff --git a/frogpilot/third_party/h3/api/basic_str/__init__.py b/frogpilot/third_party/h3/api/basic_str/__init__.py index 09f7deb8..47f1c7ec 100644 --- a/frogpilot/third_party/h3/api/basic_str/__init__.py +++ b/frogpilot/third_party/h3/api/basic_str/__init__.py @@ -1,5 +1,6 @@ # This file is **symlinked** across the APIs to ensure they are exactly the same. from typing import Literal +from array import array from ... import _cy from ..._h3shape import ( @@ -128,6 +129,20 @@ def average_hexagon_edge_length(res, unit='km'): return _cy.average_hexagon_edge_length(res, unit) +def is_valid_index(h): + """Validates *any* H3 index (cell, vertex, or directed edge). + + Returns + ------- + bool + """ + try: + h = _in_scalar(h) + return _cy.is_valid_index(h) + except (ValueError, TypeError): + return False + + def is_valid_cell(h): """ Validates an H3 cell (hexagon or pentagon). @@ -736,10 +751,124 @@ def get_base_cell_number(h): Returns ------- int + + Examples + -------- + >>> h = construct_cell(57, 2, 1, 4) + >>> h + '83728cfffffffff' + >> get_base_cell_number(h) + 57 """ return _cy.get_base_cell_number(_in_scalar(h)) +def get_index_digit(h, res): + """ + Get the index digit of a cell at the given resolution. + + Parameters + ---------- + h : H3Cell + Cell whose index digit will be returned. + res : int + Resolution (``>= 1``) at which to read the digit. + + Returns + ------- + int + The index digit at the requested resolution. + + Examples + -------- + >>> h = construct_cell(7, 2, 1, 4) + >>> h + '830e8cfffffffff' + >>> get_index_digit(h, 1) + 2 + >>> get_index_digit(h, 2) + 1 + >>> get_index_digit(h, 3) + 4 + """ + return _cy.get_index_digit(_in_scalar(h), res) + + +def construct_cell(base_cell_number, *digits, res=None): + """ + Construct cell from base cell and digits. + + Parameters + ---------- + base_cell_number : int + Base cell *number* (``0`` to ``121``). + *digits : int + Sequence of index digits (``0`` to ``6``). + Length of digits will be the resulting resolution of the output cell. + res : int, optional + Resolution of the constructed cell. If provided, it must equal + ``len(digits)``; otherwise it is inferred from the number of digits. + + Returns + ------- + H3Cell + The constructed cell. + + Examples + -------- + >>> construct_cell(7, 2, 1, 4) # resolution 3 cell + '830e8cfffffffff' + + >>> construct_cell(15, 0, 0, 5, 3) # resolution 4 cell + '841e057ffffffff' + + >>> construct_cell(15, 0, 0, 5, 3, res=4) + '841e057ffffffff' + """ + if (res is not None) and (len(digits) != res): + raise ValueError('Resolution must match number of digits.') + + digits = array('i', digits) + o = _cy.construct_cell(base_cell_number, digits) + return _out_scalar(o) + + +def deconstruct_cell(h): + """ + Deconstruct cell into base cell and digits. + + Parameters + ---------- + h : H3Cell + Cell to deconstruct. + + Returns + ------- + list of int + [base_cell_number, digit1, digit2, ..., digitN] + + Examples + -------- + >>> h = construct_cell(7, 2, 1, 4) # resolution 3 cell + >>> h + '830e8cfffffffff' + >>> deconstruct_cell(h) + (7, 2, 1, 4) + + >>> h = construct_cell(15, 0, 0, 5, 3) # resolution 4 cell + >>> h + '841e057ffffffff' + >>> deconstruct_cell(h) + (15, 0, 0, 5, 3) + >>> construct_cell(*deconstruct_cell(h), 0) == cell_to_center_child(h) + """ + res = get_resolution(h) + bc = get_base_cell_number(h) + digits = [get_index_digit(h, r + 1) for r in range(res)] + + return [bc, *digits] + + def are_neighbor_cells(h1, h2): """ Returns ``True`` if ``h1`` and ``h2`` are neighboring cells. diff --git a/frogpilot/third_party/h3/api/memview_int/__init__.py b/frogpilot/third_party/h3/api/memview_int/__init__.py index 09f7deb8..47f1c7ec 100644 --- a/frogpilot/third_party/h3/api/memview_int/__init__.py +++ b/frogpilot/third_party/h3/api/memview_int/__init__.py @@ -1,5 +1,6 @@ # This file is **symlinked** across the APIs to ensure they are exactly the same. from typing import Literal +from array import array from ... import _cy from ..._h3shape import ( @@ -128,6 +129,20 @@ def average_hexagon_edge_length(res, unit='km'): return _cy.average_hexagon_edge_length(res, unit) +def is_valid_index(h): + """Validates *any* H3 index (cell, vertex, or directed edge). + + Returns + ------- + bool + """ + try: + h = _in_scalar(h) + return _cy.is_valid_index(h) + except (ValueError, TypeError): + return False + + def is_valid_cell(h): """ Validates an H3 cell (hexagon or pentagon). @@ -736,10 +751,124 @@ def get_base_cell_number(h): Returns ------- int + + Examples + -------- + >>> h = construct_cell(57, 2, 1, 4) + >>> h + '83728cfffffffff' + >> get_base_cell_number(h) + 57 """ return _cy.get_base_cell_number(_in_scalar(h)) +def get_index_digit(h, res): + """ + Get the index digit of a cell at the given resolution. + + Parameters + ---------- + h : H3Cell + Cell whose index digit will be returned. + res : int + Resolution (``>= 1``) at which to read the digit. + + Returns + ------- + int + The index digit at the requested resolution. + + Examples + -------- + >>> h = construct_cell(7, 2, 1, 4) + >>> h + '830e8cfffffffff' + >>> get_index_digit(h, 1) + 2 + >>> get_index_digit(h, 2) + 1 + >>> get_index_digit(h, 3) + 4 + """ + return _cy.get_index_digit(_in_scalar(h), res) + + +def construct_cell(base_cell_number, *digits, res=None): + """ + Construct cell from base cell and digits. + + Parameters + ---------- + base_cell_number : int + Base cell *number* (``0`` to ``121``). + *digits : int + Sequence of index digits (``0`` to ``6``). + Length of digits will be the resulting resolution of the output cell. + res : int, optional + Resolution of the constructed cell. If provided, it must equal + ``len(digits)``; otherwise it is inferred from the number of digits. + + Returns + ------- + H3Cell + The constructed cell. + + Examples + -------- + >>> construct_cell(7, 2, 1, 4) # resolution 3 cell + '830e8cfffffffff' + + >>> construct_cell(15, 0, 0, 5, 3) # resolution 4 cell + '841e057ffffffff' + + >>> construct_cell(15, 0, 0, 5, 3, res=4) + '841e057ffffffff' + """ + if (res is not None) and (len(digits) != res): + raise ValueError('Resolution must match number of digits.') + + digits = array('i', digits) + o = _cy.construct_cell(base_cell_number, digits) + return _out_scalar(o) + + +def deconstruct_cell(h): + """ + Deconstruct cell into base cell and digits. + + Parameters + ---------- + h : H3Cell + Cell to deconstruct. + + Returns + ------- + list of int + [base_cell_number, digit1, digit2, ..., digitN] + + Examples + -------- + >>> h = construct_cell(7, 2, 1, 4) # resolution 3 cell + >>> h + '830e8cfffffffff' + >>> deconstruct_cell(h) + (7, 2, 1, 4) + + >>> h = construct_cell(15, 0, 0, 5, 3) # resolution 4 cell + >>> h + '841e057ffffffff' + >>> deconstruct_cell(h) + (15, 0, 0, 5, 3) + >>> construct_cell(*deconstruct_cell(h), 0) == cell_to_center_child(h) + """ + res = get_resolution(h) + bc = get_base_cell_number(h) + digits = [get_index_digit(h, r + 1) for r in range(res)] + + return [bc, *digits] + + def are_neighbor_cells(h1, h2): """ Returns ``True`` if ``h1`` and ``h2`` are neighboring cells. diff --git a/frogpilot/third_party/h3/api/numpy_int/__init__.py b/frogpilot/third_party/h3/api/numpy_int/__init__.py index 09f7deb8..47f1c7ec 100644 --- a/frogpilot/third_party/h3/api/numpy_int/__init__.py +++ b/frogpilot/third_party/h3/api/numpy_int/__init__.py @@ -1,5 +1,6 @@ # This file is **symlinked** across the APIs to ensure they are exactly the same. from typing import Literal +from array import array from ... import _cy from ..._h3shape import ( @@ -128,6 +129,20 @@ def average_hexagon_edge_length(res, unit='km'): return _cy.average_hexagon_edge_length(res, unit) +def is_valid_index(h): + """Validates *any* H3 index (cell, vertex, or directed edge). + + Returns + ------- + bool + """ + try: + h = _in_scalar(h) + return _cy.is_valid_index(h) + except (ValueError, TypeError): + return False + + def is_valid_cell(h): """ Validates an H3 cell (hexagon or pentagon). @@ -736,10 +751,124 @@ def get_base_cell_number(h): Returns ------- int + + Examples + -------- + >>> h = construct_cell(57, 2, 1, 4) + >>> h + '83728cfffffffff' + >> get_base_cell_number(h) + 57 """ return _cy.get_base_cell_number(_in_scalar(h)) +def get_index_digit(h, res): + """ + Get the index digit of a cell at the given resolution. + + Parameters + ---------- + h : H3Cell + Cell whose index digit will be returned. + res : int + Resolution (``>= 1``) at which to read the digit. + + Returns + ------- + int + The index digit at the requested resolution. + + Examples + -------- + >>> h = construct_cell(7, 2, 1, 4) + >>> h + '830e8cfffffffff' + >>> get_index_digit(h, 1) + 2 + >>> get_index_digit(h, 2) + 1 + >>> get_index_digit(h, 3) + 4 + """ + return _cy.get_index_digit(_in_scalar(h), res) + + +def construct_cell(base_cell_number, *digits, res=None): + """ + Construct cell from base cell and digits. + + Parameters + ---------- + base_cell_number : int + Base cell *number* (``0`` to ``121``). + *digits : int + Sequence of index digits (``0`` to ``6``). + Length of digits will be the resulting resolution of the output cell. + res : int, optional + Resolution of the constructed cell. If provided, it must equal + ``len(digits)``; otherwise it is inferred from the number of digits. + + Returns + ------- + H3Cell + The constructed cell. + + Examples + -------- + >>> construct_cell(7, 2, 1, 4) # resolution 3 cell + '830e8cfffffffff' + + >>> construct_cell(15, 0, 0, 5, 3) # resolution 4 cell + '841e057ffffffff' + + >>> construct_cell(15, 0, 0, 5, 3, res=4) + '841e057ffffffff' + """ + if (res is not None) and (len(digits) != res): + raise ValueError('Resolution must match number of digits.') + + digits = array('i', digits) + o = _cy.construct_cell(base_cell_number, digits) + return _out_scalar(o) + + +def deconstruct_cell(h): + """ + Deconstruct cell into base cell and digits. + + Parameters + ---------- + h : H3Cell + Cell to deconstruct. + + Returns + ------- + list of int + [base_cell_number, digit1, digit2, ..., digitN] + + Examples + -------- + >>> h = construct_cell(7, 2, 1, 4) # resolution 3 cell + >>> h + '830e8cfffffffff' + >>> deconstruct_cell(h) + (7, 2, 1, 4) + + >>> h = construct_cell(15, 0, 0, 5, 3) # resolution 4 cell + >>> h + '841e057ffffffff' + >>> deconstruct_cell(h) + (15, 0, 0, 5, 3) + >>> construct_cell(*deconstruct_cell(h), 0) == cell_to_center_child(h) + """ + res = get_resolution(h) + bc = get_base_cell_number(h) + digits = [get_index_digit(h, r + 1) for r in range(res)] + + return [bc, *digits] + + def are_neighbor_cells(h1, h2): """ Returns ``True`` if ``h1`` and ``h2`` are neighboring cells. diff --git a/frogpilot/third_party/influxdb_client/__init__.py b/frogpilot/third_party/influxdb_client/__init__.py deleted file mode 100644 index a1009511..00000000 --- a/frogpilot/third_party/influxdb_client/__init__.py +++ /dev/null @@ -1,396 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -# import apis into sdk package -from influxdb_client.service.authorizations_service import AuthorizationsService -from influxdb_client.service.backup_service import BackupService -from influxdb_client.service.bucket_schemas_service import BucketSchemasService -from influxdb_client.service.buckets_service import BucketsService -from influxdb_client.service.cells_service import CellsService -from influxdb_client.service.checks_service import ChecksService -from influxdb_client.service.config_service import ConfigService -from influxdb_client.service.dbr_ps_service import DBRPsService -from influxdb_client.service.dashboards_service import DashboardsService -from influxdb_client.service.delete_service import DeleteService -from influxdb_client.service.health_service import HealthService -from influxdb_client.service.invokable_scripts_service import InvokableScriptsService -from influxdb_client.service.labels_service import LabelsService -from influxdb_client.service.legacy_authorizations_service import LegacyAuthorizationsService -from influxdb_client.service.metrics_service import MetricsService -from influxdb_client.service.notification_endpoints_service import NotificationEndpointsService -from influxdb_client.service.notification_rules_service import NotificationRulesService -from influxdb_client.service.organizations_service import OrganizationsService -from influxdb_client.service.ping_service import PingService -from influxdb_client.service.query_service import QueryService -from influxdb_client.service.ready_service import ReadyService -from influxdb_client.service.remote_connections_service import RemoteConnectionsService -from influxdb_client.service.replications_service import ReplicationsService -from influxdb_client.service.resources_service import ResourcesService -from influxdb_client.service.restore_service import RestoreService -from influxdb_client.service.routes_service import RoutesService -from influxdb_client.service.rules_service import RulesService -from influxdb_client.service.scraper_targets_service import ScraperTargetsService -from influxdb_client.service.secrets_service import SecretsService -from influxdb_client.service.setup_service import SetupService -from influxdb_client.service.signin_service import SigninService -from influxdb_client.service.signout_service import SignoutService -from influxdb_client.service.sources_service import SourcesService -from influxdb_client.service.tasks_service import TasksService -from influxdb_client.service.telegraf_plugins_service import TelegrafPluginsService -from influxdb_client.service.telegrafs_service import TelegrafsService -from influxdb_client.service.templates_service import TemplatesService -from influxdb_client.service.users_service import UsersService -from influxdb_client.service.variables_service import VariablesService -from influxdb_client.service.views_service import ViewsService -from influxdb_client.service.write_service import WriteService - -from influxdb_client.configuration import Configuration -# import models into sdk package -from influxdb_client.domain.ast_response import ASTResponse -from influxdb_client.domain.add_resource_member_request_body import AddResourceMemberRequestBody -from influxdb_client.domain.analyze_query_response import AnalyzeQueryResponse -from influxdb_client.domain.analyze_query_response_errors import AnalyzeQueryResponseErrors -from influxdb_client.domain.array_expression import ArrayExpression -from influxdb_client.domain.authorization import Authorization -from influxdb_client.domain.authorization_post_request import AuthorizationPostRequest -from influxdb_client.domain.authorization_update_request import AuthorizationUpdateRequest -from influxdb_client.domain.authorizations import Authorizations -from influxdb_client.domain.axes import Axes -from influxdb_client.domain.axis import Axis -from influxdb_client.domain.axis_scale import AxisScale -from influxdb_client.domain.bad_statement import BadStatement -from influxdb_client.domain.band_view_properties import BandViewProperties -from influxdb_client.domain.binary_expression import BinaryExpression -from influxdb_client.domain.block import Block -from influxdb_client.domain.boolean_literal import BooleanLiteral -from influxdb_client.domain.bucket import Bucket -from influxdb_client.domain.bucket_links import BucketLinks -from influxdb_client.domain.bucket_metadata_manifest import BucketMetadataManifest -from influxdb_client.domain.bucket_retention_rules import BucketRetentionRules -from influxdb_client.domain.bucket_shard_mapping import BucketShardMapping -from influxdb_client.domain.buckets import Buckets -from influxdb_client.domain.builder_aggregate_function_type import BuilderAggregateFunctionType -from influxdb_client.domain.builder_config import BuilderConfig -from influxdb_client.domain.builder_config_aggregate_window import BuilderConfigAggregateWindow -from influxdb_client.domain.builder_functions_type import BuilderFunctionsType -from influxdb_client.domain.builder_tags_type import BuilderTagsType -from influxdb_client.domain.builtin_statement import BuiltinStatement -from influxdb_client.domain.call_expression import CallExpression -from influxdb_client.domain.cell import Cell -from influxdb_client.domain.cell_links import CellLinks -from influxdb_client.domain.cell_update import CellUpdate -from influxdb_client.domain.cell_with_view_properties import CellWithViewProperties -from influxdb_client.domain.check import Check -from influxdb_client.domain.check_base import CheckBase -from influxdb_client.domain.check_base_links import CheckBaseLinks -from influxdb_client.domain.check_discriminator import CheckDiscriminator -from influxdb_client.domain.check_patch import CheckPatch -from influxdb_client.domain.check_status_level import CheckStatusLevel -from influxdb_client.domain.check_view_properties import CheckViewProperties -from influxdb_client.domain.checks import Checks -from influxdb_client.domain.column_data_type import ColumnDataType -from influxdb_client.domain.column_semantic_type import ColumnSemanticType -from influxdb_client.domain.conditional_expression import ConditionalExpression -from influxdb_client.domain.config import Config -from influxdb_client.domain.constant_variable_properties import ConstantVariableProperties -from influxdb_client.domain.create_cell import CreateCell -from influxdb_client.domain.create_dashboard_request import CreateDashboardRequest -from influxdb_client.domain.custom_check import CustomCheck -from influxdb_client.domain.dbrp import DBRP -from influxdb_client.domain.dbrp_create import DBRPCreate -from influxdb_client.domain.dbrp_get import DBRPGet -from influxdb_client.domain.dbrp_update import DBRPUpdate -from influxdb_client.domain.dbr_ps import DBRPs -from influxdb_client.domain.dashboard import Dashboard -from influxdb_client.domain.dashboard_color import DashboardColor -from influxdb_client.domain.dashboard_query import DashboardQuery -from influxdb_client.domain.dashboard_with_view_properties import DashboardWithViewProperties -from influxdb_client.domain.dashboards import Dashboards -from influxdb_client.domain.date_time_literal import DateTimeLiteral -from influxdb_client.domain.deadman_check import DeadmanCheck -from influxdb_client.domain.decimal_places import DecimalPlaces -from influxdb_client.domain.delete_predicate_request import DeletePredicateRequest -from influxdb_client.domain.dialect import Dialect -from influxdb_client.domain.dict_expression import DictExpression -from influxdb_client.domain.dict_item import DictItem -from influxdb_client.domain.duration import Duration -from influxdb_client.domain.duration_literal import DurationLiteral -from influxdb_client.domain.error import Error -from influxdb_client.domain.expression import Expression -from influxdb_client.domain.expression_statement import ExpressionStatement -from influxdb_client.domain.field import Field -from influxdb_client.domain.file import File -from influxdb_client.domain.float_literal import FloatLiteral -from influxdb_client.domain.flux_response import FluxResponse -from influxdb_client.domain.flux_suggestion import FluxSuggestion -from influxdb_client.domain.flux_suggestions import FluxSuggestions -from influxdb_client.domain.function_expression import FunctionExpression -from influxdb_client.domain.gauge_view_properties import GaugeViewProperties -from influxdb_client.domain.greater_threshold import GreaterThreshold -from influxdb_client.domain.http_notification_endpoint import HTTPNotificationEndpoint -from influxdb_client.domain.http_notification_rule import HTTPNotificationRule -from influxdb_client.domain.http_notification_rule_base import HTTPNotificationRuleBase -from influxdb_client.domain.health_check import HealthCheck -from influxdb_client.domain.heatmap_view_properties import HeatmapViewProperties -from influxdb_client.domain.histogram_view_properties import HistogramViewProperties -from influxdb_client.domain.identifier import Identifier -from influxdb_client.domain.import_declaration import ImportDeclaration -from influxdb_client.domain.index_expression import IndexExpression -from influxdb_client.domain.integer_literal import IntegerLiteral -from influxdb_client.domain.is_onboarding import IsOnboarding -from influxdb_client.domain.label import Label -from influxdb_client.domain.label_create_request import LabelCreateRequest -from influxdb_client.domain.label_mapping import LabelMapping -from influxdb_client.domain.label_response import LabelResponse -from influxdb_client.domain.label_update import LabelUpdate -from influxdb_client.domain.labels_response import LabelsResponse -from influxdb_client.domain.language_request import LanguageRequest -from influxdb_client.domain.legacy_authorization_post_request import LegacyAuthorizationPostRequest -from influxdb_client.domain.lesser_threshold import LesserThreshold -from influxdb_client.domain.line_plus_single_stat_properties import LinePlusSingleStatProperties -from influxdb_client.domain.line_protocol_error import LineProtocolError -from influxdb_client.domain.line_protocol_length_error import LineProtocolLengthError -from influxdb_client.domain.links import Links -from influxdb_client.domain.list_stacks_response import ListStacksResponse -from influxdb_client.domain.log_event import LogEvent -from influxdb_client.domain.logical_expression import LogicalExpression -from influxdb_client.domain.logs import Logs -from influxdb_client.domain.map_variable_properties import MapVariableProperties -from influxdb_client.domain.markdown_view_properties import MarkdownViewProperties -from influxdb_client.domain.measurement_schema import MeasurementSchema -from influxdb_client.domain.measurement_schema_column import MeasurementSchemaColumn -from influxdb_client.domain.measurement_schema_create_request import MeasurementSchemaCreateRequest -from influxdb_client.domain.measurement_schema_list import MeasurementSchemaList -from influxdb_client.domain.measurement_schema_update_request import MeasurementSchemaUpdateRequest -from influxdb_client.domain.member_assignment import MemberAssignment -from influxdb_client.domain.member_expression import MemberExpression -from influxdb_client.domain.metadata_backup import MetadataBackup -from influxdb_client.domain.model_property import ModelProperty -from influxdb_client.domain.mosaic_view_properties import MosaicViewProperties -from influxdb_client.domain.node import Node -from influxdb_client.domain.notification_endpoint import NotificationEndpoint -from influxdb_client.domain.notification_endpoint_base import NotificationEndpointBase -from influxdb_client.domain.notification_endpoint_base_links import NotificationEndpointBaseLinks -from influxdb_client.domain.notification_endpoint_discriminator import NotificationEndpointDiscriminator -from influxdb_client.domain.notification_endpoint_type import NotificationEndpointType -from influxdb_client.domain.notification_endpoint_update import NotificationEndpointUpdate -from influxdb_client.domain.notification_endpoints import NotificationEndpoints -from influxdb_client.domain.notification_rule import NotificationRule -from influxdb_client.domain.notification_rule_base import NotificationRuleBase -from influxdb_client.domain.notification_rule_base_links import NotificationRuleBaseLinks -from influxdb_client.domain.notification_rule_discriminator import NotificationRuleDiscriminator -from influxdb_client.domain.notification_rule_update import NotificationRuleUpdate -from influxdb_client.domain.notification_rules import NotificationRules -from influxdb_client.domain.object_expression import ObjectExpression -from influxdb_client.domain.onboarding_request import OnboardingRequest -from influxdb_client.domain.onboarding_response import OnboardingResponse -from influxdb_client.domain.option_statement import OptionStatement -from influxdb_client.domain.organization import Organization -from influxdb_client.domain.organization_links import OrganizationLinks -from influxdb_client.domain.organizations import Organizations -from influxdb_client.domain.package import Package -from influxdb_client.domain.package_clause import PackageClause -from influxdb_client.domain.pager_duty_notification_endpoint import PagerDutyNotificationEndpoint -from influxdb_client.domain.pager_duty_notification_rule import PagerDutyNotificationRule -from influxdb_client.domain.pager_duty_notification_rule_base import PagerDutyNotificationRuleBase -from influxdb_client.domain.paren_expression import ParenExpression -from influxdb_client.domain.password_reset_body import PasswordResetBody -from influxdb_client.domain.patch_bucket_request import PatchBucketRequest -from influxdb_client.domain.patch_dashboard_request import PatchDashboardRequest -from influxdb_client.domain.patch_organization_request import PatchOrganizationRequest -from influxdb_client.domain.patch_retention_rule import PatchRetentionRule -from influxdb_client.domain.patch_stack_request import PatchStackRequest -from influxdb_client.domain.patch_stack_request_additional_resources import PatchStackRequestAdditionalResources -from influxdb_client.domain.permission import Permission -from influxdb_client.domain.permission_resource import PermissionResource -from influxdb_client.domain.pipe_expression import PipeExpression -from influxdb_client.domain.pipe_literal import PipeLiteral -from influxdb_client.domain.post_bucket_request import PostBucketRequest -from influxdb_client.domain.post_check import PostCheck -from influxdb_client.domain.post_notification_endpoint import PostNotificationEndpoint -from influxdb_client.domain.post_notification_rule import PostNotificationRule -from influxdb_client.domain.post_organization_request import PostOrganizationRequest -from influxdb_client.domain.post_restore_kv_response import PostRestoreKVResponse -from influxdb_client.domain.post_stack_request import PostStackRequest -from influxdb_client.domain.property_key import PropertyKey -from influxdb_client.domain.query import Query -from influxdb_client.domain.query_edit_mode import QueryEditMode -from influxdb_client.domain.query_variable_properties import QueryVariableProperties -from influxdb_client.domain.query_variable_properties_values import QueryVariablePropertiesValues -from influxdb_client.domain.range_threshold import RangeThreshold -from influxdb_client.domain.ready import Ready -from influxdb_client.domain.regexp_literal import RegexpLiteral -from influxdb_client.domain.remote_connection import RemoteConnection -from influxdb_client.domain.remote_connection_creation_request import RemoteConnectionCreationRequest -from influxdb_client.domain.remote_connection_update_request import RemoteConnectionUpdateRequest -from influxdb_client.domain.remote_connections import RemoteConnections -from influxdb_client.domain.renamable_field import RenamableField -from influxdb_client.domain.replication import Replication -from influxdb_client.domain.replication_creation_request import ReplicationCreationRequest -from influxdb_client.domain.replication_update_request import ReplicationUpdateRequest -from influxdb_client.domain.replications import Replications -from influxdb_client.domain.resource_member import ResourceMember -from influxdb_client.domain.resource_members import ResourceMembers -from influxdb_client.domain.resource_members_links import ResourceMembersLinks -from influxdb_client.domain.resource_owner import ResourceOwner -from influxdb_client.domain.resource_owners import ResourceOwners -from influxdb_client.domain.restored_bucket_mappings import RestoredBucketMappings -from influxdb_client.domain.retention_policy_manifest import RetentionPolicyManifest -from influxdb_client.domain.return_statement import ReturnStatement -from influxdb_client.domain.routes import Routes -from influxdb_client.domain.routes_external import RoutesExternal -from influxdb_client.domain.routes_query import RoutesQuery -from influxdb_client.domain.routes_system import RoutesSystem -from influxdb_client.domain.rule_status_level import RuleStatusLevel -from influxdb_client.domain.run import Run -from influxdb_client.domain.run_links import RunLinks -from influxdb_client.domain.run_manually import RunManually -from influxdb_client.domain.runs import Runs -from influxdb_client.domain.smtp_notification_rule import SMTPNotificationRule -from influxdb_client.domain.smtp_notification_rule_base import SMTPNotificationRuleBase -from influxdb_client.domain.scatter_view_properties import ScatterViewProperties -from influxdb_client.domain.schema_type import SchemaType -from influxdb_client.domain.scraper_target_request import ScraperTargetRequest -from influxdb_client.domain.scraper_target_response import ScraperTargetResponse -from influxdb_client.domain.scraper_target_responses import ScraperTargetResponses -from influxdb_client.domain.script import Script -from influxdb_client.domain.script_create_request import ScriptCreateRequest -from influxdb_client.domain.script_invocation_params import ScriptInvocationParams -from influxdb_client.domain.script_language import ScriptLanguage -from influxdb_client.domain.script_update_request import ScriptUpdateRequest -from influxdb_client.domain.scripts import Scripts -from influxdb_client.domain.secret_keys import SecretKeys -from influxdb_client.domain.secret_keys_response import SecretKeysResponse -from influxdb_client.domain.shard_group_manifest import ShardGroupManifest -from influxdb_client.domain.shard_manifest import ShardManifest -from influxdb_client.domain.shard_owner import ShardOwner -from influxdb_client.domain.simple_table_view_properties import SimpleTableViewProperties -from influxdb_client.domain.single_stat_view_properties import SingleStatViewProperties -from influxdb_client.domain.slack_notification_endpoint import SlackNotificationEndpoint -from influxdb_client.domain.slack_notification_rule import SlackNotificationRule -from influxdb_client.domain.slack_notification_rule_base import SlackNotificationRuleBase -from influxdb_client.domain.source import Source -from influxdb_client.domain.source_links import SourceLinks -from influxdb_client.domain.sources import Sources -from influxdb_client.domain.stack import Stack -from influxdb_client.domain.stack_associations import StackAssociations -from influxdb_client.domain.stack_events import StackEvents -from influxdb_client.domain.stack_links import StackLinks -from influxdb_client.domain.stack_resources import StackResources -from influxdb_client.domain.statement import Statement -from influxdb_client.domain.static_legend import StaticLegend -from influxdb_client.domain.status_rule import StatusRule -from influxdb_client.domain.string_literal import StringLiteral -from influxdb_client.domain.subscription_manifest import SubscriptionManifest -from influxdb_client.domain.table_view_properties import TableViewProperties -from influxdb_client.domain.table_view_properties_table_options import TableViewPropertiesTableOptions -from influxdb_client.domain.tag_rule import TagRule -from influxdb_client.domain.task import Task -from influxdb_client.domain.task_create_request import TaskCreateRequest -from influxdb_client.domain.task_links import TaskLinks -from influxdb_client.domain.task_status_type import TaskStatusType -from influxdb_client.domain.task_update_request import TaskUpdateRequest -from influxdb_client.domain.tasks import Tasks -from influxdb_client.domain.telegraf import Telegraf -from influxdb_client.domain.telegraf_plugin import TelegrafPlugin -from influxdb_client.domain.telegraf_plugin_request import TelegrafPluginRequest -from influxdb_client.domain.telegraf_plugin_request_plugins import TelegrafPluginRequestPlugins -from influxdb_client.domain.telegraf_plugins import TelegrafPlugins -from influxdb_client.domain.telegraf_request import TelegrafRequest -from influxdb_client.domain.telegraf_request_metadata import TelegrafRequestMetadata -from influxdb_client.domain.telegrafs import Telegrafs -from influxdb_client.domain.telegram_notification_endpoint import TelegramNotificationEndpoint -from influxdb_client.domain.telegram_notification_rule import TelegramNotificationRule -from influxdb_client.domain.telegram_notification_rule_base import TelegramNotificationRuleBase -from influxdb_client.domain.template_apply import TemplateApply -from influxdb_client.domain.template_apply_remotes import TemplateApplyRemotes -from influxdb_client.domain.template_apply_template import TemplateApplyTemplate -from influxdb_client.domain.template_chart import TemplateChart -from influxdb_client.domain.template_export_by_id import TemplateExportByID -from influxdb_client.domain.template_export_by_id_org_ids import TemplateExportByIDOrgIDs -from influxdb_client.domain.template_export_by_id_resource_filters import TemplateExportByIDResourceFilters -from influxdb_client.domain.template_export_by_id_resources import TemplateExportByIDResources -from influxdb_client.domain.template_kind import TemplateKind -from influxdb_client.domain.template_summary import TemplateSummary -from influxdb_client.domain.template_summary_diff import TemplateSummaryDiff -from influxdb_client.domain.template_summary_diff_buckets import TemplateSummaryDiffBuckets -from influxdb_client.domain.template_summary_diff_buckets_new_old import TemplateSummaryDiffBucketsNewOld -from influxdb_client.domain.template_summary_diff_checks import TemplateSummaryDiffChecks -from influxdb_client.domain.template_summary_diff_dashboards import TemplateSummaryDiffDashboards -from influxdb_client.domain.template_summary_diff_dashboards_new_old import TemplateSummaryDiffDashboardsNewOld -from influxdb_client.domain.template_summary_diff_label_mappings import TemplateSummaryDiffLabelMappings -from influxdb_client.domain.template_summary_diff_labels import TemplateSummaryDiffLabels -from influxdb_client.domain.template_summary_diff_labels_new_old import TemplateSummaryDiffLabelsNewOld -from influxdb_client.domain.template_summary_diff_notification_endpoints import TemplateSummaryDiffNotificationEndpoints -from influxdb_client.domain.template_summary_diff_notification_rules import TemplateSummaryDiffNotificationRules -from influxdb_client.domain.template_summary_diff_notification_rules_new_old import TemplateSummaryDiffNotificationRulesNewOld -from influxdb_client.domain.template_summary_diff_tasks import TemplateSummaryDiffTasks -from influxdb_client.domain.template_summary_diff_tasks_new_old import TemplateSummaryDiffTasksNewOld -from influxdb_client.domain.template_summary_diff_telegraf_configs import TemplateSummaryDiffTelegrafConfigs -from influxdb_client.domain.template_summary_diff_variables import TemplateSummaryDiffVariables -from influxdb_client.domain.template_summary_diff_variables_new_old import TemplateSummaryDiffVariablesNewOld -from influxdb_client.domain.template_summary_errors import TemplateSummaryErrors -from influxdb_client.domain.template_summary_label import TemplateSummaryLabel -from influxdb_client.domain.template_summary_label_properties import TemplateSummaryLabelProperties -from influxdb_client.domain.template_summary_summary import TemplateSummarySummary -from influxdb_client.domain.template_summary_summary_buckets import TemplateSummarySummaryBuckets -from influxdb_client.domain.template_summary_summary_dashboards import TemplateSummarySummaryDashboards -from influxdb_client.domain.template_summary_summary_label_mappings import TemplateSummarySummaryLabelMappings -from influxdb_client.domain.template_summary_summary_notification_rules import TemplateSummarySummaryNotificationRules -from influxdb_client.domain.template_summary_summary_status_rules import TemplateSummarySummaryStatusRules -from influxdb_client.domain.template_summary_summary_tag_rules import TemplateSummarySummaryTagRules -from influxdb_client.domain.template_summary_summary_tasks import TemplateSummarySummaryTasks -from influxdb_client.domain.template_summary_summary_variables import TemplateSummarySummaryVariables -from influxdb_client.domain.test_statement import TestStatement -from influxdb_client.domain.threshold import Threshold -from influxdb_client.domain.threshold_base import ThresholdBase -from influxdb_client.domain.threshold_check import ThresholdCheck -from influxdb_client.domain.unary_expression import UnaryExpression -from influxdb_client.domain.unsigned_integer_literal import UnsignedIntegerLiteral -from influxdb_client.domain.user import User -from influxdb_client.domain.user_response import UserResponse -from influxdb_client.domain.user_response_links import UserResponseLinks -from influxdb_client.domain.users import Users -from influxdb_client.domain.variable import Variable -from influxdb_client.domain.variable_assignment import VariableAssignment -from influxdb_client.domain.variable_links import VariableLinks -from influxdb_client.domain.variable_properties import VariableProperties -from influxdb_client.domain.variables import Variables -from influxdb_client.domain.view import View -from influxdb_client.domain.view_links import ViewLinks -from influxdb_client.domain.view_properties import ViewProperties -from influxdb_client.domain.views import Views -from influxdb_client.domain.write_precision import WritePrecision -from influxdb_client.domain.xy_geom import XYGeom -from influxdb_client.domain.xy_view_properties import XYViewProperties - -from influxdb_client.client.authorizations_api import AuthorizationsApi -from influxdb_client.client.bucket_api import BucketsApi -from influxdb_client.client.delete_api import DeleteApi -from influxdb_client.client.invokable_scripts_api import InvokableScriptsApi -from influxdb_client.client.labels_api import LabelsApi -from influxdb_client.client.organizations_api import OrganizationsApi -from influxdb_client.client.query_api import QueryApi -from influxdb_client.client.tasks_api import TasksApi -from influxdb_client.client.users_api import UsersApi -from influxdb_client.client.write_api import WriteApi, WriteOptions -from influxdb_client.client.influxdb_client import InfluxDBClient -from influxdb_client.client.logging_handler import InfluxLoggingHandler -from influxdb_client.client.write.point import Point - -from influxdb_client.version import VERSION - -__version__ = VERSION diff --git a/frogpilot/third_party/influxdb_client/_async/__init__.py b/frogpilot/third_party/influxdb_client/_async/__init__.py deleted file mode 100644 index 743539c5..00000000 --- a/frogpilot/third_party/influxdb_client/_async/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Asynchronous REST APIs.""" diff --git a/frogpilot/third_party/influxdb_client/_async/api_client.py b/frogpilot/third_party/influxdb_client/_async/api_client.py deleted file mode 100644 index 3a396a10..00000000 --- a/frogpilot/third_party/influxdb_client/_async/api_client.py +++ /dev/null @@ -1,663 +0,0 @@ -# coding: utf-8 -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - -from __future__ import absolute_import - -import datetime -import json -import mimetypes -import os -import re -import tempfile -from multiprocessing.pool import ThreadPool -from urllib.parse import quote - -import influxdb_client.domain -from influxdb_client import SigninService -from influxdb_client import SignoutService -from influxdb_client._async import rest -from influxdb_client.configuration import Configuration -from influxdb_client.rest import _requires_create_user_session, _requires_expire_user_session - - -class ApiClientAsync(object): - """Generic API client for OpenAPI client library Build. - - OpenAPI generic API client. This client handles the client- - server communication, and is invariant across implementations. Specifics of - the methods and models for each application are generated from the OpenAPI - templates. - - NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - Do not edit the class manually. - - :param configuration: .Configuration object for this client - :param header_name: a header to pass when making calls to the API. - :param header_value: a header value to pass when making calls to - the API. - :param cookie: a cookie to include in the header when making calls - to the API - :param pool_threads: The number of threads to use for async requests - to the API. More threads means more concurrent API requests. - """ - - PRIMITIVE_TYPES = (float, bool, bytes, str, int) - NATIVE_TYPES_MAPPING = { - 'int': int, - 'long': int, - 'float': float, - 'str': str, - 'bool': bool, - 'date': datetime.date, - 'datetime': datetime.datetime, - 'object': object, - } - _pool = None - - def __init__(self, configuration=None, header_name=None, header_value=None, - cookie=None, pool_threads=None, **kwargs): - """Initialize generic API client.""" - if configuration is None: - configuration = Configuration() - self.configuration = configuration - self.pool_threads = pool_threads - - self.rest_client = rest.RESTClientObjectAsync(configuration, **kwargs) - self.default_headers = {} - if header_name is not None: - self.default_headers[header_name] = header_value - self.cookie = cookie - # Set default User-Agent. - from influxdb_client import VERSION - self.user_agent = f'influxdb-client-python/{VERSION}' - - async def close(self): - """Dispose api client.""" - await self._signout() - await self.rest_client.close() - """Dispose pools.""" - if self._pool: - self._pool.close() - self._pool.join() - self._pool = None - - @property - def pool(self): - """Create thread pool on first request avoids instantiating unused threadpool for blocking clients.""" - if self._pool is None: - self._pool = ThreadPool(self.pool_threads) - return self._pool - - @property - def user_agent(self): - """User agent for this API client.""" - return self.default_headers['User-Agent'] - - @user_agent.setter - def user_agent(self, value): - """Set User agent for this API client.""" - self.default_headers['User-Agent'] = value - - def set_default_header(self, header_name, header_value): - """Set HTTP header for this API client.""" - self.default_headers[header_name] = header_value - - async def __call_api( - self, resource_path, method, path_params=None, - query_params=None, header_params=None, body=None, post_params=None, - files=None, response_type=None, auth_settings=None, - _return_http_data_only=None, collection_formats=None, - _preload_content=True, _request_timeout=None, urlopen_kw=None): - - config = self.configuration - await self._signin(resource_path=resource_path) - - # header parameters - header_params = header_params or {} - config.update_request_header_params(resource_path, header_params) - header_params.update(self.default_headers) - if self.cookie: - header_params['Cookie'] = self.cookie - if header_params: - header_params = self.sanitize_for_serialization(header_params) - header_params = dict(self.parameters_to_tuples(header_params, - collection_formats)) - - # path parameters - if path_params: - path_params = self.sanitize_for_serialization(path_params) - path_params = self.parameters_to_tuples(path_params, - collection_formats) - for k, v in path_params: - # specified safe chars, encode everything - resource_path = resource_path.replace( - '{%s}' % k, - quote(str(v), safe=config.safe_chars_for_path_param) - ) - - # query parameters - if query_params: - query_params = self.sanitize_for_serialization(query_params) - query_params = self.parameters_to_tuples(query_params, - collection_formats) - - # post parameters - if post_params or files: - post_params = self.prepare_post_parameters(post_params, files) - post_params = self.sanitize_for_serialization(post_params) - post_params = self.parameters_to_tuples(post_params, - collection_formats) - - # auth setting - self.update_params_for_auth(header_params, query_params, auth_settings) - - # body - if body: - body = self.sanitize_for_serialization(body) - body = config.update_request_body(resource_path, body) - - # request url - url = self.configuration.host + resource_path - - urlopen_kw = urlopen_kw or {} - - # perform request and return response - response_data = await self.request( - method, url, query_params=query_params, headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout, **urlopen_kw) - - self.last_response = response_data - - return_data = response_data - if _preload_content: - # deserialize response data - if response_type: - return_data = self.deserialize(response_data, response_type) - else: - return_data = None - - if _return_http_data_only is not False: - return return_data - else: - return (return_data, response_data.status, - response_data.getheaders()) - - def sanitize_for_serialization(self, obj): - """Build a JSON POST object. - - If obj is None, return None. - If obj is str, int, long, float, bool, return directly. - If obj is datetime.datetime, datetime.date - convert to string in iso8601 format. - If obj is list, sanitize each element in the list. - If obj is dict, return the dict. - If obj is OpenAPI model, return the properties dict. - - :param obj: The data to serialize. - :return: The serialized form of data. - """ - if obj is None: - return None - elif isinstance(obj, self.PRIMITIVE_TYPES): - return obj - elif isinstance(obj, list): - return [self.sanitize_for_serialization(sub_obj) - for sub_obj in obj] - elif isinstance(obj, tuple): - return tuple(self.sanitize_for_serialization(sub_obj) - for sub_obj in obj) - elif isinstance(obj, (datetime.datetime, datetime.date)): - return obj.isoformat() - - if isinstance(obj, dict): - obj_dict = obj - else: - # Convert model obj to dict except - # attributes `openapi_types`, `attribute_map` - # and attributes which value is not None. - # Convert attribute name to json key in - # model definition for request. - obj_dict = {obj.attribute_map[attr]: getattr(obj, attr) - for attr, _ in obj.openapi_types.items() - if getattr(obj, attr) is not None} - - return {key: self.sanitize_for_serialization(val) - for key, val in obj_dict.items()} - - def deserialize(self, response, response_type): - """Deserializes response into an object. - - :param response: RESTResponse object to be deserialized. - :param response_type: class literal for - deserialized object, or string of class name. - - :return: deserialized object. - """ - # handle file downloading - # save response body into a tmp file and return the instance - if response_type == "file": - return self.__deserialize_file(response) - - # fetch data from response object - try: - data = json.loads(response.data) - except ValueError: - data = response.data - - return self.__deserialize(data, response_type) - - def __deserialize(self, data, klass): - """Deserializes dict, list, str into an object. - - :param data: dict, list or str. - :param klass: class literal, or string of class name. - - :return: object. - """ - if data is None: - return None - - if type(klass) == str: - if klass.startswith('list['): - sub_kls = re.match(r'list\[(.*)\]', klass).group(1) - return [self.__deserialize(sub_data, sub_kls) - for sub_data in data] - - if klass.startswith('dict('): - sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2) - return {k: self.__deserialize(v, sub_kls) - for k, v in data.items()} - - # convert str to class - if klass in self.NATIVE_TYPES_MAPPING: - klass = self.NATIVE_TYPES_MAPPING[klass] - else: - klass = getattr(influxdb_client.domain, klass) - - if klass in self.PRIMITIVE_TYPES: - return self.__deserialize_primitive(data, klass) - elif klass == object: - return self.__deserialize_object(data) - elif klass == datetime.date: - return self.__deserialize_date(data) - elif klass == datetime.datetime: - return self.__deserialize_datatime(data) - else: - return self.__deserialize_model(data, klass) - - def call_api(self, resource_path, method, - path_params=None, query_params=None, header_params=None, - body=None, post_params=None, files=None, - response_type=None, auth_settings=None, async_req=None, - _return_http_data_only=None, collection_formats=None, - _preload_content=True, _request_timeout=None, urlopen_kw=None): - """Make the HTTP request (synchronous) and Return deserialized data. - - To make an async_req request, set the async_req parameter. - - :param resource_path: Path to method endpoint. - :param method: Method to call. - :param path_params: Path parameters in the url. - :param query_params: Query parameters in the url. - :param header_params: Header parameters to be - placed in the request header. - :param body: Request body. - :param post_params dict: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param auth_settings list: Auth Settings names for the request. - :param response: Response data type. - :param files dict: key -> filename, value -> filepath, - for `multipart/form-data`. - :param async_req bool: execute request asynchronously - :param _return_http_data_only: response data without head status code - and headers - :param collection_formats: dict of collection formats for path, query, - header, and post parameters. - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param urlopen_kw: Additional parameters are passed to - :meth:`urllib3.request.RequestMethods.request` - :return: - If async_req parameter is True, - the request will be called asynchronously. - The method will return the request thread. - If parameter async_req is False or missing, - then the method will return the response directly. - """ - if not async_req: - return self.__call_api(resource_path, method, - path_params, query_params, header_params, - body, post_params, files, - response_type, auth_settings, - _return_http_data_only, collection_formats, - _preload_content, _request_timeout, urlopen_kw) - else: - thread = self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, query_params, - header_params, body, - post_params, files, - response_type, auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, _request_timeout, urlopen_kw)) - return thread - - def request(self, method, url, query_params=None, headers=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None, **urlopen_kw): - """Make the HTTP request using RESTClient.""" - if method == "GET": - return self.rest_client.GET(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers, - **urlopen_kw) - elif method == "HEAD": - return self.rest_client.HEAD(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers, - **urlopen_kw) - elif method == "OPTIONS": - return self.rest_client.OPTIONS(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - **urlopen_kw) - elif method == "POST": - return self.rest_client.POST(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - **urlopen_kw) - elif method == "PUT": - return self.rest_client.PUT(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - **urlopen_kw) - elif method == "PATCH": - return self.rest_client.PATCH(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - **urlopen_kw) - elif method == "DELETE": - return self.rest_client.DELETE(url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - **urlopen_kw) - else: - raise ValueError( - "http method must be `GET`, `HEAD`, `OPTIONS`," - " `POST`, `PATCH`, `PUT` or `DELETE`." - ) - - def parameters_to_tuples(self, params, collection_formats): - """Get parameters as list of tuples, formatting collections. - - :param params: Parameters as dict or list of two-tuples - :param dict collection_formats: Parameter collection formats - :return: Parameters as list of tuples, collections formatted - """ - new_params = [] - if collection_formats is None: - collection_formats = {} - for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 - if k in collection_formats: - collection_format = collection_formats[k] - if collection_format == 'multi': - new_params.extend((k, value) for value in v) - else: - if collection_format == 'ssv': - delimiter = ' ' - elif collection_format == 'tsv': - delimiter = '\t' - elif collection_format == 'pipes': - delimiter = '|' - else: # csv is the default - delimiter = ',' - new_params.append( - (k, delimiter.join(str(value) for value in v))) - else: - new_params.append((k, v)) - return new_params - - def prepare_post_parameters(self, post_params=None, files=None): - """Build form parameters. - - :param post_params: Normal form parameters. - :param files: File parameters. - :return: Form parameters with files. - """ - params = [] - - if post_params: - params = post_params - - if files: - for k, v in files.items(): - if not v: - continue - file_names = v if type(v) is list else [v] - for n in file_names: - with open(n, 'rb') as f: - filename = os.path.basename(f.name) - filedata = f.read() - mimetype = (mimetypes.guess_type(filename)[0] or - 'application/octet-stream') - params.append( - tuple([k, tuple([filename, filedata, mimetype])])) - - return params - - def select_header_accept(self, accepts): - """Return `Accept` based on an array of accepts provided. - - :param accepts: List of headers. - :return: Accept (e.g. application/json). - """ - if not accepts: - return - - accepts = [x.lower() for x in accepts] - - if 'application/json' in accepts: - return 'application/json' - else: - return ', '.join(accepts) - - def select_header_content_type(self, content_types): - """Return `Content-Type` based on an array of content_types provided. - - :param content_types: List of content-types. - :return: Content-Type (e.g. application/json). - """ - if not content_types: - return 'application/json' - - content_types = [x.lower() for x in content_types] - - if 'application/json' in content_types or '*/*' in content_types: - return 'application/json' - else: - return content_types[0] - - def update_params_for_auth(self, headers, querys, auth_settings): - """Update header and query params based on authentication setting. - - :param headers: Header parameters dict to be updated. - :param querys: Query parameters tuple list to be updated. - :param auth_settings: Authentication setting identifiers list. - """ - if not auth_settings: - return - - for auth in auth_settings: - auth_setting = self.configuration.auth_settings().get(auth) - if auth_setting: - if not auth_setting['value']: - continue - elif auth_setting['in'] == 'header': - headers[auth_setting['key']] = auth_setting['value'] - elif auth_setting['in'] == 'query': - querys.append((auth_setting['key'], auth_setting['value'])) - else: - raise ValueError( - 'Authentication token must be in `query` or `header`' - ) - - def __deserialize_file(self, response): - """Deserializes body to file. - - Saves response body into a file in a temporary folder, - using the filename from the `Content-Disposition` header if provided. - - :param response: RESTResponse. - :return: file path. - """ - fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) - os.close(fd) - os.remove(path) - - content_disposition = response.getheader("Content-Disposition") - if content_disposition: - filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', - content_disposition).group(1) - path = os.path.join(os.path.dirname(path), filename) - - with open(path, "wb") as f: - f.write(response.data) - - return path - - def __deserialize_primitive(self, data, klass): - """Deserializes string to primitive type. - - :param data: str. - :param klass: class literal. - - :return: int, long, float, str, bool. - """ - try: - return klass(data) - except UnicodeEncodeError: - return str(data) - except TypeError: - return data - - def __deserialize_object(self, value): - """Return an original value. - - :return: object. - """ - return value - - def __deserialize_date(self, string): - """Deserializes string to date. - - :param string: str. - :return: date. - """ - try: - from dateutil.parser import parse - return parse(string).date() - except ImportError: - return string - except ValueError: - raise rest.ApiException( - status=0, - reason="Failed to parse `{0}` as date object".format(string) - ) - - def __deserialize_datatime(self, string): - """Deserializes string to datetime. - - The string should be in iso8601 datetime format. - - :param string: str. - :return: datetime. - """ - try: - from dateutil.parser import parse - return parse(string) - except ImportError: - return string - except ValueError: - raise rest.ApiException( - status=0, - reason=( - "Failed to parse `{0}` as datetime object" - .format(string) - ) - ) - - def __deserialize_model(self, data, klass): - """Deserializes list or dict to model. - - :param data: dict, list. - :param klass: class literal. - :return: model object. - """ - if not klass.openapi_types and not hasattr(klass, - 'get_real_child_model'): - return data - - kwargs = {} - if klass.openapi_types is not None: - for attr, attr_type in klass.openapi_types.items(): - if (data is not None and - klass.attribute_map[attr] in data and - isinstance(data, (list, dict))): - value = data[klass.attribute_map[attr]] - kwargs[attr] = self.__deserialize(value, attr_type) - - instance = klass(**kwargs) - - if hasattr(instance, 'get_real_child_model'): - klass_name = instance.get_real_child_model(data) - if klass_name: - instance = self.__deserialize(data, klass_name) - return instance - - async def _signin(self, resource_path: str): - if _requires_create_user_session(self.configuration, self.cookie, resource_path): - http_info = await SigninService(self).post_signin_async(_return_http_data_only=False) - self.cookie = http_info[2]['set-cookie'] - - async def _signout(self): - if _requires_expire_user_session(self.configuration, self.cookie): - await SignoutService(self).post_signout_async() - self.cookie = None diff --git a/frogpilot/third_party/influxdb_client/_async/rest.py b/frogpilot/third_party/influxdb_client/_async/rest.py deleted file mode 100644 index 53c555c9..00000000 --- a/frogpilot/third_party/influxdb_client/_async/rest.py +++ /dev/null @@ -1,309 +0,0 @@ -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import io -import json -import re -import ssl -from urllib.parse import urlencode - -import aiohttp - -from influxdb_client.rest import ApiException -from influxdb_client.rest import _BaseRESTClient -from influxdb_client.rest import _UTF_8_encoding - - -async def _on_request_start(session, trace_config_ctx, params): - _BaseRESTClient.log_request(params.method, params.url) - _BaseRESTClient.log_headers(params.headers, '>>>') - - -async def _on_request_chunk_sent(session, context, params): - if params.chunk: - _BaseRESTClient.log_body(params.chunk, '>>>') - - -async def _on_request_end(session, trace_config_ctx, params): - _BaseRESTClient.log_response(params.response.status) - _BaseRESTClient.log_headers(params.headers, '<<<') - - response_content = params.response.content - data = bytearray() - while True: - chunk = await response_content.read(100) - if not chunk: - break - data += chunk - if data: - _BaseRESTClient.log_body(data.decode(_UTF_8_encoding), '<<<') - response_content.unread_data(data=data) - - -class RESTResponseAsync(io.IOBase): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - Do not edit the class manually. - """ - - def __init__(self, resp, data): - """Initialize with HTTP response.""" - self.aiohttp_response = resp - self.status = resp.status - self.reason = resp.reason - self.data = data - - def getheaders(self): - """Return a CIMultiDictProxy of the response headers.""" - return self.aiohttp_response.headers - - def getheader(self, name, default=None): - """Return a given response header.""" - return self.aiohttp_response.headers.get(name, default) - - -class RESTClientObjectAsync(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - Do not edit the class manually. - """ - - def __init__(self, configuration, pools_size=4, maxsize=None, **kwargs): - """Initialize REST client.""" - # maxsize is number of requests to host that are allowed in parallel - if maxsize is None: - maxsize = configuration.connection_pool_maxsize - - if configuration.ssl_context is None: - ssl_context = ssl.create_default_context(cafile=configuration.ssl_ca_cert) - if configuration.cert_file: - ssl_context.load_cert_chain( - certfile=configuration.cert_file, keyfile=configuration.cert_key_file, - password=configuration.cert_key_password - ) - - if not configuration.verify_ssl: - ssl_context.check_hostname = False - ssl_context.verify_mode = ssl.CERT_NONE - else: - ssl_context = configuration.ssl_context - - connector = aiohttp.TCPConnector( - limit=maxsize, - ssl=ssl_context - ) - - self.proxy = configuration.proxy - self.proxy_headers = configuration.proxy_headers - self.allow_redirects = kwargs.get('allow_redirects', True) - self.max_redirects = kwargs.get('max_redirects', 10) - - # configure tracing - trace_config = aiohttp.TraceConfig() - trace_config.on_request_start.append(_on_request_start) - trace_config.on_request_chunk_sent.append(_on_request_chunk_sent) - trace_config.on_request_end.append(_on_request_end) - - # timeout - if isinstance(configuration.timeout, (int, float,)): # noqa: E501,F821 - timeout = aiohttp.ClientTimeout(total=configuration.timeout / 1_000) - elif isinstance(configuration.timeout, aiohttp.ClientTimeout): - timeout = configuration.timeout - else: - timeout = aiohttp.client.DEFAULT_TIMEOUT - - # https pool manager - _client_session_type = kwargs.get('client_session_type', aiohttp.ClientSession) - _client_session_kwargs = kwargs.get('client_session_kwargs', {}) - self.pool_manager = _client_session_type( - connector=connector, - timeout=timeout, - trace_configs=[trace_config] if configuration.debug else None, - **_client_session_kwargs - ) - - async def close(self): - """Dispose connection pool manager.""" - await self.pool_manager.close() - - async def request(self, method, url, query_params=None, headers=None, - body=None, post_params=None, _preload_content=True, - _request_timeout=None): - """Execute request. - - :param method: http request method - :param url: http request url - :param query_params: query parameters in the url - :param headers: http request headers - :param body: request json body, for `application/json` - :param post_params: request post parameters, - `application/x-www-form-urlencoded` - and `multipart/form-data` - :param _preload_content: this is a non-applicable field for - the AiohttpClient. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - """ - method = method.upper() - assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', - 'PATCH', 'OPTIONS'] - - if post_params and body: - raise ValueError( - "body parameter cannot be used with post_params parameter." - ) - - post_params = post_params or {} - headers = headers or {} - - if 'Content-Type' not in headers: - headers['Content-Type'] = 'application/json' - - args = { - "method": method, - "url": url, - "headers": headers, - "allow_redirects": self.allow_redirects, - "max_redirects": self.max_redirects - } - - if self.proxy: - args["proxy"] = self.proxy - if self.proxy_headers: - args["proxy_headers"] = self.proxy_headers - - if query_params: - args["url"] += '?' + urlencode(query_params) - - # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` - if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: - if re.search('json', headers['Content-Type'], re.IGNORECASE): - if body is not None: - body = json.dumps(body) - args["data"] = body - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 - args["data"] = aiohttp.FormData(post_params) - elif headers['Content-Type'] == 'multipart/form-data': - # must del headers['Content-Type'], or the correct - # Content-Type which generated by aiohttp - del headers['Content-Type'] - data = aiohttp.FormData() - for param in post_params: - k, v = param - if isinstance(v, tuple) and len(v) == 3: - data.add_field(k, - value=v[1], - filename=v[0], - content_type=v[2]) - else: - data.add_field(k, v) - args["data"] = data - - # Pass a `bytes` parameter directly in the body to support - # other content types than Json when `body` argument is provided - # in serialized form - elif isinstance(body, bytes): - args["data"] = body - else: - # Cannot generate the request from given parameters - msg = """Cannot prepare a request message for provided - arguments. Please check that your arguments match - declared content type.""" - raise ApiException(status=0, reason=msg) - - r = await self.pool_manager.request(**args) - if _preload_content: - - data = await r.read() - r = RESTResponseAsync(r, data) - - if not 200 <= r.status <= 299: - raise ApiException(http_resp=r) - - return r - - async def GET(self, url, headers=None, query_params=None, - _preload_content=True, _request_timeout=None): - """Perform GET HTTP request.""" - return (await self.request("GET", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params)) - - async def HEAD(self, url, headers=None, query_params=None, - _preload_content=True, _request_timeout=None): - """Perform HEAD HTTP request.""" - return (await self.request("HEAD", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params)) - - async def OPTIONS(self, url, headers=None, query_params=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - """Perform OPTIONS HTTP request.""" - return (await self.request("OPTIONS", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body)) - - async def DELETE(self, url, headers=None, query_params=None, body=None, - _preload_content=True, _request_timeout=None): - """Perform DELETE HTTP request.""" - return (await self.request("DELETE", url, - headers=headers, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body)) - - async def POST(self, url, headers=None, query_params=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - """Perform POST HTTP request.""" - return (await self.request("POST", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body)) - - async def PUT(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - """Perform PUT HTTP request.""" - return (await self.request("PUT", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body)) - - async def PATCH(self, url, headers=None, query_params=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - """Perform PATCH HTTP request.""" - return (await self.request("PATCH", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body)) diff --git a/frogpilot/third_party/influxdb_client/_sync/__init__.py b/frogpilot/third_party/influxdb_client/_sync/__init__.py deleted file mode 100644 index 476e193a..00000000 --- a/frogpilot/third_party/influxdb_client/_sync/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Synchronous REST APIs.""" diff --git a/frogpilot/third_party/influxdb_client/_sync/api_client.py b/frogpilot/third_party/influxdb_client/_sync/api_client.py deleted file mode 100644 index f61ef26c..00000000 --- a/frogpilot/third_party/influxdb_client/_sync/api_client.py +++ /dev/null @@ -1,663 +0,0 @@ -# coding: utf-8 -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - -from __future__ import absolute_import - -import datetime -import json -import mimetypes -import os -import re -import tempfile -from multiprocessing.pool import ThreadPool -from urllib.parse import quote - -import influxdb_client.domain -from influxdb_client import SigninService -from influxdb_client import SignoutService -from influxdb_client._sync import rest -from influxdb_client.configuration import Configuration -from influxdb_client.rest import _requires_create_user_session, _requires_expire_user_session - - -class ApiClient(object): - """Generic API client for OpenAPI client library Build. - - OpenAPI generic API client. This client handles the client- - server communication, and is invariant across implementations. Specifics of - the methods and models for each application are generated from the OpenAPI - templates. - - NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - Do not edit the class manually. - - :param configuration: .Configuration object for this client - :param header_name: a header to pass when making calls to the API. - :param header_value: a header value to pass when making calls to - the API. - :param cookie: a cookie to include in the header when making calls - to the API - :param pool_threads: The number of threads to use for async requests - to the API. More threads means more concurrent API requests. - """ - - PRIMITIVE_TYPES = (float, bool, bytes, str, int) - NATIVE_TYPES_MAPPING = { - 'int': int, - 'long': int, - 'float': float, - 'str': str, - 'bool': bool, - 'date': datetime.date, - 'datetime': datetime.datetime, - 'object': object, - } - _pool = None - - def __init__(self, configuration=None, header_name=None, header_value=None, - cookie=None, pool_threads=None, retries=False): - """Initialize generic API client.""" - if configuration is None: - configuration = Configuration() - self.configuration = configuration - self.pool_threads = pool_threads - - self.rest_client = rest.RESTClientObject(configuration, retries=retries) - self.default_headers = {} - if header_name is not None: - self.default_headers[header_name] = header_value - self.cookie = cookie - # Set default User-Agent. - from influxdb_client import VERSION - self.user_agent = f'influxdb-client-python/{VERSION}' - - def __del__(self): - """Dispose pools.""" - self._signout() - if self._pool: - self._pool.close() - self._pool.join() - self._pool = None - if self.rest_client and self.rest_client.pool_manager and hasattr(self.rest_client.pool_manager, 'clear'): - self.rest_client.pool_manager.clear() - - @property - def pool(self): - """Create thread pool on first request avoids instantiating unused threadpool for blocking clients.""" - if self._pool is None: - self._pool = ThreadPool(self.pool_threads) - return self._pool - - @property - def user_agent(self): - """User agent for this API client.""" - return self.default_headers['User-Agent'] - - @user_agent.setter - def user_agent(self, value): - """Set User agent for this API client.""" - self.default_headers['User-Agent'] = value - - def set_default_header(self, header_name, header_value): - """Set HTTP header for this API client.""" - self.default_headers[header_name] = header_value - - def __call_api( - self, resource_path, method, path_params=None, - query_params=None, header_params=None, body=None, post_params=None, - files=None, response_type=None, auth_settings=None, - _return_http_data_only=None, collection_formats=None, - _preload_content=True, _request_timeout=None, urlopen_kw=None): - - config = self.configuration - self._signin(resource_path=resource_path) - - # header parameters - header_params = header_params or {} - config.update_request_header_params(resource_path, header_params) - header_params.update(self.default_headers) - if self.cookie: - header_params['Cookie'] = self.cookie - if header_params: - header_params = self.sanitize_for_serialization(header_params) - header_params = dict(self.parameters_to_tuples(header_params, - collection_formats)) - - # path parameters - if path_params: - path_params = self.sanitize_for_serialization(path_params) - path_params = self.parameters_to_tuples(path_params, - collection_formats) - for k, v in path_params: - # specified safe chars, encode everything - resource_path = resource_path.replace( - '{%s}' % k, - quote(str(v), safe=config.safe_chars_for_path_param) - ) - - # query parameters - if query_params: - query_params = self.sanitize_for_serialization(query_params) - query_params = self.parameters_to_tuples(query_params, - collection_formats) - - # post parameters - if post_params or files: - post_params = self.prepare_post_parameters(post_params, files) - post_params = self.sanitize_for_serialization(post_params) - post_params = self.parameters_to_tuples(post_params, - collection_formats) - - # auth setting - self.update_params_for_auth(header_params, query_params, auth_settings) - - # body - if body: - body = self.sanitize_for_serialization(body) - body = config.update_request_body(resource_path, body) - - # request url - url = self.configuration.host + resource_path - - urlopen_kw = urlopen_kw or {} - - # perform request and return response - response_data = self.request( - method, url, query_params=query_params, headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout, **urlopen_kw) - - self.last_response = response_data - - return_data = response_data - if _preload_content: - # deserialize response data - if response_type: - return_data = self.deserialize(response_data, response_type) - else: - return_data = None - - if _return_http_data_only: - return (return_data) - else: - return (return_data, response_data.status, - response_data.getheaders()) - - def sanitize_for_serialization(self, obj): - """Build a JSON POST object. - - If obj is None, return None. - If obj is str, int, long, float, bool, return directly. - If obj is datetime.datetime, datetime.date - convert to string in iso8601 format. - If obj is list, sanitize each element in the list. - If obj is dict, return the dict. - If obj is OpenAPI model, return the properties dict. - - :param obj: The data to serialize. - :return: The serialized form of data. - """ - if obj is None: - return None - elif isinstance(obj, self.PRIMITIVE_TYPES): - return obj - elif isinstance(obj, list): - return [self.sanitize_for_serialization(sub_obj) - for sub_obj in obj] - elif isinstance(obj, tuple): - return tuple(self.sanitize_for_serialization(sub_obj) - for sub_obj in obj) - elif isinstance(obj, (datetime.datetime, datetime.date)): - return obj.isoformat() - - if isinstance(obj, dict): - obj_dict = obj - else: - # Convert model obj to dict except - # attributes `openapi_types`, `attribute_map` - # and attributes which value is not None. - # Convert attribute name to json key in - # model definition for request. - obj_dict = {obj.attribute_map[attr]: getattr(obj, attr) - for attr, _ in obj.openapi_types.items() - if getattr(obj, attr) is not None} - - return {key: self.sanitize_for_serialization(val) - for key, val in obj_dict.items()} - - def deserialize(self, response, response_type): - """Deserializes response into an object. - - :param response: RESTResponse object to be deserialized. - :param response_type: class literal for - deserialized object, or string of class name. - - :return: deserialized object. - """ - # handle file downloading - # save response body into a tmp file and return the instance - if response_type == "file": - return self.__deserialize_file(response) - - # fetch data from response object - try: - data = json.loads(response.data) - except ValueError: - data = response.data - - return self.__deserialize(data, response_type) - - def __deserialize(self, data, klass): - """Deserializes dict, list, str into an object. - - :param data: dict, list or str. - :param klass: class literal, or string of class name. - - :return: object. - """ - if data is None: - return None - - if type(klass) == str: - if klass.startswith('list['): - sub_kls = re.match(r'list\[(.*)\]', klass).group(1) - return [self.__deserialize(sub_data, sub_kls) - for sub_data in data] - - if klass.startswith('dict('): - sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2) - return {k: self.__deserialize(v, sub_kls) - for k, v in data.items()} - - # convert str to class - if klass in self.NATIVE_TYPES_MAPPING: - klass = self.NATIVE_TYPES_MAPPING[klass] - else: - klass = getattr(influxdb_client.domain, klass) - - if klass in self.PRIMITIVE_TYPES: - return self.__deserialize_primitive(data, klass) - elif klass == object: - return self.__deserialize_object(data) - elif klass == datetime.date: - return self.__deserialize_date(data) - elif klass == datetime.datetime: - return self.__deserialize_datatime(data) - else: - return self.__deserialize_model(data, klass) - - def call_api(self, resource_path, method, - path_params=None, query_params=None, header_params=None, - body=None, post_params=None, files=None, - response_type=None, auth_settings=None, async_req=None, - _return_http_data_only=None, collection_formats=None, - _preload_content=True, _request_timeout=None, urlopen_kw=None): - """Make the HTTP request (synchronous) and Return deserialized data. - - To make an async_req request, set the async_req parameter. - - :param resource_path: Path to method endpoint. - :param method: Method to call. - :param path_params: Path parameters in the url. - :param query_params: Query parameters in the url. - :param header_params: Header parameters to be - placed in the request header. - :param body: Request body. - :param post_params dict: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param auth_settings list: Auth Settings names for the request. - :param response: Response data type. - :param files dict: key -> filename, value -> filepath, - for `multipart/form-data`. - :param async_req bool: execute request asynchronously - :param _return_http_data_only: response data without head status code - and headers - :param collection_formats: dict of collection formats for path, query, - header, and post parameters. - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param urlopen_kw: Additional parameters are passed to - :meth:`urllib3.request.RequestMethods.request` - :return: - If async_req parameter is True, - the request will be called asynchronously. - The method will return the request thread. - If parameter async_req is False or missing, - then the method will return the response directly. - """ - if not async_req: - return self.__call_api(resource_path, method, - path_params, query_params, header_params, - body, post_params, files, - response_type, auth_settings, - _return_http_data_only, collection_formats, - _preload_content, _request_timeout, urlopen_kw) - else: - thread = self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, query_params, - header_params, body, - post_params, files, - response_type, auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, _request_timeout, urlopen_kw)) - return thread - - def request(self, method, url, query_params=None, headers=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None, **urlopen_kw): - """Make the HTTP request using RESTClient.""" - if method == "GET": - return self.rest_client.GET(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers, - **urlopen_kw) - elif method == "HEAD": - return self.rest_client.HEAD(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers, - **urlopen_kw) - elif method == "OPTIONS": - return self.rest_client.OPTIONS(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - **urlopen_kw) - elif method == "POST": - return self.rest_client.POST(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - **urlopen_kw) - elif method == "PUT": - return self.rest_client.PUT(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - **urlopen_kw) - elif method == "PATCH": - return self.rest_client.PATCH(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - **urlopen_kw) - elif method == "DELETE": - return self.rest_client.DELETE(url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - **urlopen_kw) - else: - raise ValueError( - "http method must be `GET`, `HEAD`, `OPTIONS`," - " `POST`, `PATCH`, `PUT` or `DELETE`." - ) - - def parameters_to_tuples(self, params, collection_formats): - """Get parameters as list of tuples, formatting collections. - - :param params: Parameters as dict or list of two-tuples - :param dict collection_formats: Parameter collection formats - :return: Parameters as list of tuples, collections formatted - """ - new_params = [] - if collection_formats is None: - collection_formats = {} - for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 - if k in collection_formats: - collection_format = collection_formats[k] - if collection_format == 'multi': - new_params.extend((k, value) for value in v) - else: - if collection_format == 'ssv': - delimiter = ' ' - elif collection_format == 'tsv': - delimiter = '\t' - elif collection_format == 'pipes': - delimiter = '|' - else: # csv is the default - delimiter = ',' - new_params.append( - (k, delimiter.join(str(value) for value in v))) - else: - new_params.append((k, v)) - return new_params - - def prepare_post_parameters(self, post_params=None, files=None): - """Build form parameters. - - :param post_params: Normal form parameters. - :param files: File parameters. - :return: Form parameters with files. - """ - params = [] - - if post_params: - params = post_params - - if files: - for k, v in files.items(): - if not v: - continue - file_names = v if type(v) is list else [v] - for n in file_names: - with open(n, 'rb') as f: - filename = os.path.basename(f.name) - filedata = f.read() - mimetype = (mimetypes.guess_type(filename)[0] or - 'application/octet-stream') - params.append( - tuple([k, tuple([filename, filedata, mimetype])])) - - return params - - def select_header_accept(self, accepts): - """Return `Accept` based on an array of accepts provided. - - :param accepts: List of headers. - :return: Accept (e.g. application/json). - """ - if not accepts: - return - - accepts = [x.lower() for x in accepts] - - if 'application/json' in accepts: - return 'application/json' - else: - return ', '.join(accepts) - - def select_header_content_type(self, content_types): - """Return `Content-Type` based on an array of content_types provided. - - :param content_types: List of content-types. - :return: Content-Type (e.g. application/json). - """ - if not content_types: - return 'application/json' - - content_types = [x.lower() for x in content_types] - - if 'application/json' in content_types or '*/*' in content_types: - return 'application/json' - else: - return content_types[0] - - def update_params_for_auth(self, headers, querys, auth_settings): - """Update header and query params based on authentication setting. - - :param headers: Header parameters dict to be updated. - :param querys: Query parameters tuple list to be updated. - :param auth_settings: Authentication setting identifiers list. - """ - if not auth_settings: - return - - for auth in auth_settings: - auth_setting = self.configuration.auth_settings().get(auth) - if auth_setting: - if not auth_setting['value']: - continue - elif auth_setting['in'] == 'header': - headers[auth_setting['key']] = auth_setting['value'] - elif auth_setting['in'] == 'query': - querys.append((auth_setting['key'], auth_setting['value'])) - else: - raise ValueError( - 'Authentication token must be in `query` or `header`' - ) - - def __deserialize_file(self, response): - """Deserializes body to file. - - Saves response body into a file in a temporary folder, - using the filename from the `Content-Disposition` header if provided. - - :param response: RESTResponse. - :return: file path. - """ - fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) - os.close(fd) - os.remove(path) - - content_disposition = response.getheader("Content-Disposition") - if content_disposition: - filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', - content_disposition).group(1) - path = os.path.join(os.path.dirname(path), filename) - - with open(path, "wb") as f: - f.write(response.data) - - return path - - def __deserialize_primitive(self, data, klass): - """Deserializes string to primitive type. - - :param data: str. - :param klass: class literal. - - :return: int, long, float, str, bool. - """ - try: - return klass(data) - except UnicodeEncodeError: - return str(data) - except TypeError: - return data - - def __deserialize_object(self, value): - """Return an original value. - - :return: object. - """ - return value - - def __deserialize_date(self, string): - """Deserializes string to date. - - :param string: str. - :return: date. - """ - try: - from dateutil.parser import parse - return parse(string).date() - except ImportError: - return string - except ValueError: - raise rest.ApiException( - status=0, - reason="Failed to parse `{0}` as date object".format(string) - ) - - def __deserialize_datatime(self, string): - """Deserializes string to datetime. - - The string should be in iso8601 datetime format. - - :param string: str. - :return: datetime. - """ - try: - from dateutil.parser import parse - return parse(string) - except ImportError: - return string - except ValueError: - raise rest.ApiException( - status=0, - reason=( - "Failed to parse `{0}` as datetime object" - .format(string) - ) - ) - - def __deserialize_model(self, data, klass): - """Deserializes list or dict to model. - - :param data: dict, list. - :param klass: class literal. - :return: model object. - """ - if not klass.openapi_types and not hasattr(klass, - 'get_real_child_model'): - return data - - kwargs = {} - if klass.openapi_types is not None: - for attr, attr_type in klass.openapi_types.items(): - if (data is not None and - klass.attribute_map[attr] in data and - isinstance(data, (list, dict))): - value = data[klass.attribute_map[attr]] - kwargs[attr] = self.__deserialize(value, attr_type) - - instance = klass(**kwargs) - - if hasattr(instance, 'get_real_child_model'): - klass_name = instance.get_real_child_model(data) - if klass_name: - instance = self.__deserialize(data, klass_name) - return instance - - def _signin(self, resource_path: str): - if _requires_create_user_session(self.configuration, self.cookie, resource_path): - http_info = SigninService(self).post_signin_with_http_info() - self.cookie = http_info[2]['set-cookie'] - - def _signout(self): - if _requires_expire_user_session(self.configuration, self.cookie): - SignoutService(self).post_signout() - self.cookie = None diff --git a/frogpilot/third_party/influxdb_client/_sync/rest.py b/frogpilot/third_party/influxdb_client/_sync/rest.py deleted file mode 100644 index eadbf061..00000000 --- a/frogpilot/third_party/influxdb_client/_sync/rest.py +++ /dev/null @@ -1,355 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import io -import json -import re -import ssl -from urllib.parse import urlencode - -from influxdb_client.rest import ApiException -from influxdb_client.rest import _BaseRESTClient - -try: - import urllib3 -except ImportError: - raise ImportError('OpenAPI Python client requires urllib3.') - - -class RESTResponse(io.IOBase): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - Do not edit the class manually. - """ - - def __init__(self, resp): - """Initialize with HTTP response.""" - self.urllib3_response = resp - self.status = resp.status - self.reason = resp.reason - self.data = resp.data - - def getheaders(self): - """Return a dictionary of the response headers.""" - return self.urllib3_response.headers - - def getheader(self, name, default=None): - """Return a given response header.""" - return self.urllib3_response.headers.get(name, default) - - -class RESTClientObject(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - Do not edit the class manually. - """ - - def __init__(self, configuration, pools_size=4, maxsize=None, retries=False): - """Initialize REST client.""" - # urllib3.PoolManager will pass all kw parameters to connectionpool - # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 - # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 - # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 - # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 - - self.configuration = configuration - self.pools_size = pools_size - self.maxsize = maxsize - self.retries = retries - - # cert_reqs - if configuration.verify_ssl: - cert_reqs = ssl.CERT_REQUIRED - else: - cert_reqs = ssl.CERT_NONE - - # ca_certs - if configuration.ssl_ca_cert: - ca_certs = configuration.ssl_ca_cert - else: - ca_certs = None - - addition_pool_args = {} - if configuration.assert_hostname is not None: - addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 - addition_pool_args['retries'] = self.retries - - if maxsize is None: - if configuration.connection_pool_maxsize is not None: - maxsize = configuration.connection_pool_maxsize - else: - maxsize = 4 - - # https pool manager - if configuration.proxy: - self.pool_manager = urllib3.ProxyManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=ca_certs, - cert_file=configuration.cert_file, - key_file=configuration.cert_key_file, - key_password=configuration.cert_key_password, - proxy_url=configuration.proxy, - proxy_headers=configuration.proxy_headers, - ssl_context=configuration.ssl_context, - **addition_pool_args - ) - else: - self.pool_manager = urllib3.PoolManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=ca_certs, - cert_file=configuration.cert_file, - key_file=configuration.cert_key_file, - key_password=configuration.cert_key_password, - ssl_context=configuration.ssl_context, - **addition_pool_args - ) - - def request(self, method, url, query_params=None, headers=None, - body=None, post_params=None, _preload_content=True, - _request_timeout=None, **urlopen_kw): - """Perform requests. - - :param method: http request method - :param url: http request url - :param query_params: query parameters in the url - :param headers: http request headers - :param body: request json body, for `application/json` - :param post_params: request post parameters, - `application/x-www-form-urlencoded` - and `multipart/form-data` - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param urlopen_kw: Additional parameters are passed to - :meth:`urllib3.request.RequestMethods.request` - """ - method = method.upper() - assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', - 'PATCH', 'OPTIONS'] - - if post_params and body: - raise ValueError( - "body parameter cannot be used with post_params parameter." - ) - - post_params = post_params or {} - headers = headers or {} - - timeout = None - _configured_timeout = _request_timeout or self.configuration.timeout - if _configured_timeout: - if isinstance(_configured_timeout, (int, float, )): # noqa: E501,F821 - timeout = urllib3.Timeout(total=_configured_timeout / 1_000) - elif (isinstance(_configured_timeout, tuple) and - len(_configured_timeout) == 2): - timeout = urllib3.Timeout( - connect=_configured_timeout[0] / 1_000, read=_configured_timeout[1] / 1_000) - - if 'Content-Type' not in headers: - headers['Content-Type'] = 'application/json' - - if self.configuration.debug: - _BaseRESTClient.log_request(method, f"{url}{'' if query_params is None else '?' + urlencode(query_params)}") - _BaseRESTClient.log_headers(headers, '>>>') - _BaseRESTClient.log_body(body, '>>>') - - try: - # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` - if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: - if query_params: - url += '?' + urlencode(query_params) - if re.search('json', headers['Content-Type'], re.IGNORECASE): - request_body = None - if body is not None: - request_body = json.dumps(body) - r = self.pool_manager.request( - method, url, - body=request_body, - preload_content=_preload_content, - timeout=timeout, - headers=headers, - **urlopen_kw) - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 - r = self.pool_manager.request( - method, url, - fields=post_params, - encode_multipart=False, - preload_content=_preload_content, - timeout=timeout, - headers=headers, - **urlopen_kw) - elif headers['Content-Type'] == 'multipart/form-data': - # must del headers['Content-Type'], or the correct - # Content-Type which generated by urllib3 will be - # overwritten. - del headers['Content-Type'] - r = self.pool_manager.request( - method, url, - fields=post_params, - encode_multipart=True, - preload_content=_preload_content, - timeout=timeout, - headers=headers, - **urlopen_kw) - # Pass a `string` parameter directly in the body to support - # other content types than Json when `body` argument is - # provided in serialized form - elif isinstance(body, str) or isinstance(body, bytes): - request_body = body - r = self.pool_manager.request( - method, url, - body=request_body, - preload_content=_preload_content, - timeout=timeout, - headers=headers, - **urlopen_kw) - else: - # Cannot generate the request from given parameters - msg = """Cannot prepare a request message for provided - arguments. Please check that your arguments match - declared content type.""" - raise ApiException(status=0, reason=msg) - # For `GET`, `HEAD` - else: - r = self.pool_manager.request(method, url, - fields=query_params, - preload_content=_preload_content, - timeout=timeout, - headers=headers, - **urlopen_kw) - except urllib3.exceptions.SSLError as e: - msg = "{0}\n{1}".format(type(e).__name__, str(e)) - raise ApiException(status=0, reason=msg) - - if _preload_content: - r = RESTResponse(r) - - # In the python 3, the response.data is bytes. - # we need to decode it to string. - r.data = r.data.decode('utf8') - - if self.configuration.debug: - _BaseRESTClient.log_response(r.status) - if hasattr(r, 'headers'): - _BaseRESTClient.log_headers(r.headers, '<<<') - if hasattr(r, 'urllib3_response'): - _BaseRESTClient.log_headers(r.urllib3_response.headers, '<<<') - _BaseRESTClient.log_body(r.data, '<<<') - - if not 200 <= r.status <= 299: - raise ApiException(http_resp=r) - - return r - - def GET(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None, **urlopen_kw): - """Perform GET HTTP request.""" - return self.request("GET", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params, - **urlopen_kw) - - def HEAD(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None, **urlopen_kw): - """Perform HEAD HTTP request.""" - return self.request("HEAD", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params, - **urlopen_kw) - - def OPTIONS(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None, **urlopen_kw): - """Perform OPTIONS HTTP request.""" - return self.request("OPTIONS", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - **urlopen_kw) - - def DELETE(self, url, headers=None, query_params=None, body=None, - _preload_content=True, _request_timeout=None, **urlopen_kw): - """Perform DELETE HTTP request.""" - return self.request("DELETE", url, - headers=headers, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - **urlopen_kw) - - def POST(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None, **urlopen_kw): - """Perform POST HTTP request.""" - return self.request("POST", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - **urlopen_kw) - - def PUT(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None, **urlopen_kw): - """Perform PUT HTTP request.""" - return self.request("PUT", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - **urlopen_kw) - - def PATCH(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None, **urlopen_kw): - """Perform PATCH HTTP request.""" - return self.request("PATCH", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - **urlopen_kw) - - def __getstate__(self): - """Return a dict of attributes that you want to pickle.""" - state = self.__dict__.copy() - # Remove Pool managaer - del state['pool_manager'] - return state - - def __setstate__(self, state): - """Set your object with the provided dict.""" - self.__dict__.update(state) - # Init Pool manager - self.__init__(self.configuration, self.pools_size, self.maxsize, self.retries) diff --git a/frogpilot/third_party/influxdb_client/client/__init__.py b/frogpilot/third_party/influxdb_client/client/__init__.py deleted file mode 100644 index 0d21a438..00000000 --- a/frogpilot/third_party/influxdb_client/client/__init__.py +++ /dev/null @@ -1,56 +0,0 @@ -# flake8: noqa - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -# import apis into api package -from influxdb_client.service.authorizations_service import AuthorizationsService -from influxdb_client.service.backup_service import BackupService -from influxdb_client.service.bucket_schemas_service import BucketSchemasService -from influxdb_client.service.buckets_service import BucketsService -from influxdb_client.service.cells_service import CellsService -from influxdb_client.service.checks_service import ChecksService -from influxdb_client.service.config_service import ConfigService -from influxdb_client.service.dbr_ps_service import DBRPsService -from influxdb_client.service.dashboards_service import DashboardsService -from influxdb_client.service.delete_service import DeleteService -from influxdb_client.service.health_service import HealthService -from influxdb_client.service.invokable_scripts_service import InvokableScriptsService -from influxdb_client.service.labels_service import LabelsService -from influxdb_client.service.legacy_authorizations_service import LegacyAuthorizationsService -from influxdb_client.service.metrics_service import MetricsService -from influxdb_client.service.notification_endpoints_service import NotificationEndpointsService -from influxdb_client.service.notification_rules_service import NotificationRulesService -from influxdb_client.service.organizations_service import OrganizationsService -from influxdb_client.service.ping_service import PingService -from influxdb_client.service.query_service import QueryService -from influxdb_client.service.ready_service import ReadyService -from influxdb_client.service.remote_connections_service import RemoteConnectionsService -from influxdb_client.service.replications_service import ReplicationsService -from influxdb_client.service.resources_service import ResourcesService -from influxdb_client.service.restore_service import RestoreService -from influxdb_client.service.routes_service import RoutesService -from influxdb_client.service.rules_service import RulesService -from influxdb_client.service.scraper_targets_service import ScraperTargetsService -from influxdb_client.service.secrets_service import SecretsService -from influxdb_client.service.setup_service import SetupService -from influxdb_client.service.signin_service import SigninService -from influxdb_client.service.signout_service import SignoutService -from influxdb_client.service.sources_service import SourcesService -from influxdb_client.service.tasks_service import TasksService -from influxdb_client.service.telegraf_plugins_service import TelegrafPluginsService -from influxdb_client.service.telegrafs_service import TelegrafsService -from influxdb_client.service.templates_service import TemplatesService -from influxdb_client.service.users_service import UsersService -from influxdb_client.service.variables_service import VariablesService -from influxdb_client.service.views_service import ViewsService -from influxdb_client.service.write_service import WriteService diff --git a/frogpilot/third_party/influxdb_client/client/_base.py b/frogpilot/third_party/influxdb_client/client/_base.py deleted file mode 100644 index d4f17901..00000000 --- a/frogpilot/third_party/influxdb_client/client/_base.py +++ /dev/null @@ -1,556 +0,0 @@ -"""Commons function for Sync and Async client.""" -from __future__ import absolute_import - -import base64 -import configparser -import logging -import os -from datetime import datetime, timedelta -from typing import List, Generator, Any, Union, Iterable, AsyncGenerator - -from urllib3 import HTTPResponse - -from influxdb_client import Configuration, Dialect, Query, OptionStatement, VariableAssignment, Identifier, \ - Expression, BooleanLiteral, IntegerLiteral, FloatLiteral, DateTimeLiteral, UnaryExpression, DurationLiteral, \ - Duration, StringLiteral, ArrayExpression, ImportDeclaration, MemberExpression, MemberAssignment, File, \ - WriteService, QueryService, DeleteService, DeletePredicateRequest -from influxdb_client.client.flux_csv_parser import FluxResponseMetadataMode, FluxCsvParser, FluxSerializationMode -from influxdb_client.client.flux_table import FluxRecord, TableList, CSVIterator -from influxdb_client.client.util.date_utils import get_date_helper -from influxdb_client.client.util.helpers import get_org_query_param -from influxdb_client.client.warnings import MissingPivotFunction -from influxdb_client.client.write.dataframe_serializer import DataframeSerializer -from influxdb_client.rest import _UTF_8_encoding - -try: - import dataclasses - - _HAS_DATACLASS = True -except ModuleNotFoundError: - _HAS_DATACLASS = False - -LOGGERS_NAMES = [ - 'influxdb_client.client.influxdb_client', - 'influxdb_client.client.influxdb_client_async', - 'influxdb_client.client.write_api', - 'influxdb_client.client.write_api_async', - 'influxdb_client.client.write.retry', - 'influxdb_client.client.write.dataframe_serializer', - 'influxdb_client.client.util.multiprocessing_helper', - 'influxdb_client.client.http', - 'influxdb_client.client.exceptions', -] - - -# noinspection PyMethodMayBeStatic -class _BaseClient(object): - def __init__(self, url, token, debug=None, timeout=10_000, enable_gzip=False, org: str = None, - default_tags: dict = None, http_client_logger: str = None, **kwargs) -> None: - self.url = url - self.token = token - self.org = org - - self.default_tags = default_tags - - self.conf = _Configuration() - if not isinstance(self.url, str): - raise ValueError('"url" attribute is not str instance') - if self.url.endswith("/"): - self.conf.host = self.url[:-1] - else: - self.conf.host = self.url - self.conf.enable_gzip = enable_gzip - self.conf.verify_ssl = kwargs.get('verify_ssl', True) - self.conf.ssl_ca_cert = kwargs.get('ssl_ca_cert', None) - self.conf.cert_file = kwargs.get('cert_file', None) - self.conf.cert_key_file = kwargs.get('cert_key_file', None) - self.conf.cert_key_password = kwargs.get('cert_key_password', None) - self.conf.ssl_context = kwargs.get('ssl_context', None) - self.conf.proxy = kwargs.get('proxy', None) - self.conf.proxy_headers = kwargs.get('proxy_headers', None) - self.conf.connection_pool_maxsize = kwargs.get('connection_pool_maxsize', self.conf.connection_pool_maxsize) - self.conf.timeout = timeout - # logging - self.conf.loggers["http_client_logger"] = logging.getLogger(http_client_logger) - for client_logger in LOGGERS_NAMES: - self.conf.loggers[client_logger] = logging.getLogger(client_logger) - self.conf.debug = debug - - self.conf.username = kwargs.get('username', None) - self.conf.password = kwargs.get('password', None) - # defaults - self.auth_header_name = None - self.auth_header_value = None - # by token - if self.token: - self.auth_header_name = "Authorization" - self.auth_header_value = "Token " + self.token - # by HTTP basic - auth_basic = kwargs.get('auth_basic', False) - if auth_basic: - self.auth_header_name = "Authorization" - self.auth_header_value = "Basic " + base64.b64encode(token.encode()).decode() - # by username, password - if self.conf.username and self.conf.password: - self.auth_header_name = None - self.auth_header_value = None - - self.retries = kwargs.get('retries', False) - - self.profilers = kwargs.get('profilers', None) - pass - - @classmethod - def _from_config_file(cls, config_file: str = "config.ini", debug=None, enable_gzip=False, **kwargs): - config = configparser.ConfigParser() - config_name = kwargs.get('config_name', 'influx2') - is_json = False - try: - config.read(config_file) - except configparser.ParsingError: - with open(config_file) as json_file: - import json - config = json.load(json_file) - is_json = True - - def _config_value(key: str): - value = str(config[key]) if is_json else config[config_name][key] - return value.strip('"') - - def _has_option(key: str): - return key in config if is_json else config.has_option(config_name, key) - - def _has_section(key: str): - return key in config if is_json else config.has_section(key) - - url = _config_value('url') - token = _config_value('token') - - timeout = None - if _has_option('timeout'): - timeout = _config_value('timeout') - - org = None - if _has_option('org'): - org = _config_value('org') - - verify_ssl = True - if _has_option('verify_ssl'): - verify_ssl = _config_value('verify_ssl') - - ssl_ca_cert = None - if _has_option('ssl_ca_cert'): - ssl_ca_cert = _config_value('ssl_ca_cert') - - cert_file = None - if _has_option('cert_file'): - cert_file = _config_value('cert_file') - - cert_key_file = None - if _has_option('cert_key_file'): - cert_key_file = _config_value('cert_key_file') - - cert_key_password = None - if _has_option('cert_key_password'): - cert_key_password = _config_value('cert_key_password') - - connection_pool_maxsize = None - if _has_option('connection_pool_maxsize'): - connection_pool_maxsize = _config_value('connection_pool_maxsize') - - auth_basic = False - if _has_option('auth_basic'): - auth_basic = _config_value('auth_basic') - - default_tags = None - if _has_section('tags'): - if is_json: - default_tags = config['tags'] - else: - tags = {k: v.strip('"') for k, v in config.items('tags')} - default_tags = dict(tags) - - profilers = None - if _has_option('profilers'): - profilers = [x.strip() for x in _config_value('profilers').split(',')] - - proxy = None - if _has_option('proxy'): - proxy = _config_value('proxy') - - return cls(url, token, debug=debug, timeout=_to_int(timeout), org=org, default_tags=default_tags, - enable_gzip=enable_gzip, verify_ssl=_to_bool(verify_ssl), ssl_ca_cert=ssl_ca_cert, - cert_file=cert_file, cert_key_file=cert_key_file, cert_key_password=cert_key_password, - connection_pool_maxsize=_to_int(connection_pool_maxsize), auth_basic=_to_bool(auth_basic), - profilers=profilers, proxy=proxy, **kwargs) - - @classmethod - def _from_env_properties(cls, debug=None, enable_gzip=False, **kwargs): - url = os.getenv('INFLUXDB_V2_URL', "http://localhost:8086") - token = os.getenv('INFLUXDB_V2_TOKEN', "my-token") - timeout = os.getenv('INFLUXDB_V2_TIMEOUT', "10000") - org = os.getenv('INFLUXDB_V2_ORG', "my-org") - verify_ssl = os.getenv('INFLUXDB_V2_VERIFY_SSL', "True") - ssl_ca_cert = os.getenv('INFLUXDB_V2_SSL_CA_CERT', None) - cert_file = os.getenv('INFLUXDB_V2_CERT_FILE', None) - cert_key_file = os.getenv('INFLUXDB_V2_CERT_KEY_FILE', None) - cert_key_password = os.getenv('INFLUXDB_V2_CERT_KEY_PASSWORD', None) - connection_pool_maxsize = os.getenv('INFLUXDB_V2_CONNECTION_POOL_MAXSIZE', None) - auth_basic = os.getenv('INFLUXDB_V2_AUTH_BASIC', "False") - - prof = os.getenv("INFLUXDB_V2_PROFILERS", None) - profilers = None - if prof is not None: - profilers = [x.strip() for x in prof.split(',')] - - default_tags = dict() - - for key, value in os.environ.items(): - if key.startswith("INFLUXDB_V2_TAG_"): - default_tags[key[16:].lower()] = value - - return cls(url, token, debug=debug, timeout=_to_int(timeout), org=org, default_tags=default_tags, - enable_gzip=enable_gzip, verify_ssl=_to_bool(verify_ssl), ssl_ca_cert=ssl_ca_cert, - cert_file=cert_file, cert_key_file=cert_key_file, cert_key_password=cert_key_password, - connection_pool_maxsize=_to_int(connection_pool_maxsize), auth_basic=_to_bool(auth_basic), - profilers=profilers, **kwargs) - - -# noinspection PyMethodMayBeStatic -class _BaseQueryApi(object): - default_dialect = Dialect(header=True, delimiter=",", comment_prefix="#", - annotations=["datatype", "group", "default"], date_time_format="RFC3339") - - def __init__(self, influxdb_client, query_options=None): - from influxdb_client.client.query_api import QueryOptions - self._query_options = QueryOptions() if query_options is None else query_options - self._influxdb_client = influxdb_client - self._query_api = QueryService(influxdb_client.api_client) - - """Base implementation for Queryable API.""" - - def _to_tables(self, response, query_options=None, response_metadata_mode: - FluxResponseMetadataMode = FluxResponseMetadataMode.full) -> TableList: - """ - Parse HTTP response to TableList. - - :param response: HTTP response from an HTTP client. Expected type: `urllib3.response.HTTPResponse`. - """ - _parser = self._to_tables_parser(response, query_options, response_metadata_mode) - list(_parser.generator()) - return _parser.table_list() - - async def _to_tables_async(self, response, query_options=None, response_metadata_mode: - FluxResponseMetadataMode = FluxResponseMetadataMode.full) -> TableList: - """ - Parse HTTP response to TableList. - - :param response: HTTP response from an HTTP client. Expected type: `aiohttp.client_reqrep.ClientResponse`. - """ - async with self._to_tables_parser(response, query_options, response_metadata_mode) as parser: - async for _ in parser.generator_async(): - pass - return parser.table_list() - - def _to_csv(self, response: HTTPResponse) -> CSVIterator: - """Parse HTTP response to CSV.""" - return CSVIterator(response) - - def _to_flux_record_stream(self, response, query_options=None, - response_metadata_mode: FluxResponseMetadataMode = FluxResponseMetadataMode.full) -> \ - Generator[FluxRecord, Any, None]: - """ - Parse HTTP response to FluxRecord stream. - - :param response: HTTP response from an HTTP client. Expected type: `urllib3.response.HTTPResponse`. - """ - _parser = self._to_flux_record_stream_parser(query_options, response, response_metadata_mode) - return _parser.generator() - - async def _to_flux_record_stream_async(self, response, query_options=None, response_metadata_mode: - FluxResponseMetadataMode = FluxResponseMetadataMode.full) -> \ - AsyncGenerator['FluxRecord', None]: - """ - Parse HTTP response to FluxRecord stream. - - :param response: HTTP response from an HTTP client. Expected type: `aiohttp.client_reqrep.ClientResponse`. - """ - _parser = self._to_flux_record_stream_parser(query_options, response, response_metadata_mode) - return (await _parser.__aenter__()).generator_async() - - def _to_data_frame_stream(self, data_frame_index, response, query_options=None, - response_metadata_mode: FluxResponseMetadataMode = FluxResponseMetadataMode.full, - use_extension_dtypes=False): - """ - Parse HTTP response to DataFrame stream. - - :param response: HTTP response from an HTTP client. Expected type: `urllib3.response.HTTPResponse`. - """ - _parser = self._to_data_frame_stream_parser(data_frame_index, query_options, response, response_metadata_mode, - use_extension_dtypes) - return _parser.generator() - - async def _to_data_frame_stream_async(self, data_frame_index, response, query_options=None, response_metadata_mode: - FluxResponseMetadataMode = FluxResponseMetadataMode.full, - use_extension_dtypes=False): - """ - Parse HTTP response to DataFrame stream. - - :param response: HTTP response from an HTTP client. Expected type: `aiohttp.client_reqrep.ClientResponse`. - """ - _parser = self._to_data_frame_stream_parser(data_frame_index, query_options, response, response_metadata_mode, - use_extension_dtypes) - return (await _parser.__aenter__()).generator_async() - - def _to_tables_parser(self, response, query_options, response_metadata_mode): - return FluxCsvParser(response=response, serialization_mode=FluxSerializationMode.tables, - query_options=query_options, response_metadata_mode=response_metadata_mode) - - def _to_flux_record_stream_parser(self, query_options, response, response_metadata_mode): - return FluxCsvParser(response=response, serialization_mode=FluxSerializationMode.stream, - query_options=query_options, response_metadata_mode=response_metadata_mode) - - def _to_data_frame_stream_parser(self, data_frame_index, query_options, response, response_metadata_mode, - use_extension_dtypes): - return FluxCsvParser(response=response, serialization_mode=FluxSerializationMode.dataFrame, - data_frame_index=data_frame_index, query_options=query_options, - response_metadata_mode=response_metadata_mode, - use_extension_dtypes=use_extension_dtypes) - - def _to_data_frames(self, _generator): - """Parse stream of DataFrames into expected type.""" - from ..extras import pd - if isinstance(_generator, list): - _dataFrames = _generator - else: - _dataFrames = list(_generator) - - if len(_dataFrames) == 0: - return pd.DataFrame(columns=[], index=None) - elif len(_dataFrames) == 1: - return _dataFrames[0] - else: - return _dataFrames - - def _org_param(self, org): - return get_org_query_param(org=org, client=self._influxdb_client) - - def _get_query_options(self): - if self._query_options and self._query_options.profilers: - return self._query_options - elif self._influxdb_client.profilers: - from influxdb_client.client.query_api import QueryOptions - return QueryOptions(profilers=self._influxdb_client.profilers) - - def _create_query(self, query, dialect=default_dialect, params: dict = None, **kwargs): - query_options = self._get_query_options() - profilers = query_options.profilers if query_options is not None else None - q = Query(query=query, dialect=dialect, extern=_BaseQueryApi._build_flux_ast(params, profilers)) - - if profilers: - print("\n===============") - print("Profiler: query") - print("===============") - print(query) - - if kwargs.get('dataframe_query', False): - MissingPivotFunction.print_warning(query) - - return q - - @staticmethod - def _params_to_extern_ast(params: dict) -> List['OptionStatement']: - - statements = [] - for key, value in params.items(): - expression = _BaseQueryApi._parm_to_extern_ast(value) - if expression is None: - continue - - statements.append(OptionStatement("OptionStatement", - VariableAssignment("VariableAssignment", Identifier("Identifier", key), - expression))) - return statements - - @staticmethod - def _parm_to_extern_ast(value) -> Union[Expression, None]: - if value is None: - return None - if isinstance(value, bool): - return BooleanLiteral("BooleanLiteral", value) - elif isinstance(value, int): - return IntegerLiteral("IntegerLiteral", str(value)) - elif isinstance(value, float): - return FloatLiteral("FloatLiteral", value) - elif isinstance(value, datetime): - value = get_date_helper().to_utc(value) - nanoseconds = getattr(value, 'nanosecond', 0) - fraction = f'{(value.microsecond * 1000 + nanoseconds):09d}' - return DateTimeLiteral("DateTimeLiteral", value.strftime('%Y-%m-%dT%H:%M:%S.') + fraction + 'Z') - elif isinstance(value, timedelta): - _micro_delta = int(value / timedelta(microseconds=1)) - if _micro_delta < 0: - return UnaryExpression("UnaryExpression", argument=DurationLiteral("DurationLiteral", [ - Duration(magnitude=-_micro_delta, unit="us")]), operator="-") - else: - return DurationLiteral("DurationLiteral", [Duration(magnitude=_micro_delta, unit="us")]) - elif isinstance(value, str): - return StringLiteral("StringLiteral", str(value)) - elif isinstance(value, Iterable): - return ArrayExpression("ArrayExpression", - elements=list(map(lambda it: _BaseQueryApi._parm_to_extern_ast(it), value))) - else: - return value - - @staticmethod - def _build_flux_ast(params: dict = None, profilers: List[str] = None): - - imports = [] - body = [] - - if profilers is not None and len(profilers) > 0: - imports.append(ImportDeclaration( - "ImportDeclaration", - path=StringLiteral("StringLiteral", "profiler"))) - - elements = [] - for profiler in profilers: - elements.append(StringLiteral("StringLiteral", value=profiler)) - - member = MemberExpression( - "MemberExpression", - object=Identifier("Identifier", "profiler"), - _property=Identifier("Identifier", "enabledProfilers")) - - prof = OptionStatement( - "OptionStatement", - assignment=MemberAssignment( - "MemberAssignment", - member=member, - init=ArrayExpression( - "ArrayExpression", - elements=elements))) - - body.append(prof) - - if params is not None: - body.extend(_BaseQueryApi._params_to_extern_ast(params)) - - return File(package=None, name=None, type=None, imports=imports, body=body) - - -class _BaseWriteApi(object): - def __init__(self, influxdb_client, point_settings=None): - self._influxdb_client = influxdb_client - self._point_settings = point_settings - self._write_service = WriteService(influxdb_client.api_client) - if influxdb_client.default_tags: - for key, value in influxdb_client.default_tags.items(): - self._point_settings.add_default_tag(key, value) - - def _append_default_tag(self, key, val, record): - from influxdb_client import Point - if isinstance(record, bytes) or isinstance(record, str): - pass - elif isinstance(record, Point): - record.tag(key, val) - elif isinstance(record, dict): - record.setdefault("tags", {}) - record.get("tags")[key] = val - elif isinstance(record, Iterable): - for item in record: - self._append_default_tag(key, val, item) - - def _append_default_tags(self, record): - if self._point_settings.defaultTags and record is not None: - for key, val in self._point_settings.defaultTags.items(): - self._append_default_tag(key, val, record) - - def _serialize(self, record, write_precision, payload, **kwargs): - from influxdb_client import Point - if isinstance(record, bytes): - payload[write_precision].append(record) - - elif isinstance(record, str): - self._serialize(record.encode(_UTF_8_encoding), write_precision, payload, **kwargs) - - elif isinstance(record, Point): - precision_from_point = kwargs.get('precision_from_point', True) - precision = record.write_precision if precision_from_point else write_precision - self._serialize(record.to_line_protocol(precision=precision), precision, payload, **kwargs) - - elif isinstance(record, dict): - self._serialize(Point.from_dict(record, write_precision=write_precision, **kwargs), - write_precision, payload, **kwargs) - elif 'DataFrame' in type(record).__name__: - serializer = DataframeSerializer(record, self._point_settings, write_precision, **kwargs) - self._serialize(serializer.serialize(), write_precision, payload, **kwargs) - elif hasattr(record, "_asdict"): - # noinspection PyProtectedMember - self._serialize(record._asdict(), write_precision, payload, **kwargs) - elif _HAS_DATACLASS and dataclasses.is_dataclass(record): - self._serialize(dataclasses.asdict(record), write_precision, payload, **kwargs) - elif isinstance(record, Iterable): - for item in record: - self._serialize(item, write_precision, payload, **kwargs) - - -# noinspection PyMethodMayBeStatic -class _BaseDeleteApi(object): - def __init__(self, influxdb_client): - self._influxdb_client = influxdb_client - self._service = DeleteService(influxdb_client.api_client) - - def _prepare_predicate_request(self, start, stop, predicate): - date_helper = get_date_helper() - if isinstance(start, datetime): - start = date_helper.to_utc(start) - if isinstance(stop, datetime): - stop = date_helper.to_utc(stop) - predicate_request = DeletePredicateRequest(start=start, stop=stop, predicate=predicate) - return predicate_request - - -class _Configuration(Configuration): - def __init__(self): - Configuration.__init__(self) - self.enable_gzip = False - self.username = None - self.password = None - - def update_request_header_params(self, path: str, params: dict): - super().update_request_header_params(path, params) - if self.enable_gzip: - # GZIP Request - if path == '/api/v2/write': - params["Content-Encoding"] = "gzip" - params["Accept-Encoding"] = "identity" - pass - # GZIP Response - if path == '/api/v2/query': - # params["Content-Encoding"] = "gzip" - params["Accept-Encoding"] = "gzip" - pass - pass - pass - - def update_request_body(self, path: str, body): - _body = super().update_request_body(path, body) - if self.enable_gzip: - # GZIP Request - if path == '/api/v2/write': - import gzip - if isinstance(_body, bytes): - return gzip.compress(data=_body) - else: - return gzip.compress(bytes(_body, _UTF_8_encoding)) - - return _body - - -def _to_bool(bool_value): - return str(bool_value).lower() in ("yes", "true") - - -def _to_int(int_value): - return int(int_value) if int_value is not None else None diff --git a/frogpilot/third_party/influxdb_client/client/_pages.py b/frogpilot/third_party/influxdb_client/client/_pages.py deleted file mode 100644 index 5e418427..00000000 --- a/frogpilot/third_party/influxdb_client/client/_pages.py +++ /dev/null @@ -1,66 +0,0 @@ - - -class _Page: - def __init__(self, values, has_next, next_after): - self.has_next = has_next - self.values = values - self.next_after = next_after - - @staticmethod - def empty(): - return _Page([], False, None) - - @staticmethod - def initial(after): - return _Page([], True, after) - - -class _PageIterator: - def __init__(self, page: _Page, get_next_page): - self.page = page - self.get_next_page = get_next_page - - def __iter__(self): - return self - - def __next__(self): - if not self.page.values: - if self.page.has_next: - self.page = self.get_next_page(self.page) - if not self.page.values: - raise StopIteration - return self.page.values.pop(0) - - -class _Paginated: - def __init__(self, paginated_getter, pluck_page_resources_from_response): - self.paginated_getter = paginated_getter - self.pluck_page_resources_from_response = pluck_page_resources_from_response - - def find_iter(self, **kwargs): - """Iterate over resources with pagination. - - :key str org: The organization name. - :key str org_id: The organization ID. - :key str after: The last resource ID from which to seek from (but not including). - :key int limit: the maximum number of items per page - :return: resources iterator - """ - - def get_next_page(page: _Page): - return self._find_next_page(page, **kwargs) - - return iter(_PageIterator(_Page.initial(kwargs.get('after')), get_next_page)) - - def _find_next_page(self, page: _Page, **kwargs): - if not page.has_next: - return _Page.empty() - - kw_args = {**kwargs, 'after': page.next_after} if page.next_after is not None else kwargs - response = self.paginated_getter(**kw_args) - - resources = self.pluck_page_resources_from_response(response) - has_next = response.links.next is not None - last_id = resources[-1].id if resources else None - - return _Page(resources, has_next, last_id) diff --git a/frogpilot/third_party/influxdb_client/client/authorizations_api.py b/frogpilot/third_party/influxdb_client/client/authorizations_api.py deleted file mode 100644 index 05be6ecd..00000000 --- a/frogpilot/third_party/influxdb_client/client/authorizations_api.py +++ /dev/null @@ -1,136 +0,0 @@ -"""Authorization is about managing the security of your InfluxDB instance.""" - -from influxdb_client import Authorization, AuthorizationsService, User, Organization - - -class AuthorizationsApi(object): - """Implementation for '/api/v2/authorizations' endpoint.""" - - def __init__(self, influxdb_client): - """Initialize defaults.""" - self._influxdb_client = influxdb_client - self._authorizations_service = AuthorizationsService(influxdb_client.api_client) - - def create_authorization(self, org_id: str = None, permissions: list = None, - authorization: Authorization = None) -> Authorization: - """ - Create an authorization. - - :type permissions: list of Permission - :param org_id: organization id - :param permissions: list of permissions - :type authorization: authorization object - - """ - if authorization is not None: - if not isinstance(authorization, Authorization): - raise TypeError(f"Attempt to use non-Authorization value for authorization: {authorization}") - return self._authorizations_service.post_authorizations(authorization_post_request=authorization) - - # if org_id is not None and permissions is not None: - authorization = Authorization(org_id=org_id, permissions=permissions) - return self._authorizations_service.post_authorizations(authorization_post_request=authorization) - - def find_authorization_by_id(self, auth_id: str) -> Authorization: - """ - Find authorization by id. - - :param auth_id: authorization id - :return: Authorization - """ - return self._authorizations_service.get_authorizations_id(auth_id=auth_id) - - def find_authorizations(self, **kwargs): - """ - Get a list of all authorizations. - - :key str user_id: filter authorizations belonging to a user id - :key str user: filter authorizations belonging to a user name - :key str org_id: filter authorizations belonging to a org id - :key str org: filter authorizations belonging to a org name - :return: Authorizations - """ - authorizations = self._authorizations_service.get_authorizations(**kwargs) - - return authorizations.authorizations - - def find_authorizations_by_user(self, user: User): - """ - Find authorization by User. - - :return: Authorization list - """ - return self.find_authorizations(user_id=user.id) - - def find_authorizations_by_user_id(self, user_id: str): - """ - Find authorization by user id. - - :return: Authorization list - """ - return self.find_authorizations(user_id=user_id) - - def find_authorizations_by_user_name(self, user_name: str): - """ - Find authorization by user name. - - :return: Authorization list - """ - return self.find_authorizations(user=user_name) - - def find_authorizations_by_org(self, org: Organization): - """ - Find authorization by user name. - - :return: Authorization list - """ - if isinstance(org, Organization): - return self.find_authorizations(org_id=org.id) - - def find_authorizations_by_org_name(self, org_name: str): - """ - Find authorization by org name. - - :return: Authorization list - """ - return self.find_authorizations(org=org_name) - - def find_authorizations_by_org_id(self, org_id: str): - """ - Find authorization by org id. - - :return: Authorization list - """ - return self.find_authorizations(org_id=org_id) - - def update_authorization(self, auth): - """ - Update authorization object. - - :param auth: - :return: - """ - return self._authorizations_service.patch_authorizations_id(auth_id=auth.id, authorization_update_request=auth) - - def clone_authorization(self, auth) -> Authorization: - """Clone an authorization.""" - if isinstance(auth, Authorization): - cloned = Authorization(org_id=auth.org_id, permissions=auth.permissions) - # cloned.description = auth.description - # cloned.status = auth.status - return self.create_authorization(authorization=cloned) - - if isinstance(auth, str): - authorization = self.find_authorization_by_id(auth) - return self.clone_authorization(auth=authorization) - - raise ValueError("Invalid argument") - - def delete_authorization(self, auth): - """Delete a authorization.""" - if isinstance(auth, Authorization): - return self._authorizations_service.delete_authorizations_id(auth_id=auth.id) - - if isinstance(auth, str): - return self._authorizations_service.delete_authorizations_id(auth_id=auth) - raise ValueError("Invalid argument") diff --git a/frogpilot/third_party/influxdb_client/client/bucket_api.py b/frogpilot/third_party/influxdb_client/client/bucket_api.py deleted file mode 100644 index 684da767..00000000 --- a/frogpilot/third_party/influxdb_client/client/bucket_api.py +++ /dev/null @@ -1,132 +0,0 @@ -""" -A bucket is a named location where time series data is stored. - -All buckets have a retention policy, a duration of time that each data point persists. -A bucket belongs to an organization. -""" -import warnings - -from influxdb_client import BucketsService, Bucket, PostBucketRequest, PatchBucketRequest -from influxdb_client.client.util.helpers import get_org_query_param -from influxdb_client.client._pages import _Paginated - - -class BucketsApi(object): - """Implementation for '/api/v2/buckets' endpoint.""" - - def __init__(self, influxdb_client): - """Initialize defaults.""" - self._influxdb_client = influxdb_client - self._buckets_service = BucketsService(influxdb_client.api_client) - - def create_bucket(self, bucket=None, bucket_name=None, org_id=None, retention_rules=None, - description=None, org=None) -> Bucket: - """Create a bucket. - - :param Bucket|PostBucketRequest bucket: bucket to create - :param bucket_name: bucket name - :param description: bucket description - :param org_id: org_id - :param bucket_name: bucket name - :param retention_rules: retention rules array or single BucketRetentionRules - :param str, Organization org: specifies the organization for create the bucket; - Take the ``ID``, ``Name`` or ``Organization``. - If not specified the default value from ``InfluxDBClient.org`` is used. - :return: Bucket - If the method is called asynchronously, - returns the request thread. - """ - if retention_rules is None: - retention_rules = [] - - rules = [] - - if isinstance(retention_rules, list): - rules.extend(retention_rules) - else: - rules.append(retention_rules) - - if org_id is not None: - warnings.warn("org_id is deprecated; use org", DeprecationWarning) - - if bucket is None: - bucket = PostBucketRequest(name=bucket_name, - retention_rules=rules, - description=description, - org_id=get_org_query_param(org=(org_id if org is None else org), - client=self._influxdb_client, - required_id=True)) - - return self._buckets_service.post_buckets(post_bucket_request=bucket) - - def update_bucket(self, bucket: Bucket) -> Bucket: - """Update a bucket. - - :param bucket: Bucket update to apply (required) - :return: Bucket - """ - request = PatchBucketRequest(name=bucket.name, - description=bucket.description, - retention_rules=bucket.retention_rules) - - return self._buckets_service.patch_buckets_id(bucket_id=bucket.id, patch_bucket_request=request) - - def delete_bucket(self, bucket): - """Delete a bucket. - - :param bucket: bucket id or Bucket - :return: Bucket - """ - if isinstance(bucket, Bucket): - bucket_id = bucket.id - else: - bucket_id = bucket - - return self._buckets_service.delete_buckets_id(bucket_id=bucket_id) - - def find_bucket_by_id(self, id): - """Find bucket by ID. - - :param id: - :return: - """ - return self._buckets_service.get_buckets_id(id) - - def find_bucket_by_name(self, bucket_name): - """Find bucket by name. - - :param bucket_name: bucket name - :return: Bucket - """ - buckets = self._buckets_service.get_buckets(name=bucket_name) - - if len(buckets.buckets) > 0: - return buckets.buckets[0] - else: - return None - - def find_buckets(self, **kwargs): - """List buckets. - - :key int offset: Offset for pagination - :key int limit: Limit for pagination - :key str after: The last resource ID from which to seek from (but not including). - This is to be used instead of `offset`. - :key str org: The organization name. - :key str org_id: The organization ID. - :key str name: Only returns buckets with a specific name. - :return: Buckets - """ - return self._buckets_service.get_buckets(**kwargs) - - def find_buckets_iter(self, **kwargs): - """Iterate over all buckets with pagination. - - :key str name: Only returns buckets with the specified name - :key str org: The organization name. - :key str org_id: The organization ID. - :key str after: The last resource ID from which to seek from (but not including). - :key int limit: the maximum number of buckets in one page - :return: Buckets iterator - """ - return _Paginated(self._buckets_service.get_buckets, lambda response: response.buckets).find_iter(**kwargs) diff --git a/frogpilot/third_party/influxdb_client/client/delete_api.py b/frogpilot/third_party/influxdb_client/client/delete_api.py deleted file mode 100644 index 5f9da471..00000000 --- a/frogpilot/third_party/influxdb_client/client/delete_api.py +++ /dev/null @@ -1,35 +0,0 @@ -"""Delete time series data from InfluxDB.""" - -from datetime import datetime -from typing import Union - -from influxdb_client import Organization -from influxdb_client.client._base import _BaseDeleteApi -from influxdb_client.client.util.helpers import get_org_query_param - - -class DeleteApi(_BaseDeleteApi): - """Implementation for '/api/v2/delete' endpoint.""" - - def __init__(self, influxdb_client): - """Initialize defaults.""" - super().__init__(influxdb_client) - - def delete(self, start: Union[str, datetime], stop: Union[str, datetime], predicate: str, bucket: str, - org: Union[str, Organization, None] = None) -> None: - """ - Delete Time series data from InfluxDB. - - :param str, datetime.datetime start: start time - :param str, datetime.datetime stop: stop time - :param str predicate: predicate - :param str bucket: bucket id or name from which data will be deleted - :param str, Organization org: specifies the organization to delete data from. - Take the ``ID``, ``Name`` or ``Organization``. - If not specified the default value from ``InfluxDBClient.org`` is used. - :return: - """ - predicate_request = self._prepare_predicate_request(start, stop, predicate) - org_param = get_org_query_param(org=org, client=self._influxdb_client, required_id=False) - - return self._service.post_delete(delete_predicate_request=predicate_request, bucket=bucket, org=org_param) diff --git a/frogpilot/third_party/influxdb_client/client/delete_api_async.py b/frogpilot/third_party/influxdb_client/client/delete_api_async.py deleted file mode 100644 index ef44c843..00000000 --- a/frogpilot/third_party/influxdb_client/client/delete_api_async.py +++ /dev/null @@ -1,37 +0,0 @@ -"""Delete time series data from InfluxDB.""" - -from datetime import datetime -from typing import Union - -from influxdb_client import Organization -from influxdb_client.client._base import _BaseDeleteApi -from influxdb_client.client.util.helpers import get_org_query_param - - -class DeleteApiAsync(_BaseDeleteApi): - """Async implementation for '/api/v2/delete' endpoint.""" - - def __init__(self, influxdb_client): - """Initialize defaults.""" - super().__init__(influxdb_client) - - async def delete(self, start: Union[str, datetime], stop: Union[str, datetime], predicate: str, bucket: str, - org: Union[str, Organization, None] = None) -> bool: - """ - Delete Time series data from InfluxDB. - - :param str, datetime.datetime start: start time - :param str, datetime.datetime stop: stop time - :param str predicate: predicate - :param str bucket: bucket id or name from which data will be deleted - :param str, Organization org: specifies the organization to delete data from. - Take the ``ID``, ``Name`` or ``Organization``. - If not specified the default value from ``InfluxDBClientAsync.org`` is used. - :return: ``True`` for successfully deleted data, otherwise raise an exception - """ - predicate_request = self._prepare_predicate_request(start, stop, predicate) - org_param = get_org_query_param(org=org, client=self._influxdb_client, required_id=False) - - response = await self._service.post_delete_async(delete_predicate_request=predicate_request, bucket=bucket, - org=org_param, _return_http_data_only=False) - return response[1] == 204 diff --git a/frogpilot/third_party/influxdb_client/client/exceptions.py b/frogpilot/third_party/influxdb_client/client/exceptions.py deleted file mode 100644 index bfa453e2..00000000 --- a/frogpilot/third_party/influxdb_client/client/exceptions.py +++ /dev/null @@ -1,47 +0,0 @@ -"""Exceptions utils for InfluxDB.""" - -import logging - -from urllib3 import HTTPResponse - -logger = logging.getLogger('influxdb_client.client.exceptions') - - -class InfluxDBError(Exception): - """Raised when a server error occurs.""" - - def __init__(self, response: HTTPResponse = None, message: str = None): - """Initialize the InfluxDBError handler.""" - if response is not None: - self.response = response - self.message = self._get_message(response) - if isinstance(response, HTTPResponse): # response is HTTPResponse - self.headers = response.headers - self.retry_after = response.headers.get('Retry-After') - else: # response is RESTResponse - self.headers = response.getheaders() - self.retry_after = response.getheader('Retry-After') - else: - self.response = None - self.message = message or 'no response' - self.retry_after = None - super().__init__(self.message) - - def _get_message(self, response): - # Body - if response.data: - import json - try: - return json.loads(response.data)["message"] - except Exception as e: - logging.debug(f"Cannot parse error response to JSON: {response.data}, {e}") - return response.data - - # Header - for header_key in ["X-Platform-Error-Code", "X-Influx-Error", "X-InfluxDb-Error"]: - header_value = response.getheader(header_key) - if header_value is not None: - return header_value - - # Http Status - return response.reason diff --git a/frogpilot/third_party/influxdb_client/client/flux_csv_parser.py b/frogpilot/third_party/influxdb_client/client/flux_csv_parser.py deleted file mode 100644 index 99e68094..00000000 --- a/frogpilot/third_party/influxdb_client/client/flux_csv_parser.py +++ /dev/null @@ -1,408 +0,0 @@ -"""Parsing response from InfluxDB to FluxStructures or DataFrame.""" - -import base64 -import codecs -import csv as csv_parser -import warnings -from enum import Enum -from typing import List - -from influxdb_client.client.flux_table import FluxTable, FluxColumn, FluxRecord, TableList -from influxdb_client.client.util.date_utils import get_date_helper -from influxdb_client.rest import _UTF_8_encoding - -ANNOTATION_DEFAULT = "#default" -ANNOTATION_GROUP = "#group" -ANNOTATION_DATATYPE = "#datatype" -ANNOTATIONS = [ANNOTATION_DEFAULT, ANNOTATION_GROUP, ANNOTATION_DATATYPE] - - -class FluxQueryException(Exception): - """The exception from InfluxDB.""" - - def __init__(self, message, reference) -> None: - """Initialize defaults.""" - self.message = message - self.reference = reference - - -class FluxCsvParserException(Exception): - """The exception for not parsable data.""" - - pass - - -class FluxSerializationMode(Enum): - """The type how we want to serialize data.""" - - tables = 1 - stream = 2 - dataFrame = 3 - - -class FluxResponseMetadataMode(Enum): - """The configuration for expected amount of metadata response from InfluxDB.""" - - full = 1 - # useful for Invokable scripts - only_names = 2 - - -class _FluxCsvParserMetadata(object): - def __init__(self): - self.table_index = 0 - self.table_id = -1 - self.start_new_table = False - self.table = None - self.groups = [] - self.parsing_state_error = False - - -class FluxCsvParser(object): - """Parse to processing response from InfluxDB to FluxStructures or DataFrame.""" - - def __init__(self, response, serialization_mode: FluxSerializationMode, - data_frame_index: List[str] = None, query_options=None, - response_metadata_mode: FluxResponseMetadataMode = FluxResponseMetadataMode.full, - use_extension_dtypes=False) -> None: - """ - Initialize defaults. - - :param response: HTTP response from a HTTP client. - Acceptable types: `urllib3.response.HTTPResponse`, `aiohttp.client_reqrep.ClientResponse`. - """ - self._response = response - self.tables = TableList() - self._serialization_mode = serialization_mode - self._response_metadata_mode = response_metadata_mode - self._use_extension_dtypes = use_extension_dtypes - self._data_frame_index = data_frame_index - self._data_frame_values = [] - self._profilers = query_options.profilers if query_options is not None else None - self._profiler_callback = query_options.profiler_callback if query_options is not None else None - self._async_mode = True if 'ClientResponse' in type(response).__name__ else False - - def _close(self): - self._response.close() - - def __enter__(self): - """Initialize CSV reader.""" - # response can be exhausted by logger, so we have to use data that has already been read - if hasattr(self._response, 'closed') and self._response.closed: - from io import StringIO - self._reader = csv_parser.reader(StringIO(self._response.data.decode(_UTF_8_encoding))) - else: - self._reader = csv_parser.reader(codecs.iterdecode(self._response, _UTF_8_encoding)) - return self - - def __exit__(self, exc_type, exc_val, exc_tb): - """Close HTTP response.""" - self._close() - - async def __aenter__(self) -> 'FluxCsvParser': - """Initialize CSV reader.""" - from aiocsv import AsyncReader - self._reader = AsyncReader(_StreamReaderToWithAsyncRead(self._response.content)) - - return self - - async def __aexit__(self, exc_type, exc_val, exc_tb) -> None: - """Shutdown the client.""" - self.__exit__(exc_type, exc_val, exc_tb) - - def generator(self): - """Return Python generator.""" - with self as parser: - for val in parser._parse_flux_response(): - yield val - - def generator_async(self): - """Return Python async-generator.""" - return self._parse_flux_response_async() - - def _parse_flux_response(self): - metadata = _FluxCsvParserMetadata() - - for csv in self._reader: - for val in self._parse_flux_response_row(metadata, csv): - yield val - - # Return latest DataFrame - if (self._serialization_mode is FluxSerializationMode.dataFrame) & hasattr(self, '_data_frame'): - df = self._prepare_data_frame() - if not self._is_profiler_table(metadata.table): - yield df - - async def _parse_flux_response_async(self): - metadata = _FluxCsvParserMetadata() - - try: - async for csv in self._reader: - for val in self._parse_flux_response_row(metadata, csv): - yield val - - # Return latest DataFrame - if (self._serialization_mode is FluxSerializationMode.dataFrame) & hasattr(self, '_data_frame'): - df = self._prepare_data_frame() - if not self._is_profiler_table(metadata.table): - yield df - except BaseException as e: - e_type = type(e).__name__ - if "CancelledError" in e_type or "TimeoutError" in e_type: - e.add_note("Stream cancelled during read. Recommended: Check Influxdb client `timeout` setting.") - raise - finally: - self._close() - - def _parse_flux_response_row(self, metadata, csv): - if len(csv) < 1: - # Skip empty line in results (new line is used as a delimiter between tables or table and error) - pass - - elif "error" == csv[1] and "reference" == csv[2]: - metadata.parsing_state_error = True - - else: - # Throw InfluxException with error response - if metadata.parsing_state_error: - error = csv[1] - reference_value = csv[2] - raise FluxQueryException(error, reference_value) - - token = csv[0] - # start new table - if (token in ANNOTATIONS and not metadata.start_new_table) or \ - (self._response_metadata_mode is FluxResponseMetadataMode.only_names and not metadata.table): - - # Return already parsed DataFrame - if (self._serialization_mode is FluxSerializationMode.dataFrame) & hasattr(self, '_data_frame'): - df = self._prepare_data_frame() - if not self._is_profiler_table(metadata.table): - yield df - - metadata.start_new_table = True - metadata.table = FluxTable() - self._insert_table(metadata.table, metadata.table_index) - metadata.table_index = metadata.table_index + 1 - metadata.table_id = -1 - elif metadata.table is None: - raise FluxCsvParserException("Unable to parse CSV response. FluxTable definition was not found.") - - # # datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string - if ANNOTATION_DATATYPE == token: - self.add_data_types(metadata.table, csv) - - elif ANNOTATION_GROUP == token: - metadata.groups = csv - - elif ANNOTATION_DEFAULT == token: - self.add_default_empty_values(metadata.table, csv) - - else: - # parse column names - if metadata.start_new_table: - # Invokable scripts doesn't supports dialect => all columns are string - if not metadata.table.columns and \ - self._response_metadata_mode is FluxResponseMetadataMode.only_names: - self.add_data_types(metadata.table, list(map(lambda column: 'string', csv))) - metadata.groups = list(map(lambda column: 'false', csv)) - self.add_groups(metadata.table, metadata.groups) - self.add_column_names_and_tags(metadata.table, csv) - metadata.start_new_table = False - # Create DataFrame with default values - if self._serialization_mode is FluxSerializationMode.dataFrame: - from ..extras import pd - labels = list(map(lambda it: it.label, metadata.table.columns)) - self._data_frame = pd.DataFrame(data=[], columns=labels, index=None) - pass - else: - - # to int conversions todo - current_id = int(csv[2]) - if metadata.table_id == -1: - metadata.table_id = current_id - - if metadata.table_id != current_id: - # create new table with previous column headers settings - flux_columns = metadata.table.columns - metadata.table = FluxTable() - metadata.table.columns.extend(flux_columns) - self._insert_table(metadata.table, metadata.table_index) - metadata.table_index = metadata.table_index + 1 - metadata.table_id = current_id - - flux_record = self.parse_record(metadata.table_index - 1, metadata.table, csv) - - if self._is_profiler_record(flux_record): - self._print_profiler_info(flux_record) - else: - if self._serialization_mode is FluxSerializationMode.tables: - self.tables[metadata.table_index - 1].records.append(flux_record) - - if self._serialization_mode is FluxSerializationMode.stream: - yield flux_record - - if self._serialization_mode is FluxSerializationMode.dataFrame: - self._data_frame_values.append(flux_record.values) - pass - - def _prepare_data_frame(self): - from ..extras import pd - - # We have to create temporary DataFrame because we want to preserve default column values - _temp_df = pd.DataFrame(self._data_frame_values) - self._data_frame_values = [] - - # Custom DataFrame index - if self._data_frame_index: - self._data_frame = self._data_frame.set_index(self._data_frame_index) - _temp_df = _temp_df.set_index(self._data_frame_index) - - # Append data - df = pd.concat([self._data_frame.astype(_temp_df.dtypes), _temp_df]) - - if self._use_extension_dtypes: - return df.convert_dtypes() - return df - - def parse_record(self, table_index, table, csv): - """Parse one record.""" - record = FluxRecord(table_index) - - for fluxColumn in table.columns: - column_name = fluxColumn.label - str_val = csv[fluxColumn.index + 1] - record.values[column_name] = self._to_value(str_val, fluxColumn) - record.row.append(record.values[column_name]) - - return record - - def _to_value(self, str_val, column): - - if str_val == '' or str_val is None: - default_value = column.default_value - if default_value == '' or default_value is None: - if self._serialization_mode is FluxSerializationMode.dataFrame: - if self._use_extension_dtypes: - from ..extras import pd - return pd.NA - return None - return None - return self._to_value(default_value, column) - - if "string" == column.data_type: - return str_val - - if "boolean" == column.data_type: - return "true" == str_val - - if "unsignedLong" == column.data_type or "long" == column.data_type: - return int(str_val) - - if "double" == column.data_type: - return float(str_val) - - if "base64Binary" == column.data_type: - return base64.b64decode(str_val) - - if "dateTime:RFC3339" == column.data_type or "dateTime:RFC3339Nano" == column.data_type: - return get_date_helper().parse_date(str_val) - - if "duration" == column.data_type: - # todo better type ? - return int(str_val) - - @staticmethod - def add_data_types(table, data_types): - """Add data types to columns.""" - for index in range(1, len(data_types)): - column_def = FluxColumn(index=index - 1, data_type=data_types[index]) - table.columns.append(column_def) - - @staticmethod - def add_groups(table, csv): - """Add group keys to columns.""" - i = 1 - for column in table.columns: - column.group = csv[i] == "true" - i += 1 - - @staticmethod - def add_default_empty_values(table, default_values): - """Add default values to columns.""" - i = 1 - for column in table.columns: - column.default_value = default_values[i] - i += 1 - - @staticmethod - def add_column_names_and_tags(table, csv): - """Add labels to columns.""" - if len(csv) != len(set(csv)): - message = f"""The response contains columns with duplicated names: '{csv}'. - -You should use the 'record.row' to access your data instead of 'record.values' dictionary. -""" - warnings.warn(message, UserWarning) - print(message) - i = 1 - for column in table.columns: - column.label = csv[i] - i += 1 - - def _insert_table(self, table, table_index): - if self._serialization_mode is FluxSerializationMode.tables: - self.tables.insert(table_index, table) - - def _is_profiler_record(self, flux_record: FluxRecord) -> bool: - if not self._profilers: - return False - - for profiler in self._profilers: - if "_measurement" in flux_record.values and flux_record["_measurement"] == "profiler/" + profiler: - return True - - return False - - def _is_profiler_table(self, table: FluxTable) -> bool: - - if not self._profilers: - return False - - return any(filter(lambda column: (column.default_value == "_profiler" and column.label == "result"), - table.columns)) - - def table_list(self) -> TableList: - """Get the list of flux tables.""" - if not self._profilers: - return self.tables - else: - return TableList(filter(lambda table: not self._is_profiler_table(table), self.tables)) - - def _print_profiler_info(self, flux_record: FluxRecord): - if flux_record.get_measurement().startswith("profiler/"): - if self._profiler_callback: - self._profiler_callback(flux_record) - else: - msg = "Profiler: " + flux_record.get_measurement() - print("\n" + len(msg) * "=") - print(msg) - print(len(msg) * "=") - for name in flux_record.values: - val = flux_record[name] - if isinstance(val, str) and len(val) > 50: - print(f"{name:<20}: \n\n{val}") - elif val is not None: - print(f"{name:<20}: {val:<20}") - - -class _StreamReaderToWithAsyncRead: - def __init__(self, response): - self.response = response - self.decoder = codecs.getincrementaldecoder(_UTF_8_encoding)() - - async def read(self, size: int) -> str: - raw_bytes = (await self.response.read(size)) - if not raw_bytes: - return self.decoder.decode(b'', final=True) - return self.decoder.decode(raw_bytes, final=False) diff --git a/frogpilot/third_party/influxdb_client/client/flux_table.py b/frogpilot/third_party/influxdb_client/client/flux_table.py deleted file mode 100644 index 5fd9a061..00000000 --- a/frogpilot/third_party/influxdb_client/client/flux_table.py +++ /dev/null @@ -1,290 +0,0 @@ -""" -Flux employs a basic data model built from basic data types. - -The data model consists of tables, records, columns. -""" -import codecs -import csv -from http.client import HTTPResponse -from json import JSONEncoder -from typing import List, Iterator -from influxdb_client.rest import _UTF_8_encoding - - -class FluxStructure: - """The data model consists of tables, records, columns.""" - - pass - - -class FluxStructureEncoder(JSONEncoder): - """The FluxStructure encoder to encode query results to JSON.""" - - def default(self, obj): - """Return serializable objects for JSONEncoder.""" - import datetime - if isinstance(obj, FluxStructure): - return obj.__dict__ - elif isinstance(obj, (datetime.datetime, datetime.date)): - return obj.isoformat() - return super().default(obj) - - -class FluxTable(FluxStructure): - """ - A table is set of records with a common set of columns and a group key. - - The table can be serialized into JSON by:: - - import json - from influxdb_client.client.flux_table import FluxStructureEncoder - - output = json.dumps(tables, cls=FluxStructureEncoder, indent=2) - print(output) - - """ - - def __init__(self) -> None: - """Initialize defaults.""" - self.columns: List[FluxColumn] = [] - self.records: List[FluxRecord] = [] - - def get_group_key(self): - """ - Group key is a list of columns. - - A table’s group key denotes which subset of the entire dataset is assigned to the table. - """ - return list(filter(lambda column: (column.group is True), self.columns)) - - def __str__(self): - """Return formatted output.""" - cls_name = type(self).__name__ - return cls_name + "() columns: " + str(len(self.columns)) + ", records: " + str(len(self.records)) - - def __repr__(self): - """Format for inspection.""" - return f"<{type(self).__name__}: {len(self.columns)} columns, {len(self.records)} records>" - - def __iter__(self): - """Iterate over records.""" - return iter(self.records) - - -class FluxColumn(FluxStructure): - """A column has a label and a data type.""" - - def __init__(self, index=None, label=None, data_type=None, group=None, default_value=None) -> None: - """Initialize defaults.""" - self.default_value = default_value - self.group = group - self.data_type = data_type - self.label = label - self.index = index - - def __repr__(self): - """Format for inspection.""" - fields = [repr(self.index)] + [ - f'{name}={getattr(self, name)!r}' for name in ( - 'label', 'data_type', 'group', 'default_value' - ) if getattr(self, name) is not None - ] - return f"{type(self).__name__}({', '.join(fields)})" - - -class FluxRecord(FluxStructure): - """A record is a tuple of named values and is represented using an object type.""" - - def __init__(self, table, values=None) -> None: - """Initialize defaults.""" - if values is None: - values = {} - self.table = table - self.values = values - self.row = [] - - def get_start(self): - """Get '_start' value.""" - return self["_start"] - - def get_stop(self): - """Get '_stop' value.""" - return self["_stop"] - - def get_time(self): - """Get timestamp.""" - return self["_time"] - - def get_value(self): - """Get field value.""" - return self["_value"] - - def get_field(self): - """Get field name.""" - return self["_field"] - - def get_measurement(self): - """Get measurement name.""" - return self["_measurement"] - - def __getitem__(self, key): - """Get value by key.""" - return self.values.__getitem__(key) - - def __setitem__(self, key, value): - """Set value with key and value.""" - return self.values.__setitem__(key, value) - - def __str__(self): - """Return formatted output.""" - cls_name = type(self).__name__ - return cls_name + "() table: " + str(self.table) + ", " + str(self.values) - - def __repr__(self): - """Format for inspection.""" - return f"<{type(self).__name__}: field={self.values.get('_field')}, value={self.values.get('_value')}>" - - -class TableList(List[FluxTable]): - """:class:`~influxdb_client.client.flux_table.FluxTable` list with additionally functional to better handle of query result.""" # noqa: E501 - - def to_values(self, columns: List['str'] = None) -> List[List[object]]: - """ - Serialize query results to a flattened list of values. - - :param columns: if not ``None`` then only specified columns are presented in results - :return: :class:`~list` of values - - Output example: - - .. code-block:: python - - [ - ['New York', datetime.datetime(2022, 6, 7, 11, 3, 22, 917593, tzinfo=tzutc()), 24.3], - ['Prague', datetime.datetime(2022, 6, 7, 11, 3, 22, 917593, tzinfo=tzutc()), 25.3], - ... - ] - - Configure required columns: - - .. code-block:: python - - from influxdb_client import InfluxDBClient - - with InfluxDBClient(url="http://localhost:8086", token="my-token", org="my-org") as client: - - # Query: using Table structure - tables = client.query_api().query('from(bucket:"my-bucket") |> range(start: -10m)') - - # Serialize to values - output = tables.to_values(columns=['location', '_time', '_value']) - print(output) - """ - - def filter_values(record): - if columns is not None: - return [record.values.get(k) for k in columns] - return record.values.values() - - return self._to_values(filter_values) - - def to_json(self, columns: List['str'] = None, **kwargs) -> str: - """ - Serialize query results to a JSON formatted :class:`~str`. - - :param columns: if not ``None`` then only specified columns are presented in results - :return: :class:`~str` - - The query results is flattened to array: - - .. code-block:: javascript - - [ - { - "_measurement": "mem", - "_start": "2021-06-23T06:50:11.897825+00:00", - "_stop": "2021-06-25T06:50:11.897825+00:00", - "_time": "2020-02-27T16:20:00.897825+00:00", - "region": "north", - "_field": "usage", - "_value": 15 - }, - { - "_measurement": "mem", - "_start": "2021-06-23T06:50:11.897825+00:00", - "_stop": "2021-06-25T06:50:11.897825+00:00", - "_time": "2020-02-27T16:20:01.897825+00:00", - "region": "west", - "_field": "usage", - "_value": 10 - }, - ... - ] - - The JSON format could be configured via ``**kwargs`` arguments: - - .. code-block:: python - - from influxdb_client import InfluxDBClient - - with InfluxDBClient(url="http://localhost:8086", token="my-token", org="my-org") as client: - - # Query: using Table structure - tables = client.query_api().query('from(bucket:"my-bucket") |> range(start: -10m)') - - # Serialize to JSON - output = tables.to_json(indent=5) - print(output) - - For all available options see - `json.dump `_. - """ - if 'indent' not in kwargs: - kwargs['indent'] = 2 - - def filter_values(record): - if columns is not None: - return {k: v for (k, v) in record.values.items() if k in columns} - return record.values - - import json - return json.dumps(self._to_values(filter_values), cls=FluxStructureEncoder, **kwargs) - - def _to_values(self, mapping): - return [mapping(record) for table in self for record in table.records] - - -class CSVIterator(Iterator[List[str]]): - """:class:`Iterator[List[str]]` with additionally functional to better handle of query result.""" - - def __init__(self, response: HTTPResponse) -> None: - """Initialize ``csv.reader``.""" - self.delegate = csv.reader(codecs.iterdecode(response, _UTF_8_encoding)) - - def __iter__(self): - """Return an iterator object.""" - return self - - def __next__(self): - """Retrieve the next item from the iterator.""" - row = self.delegate.__next__() - while not row: - row = self.delegate.__next__() - return row - - def to_values(self) -> List[List[str]]: - """ - Serialize query results to a flattened list of values. - - :return: :class:`~list` of values - - Output example: - - .. code-block:: python - - [ - ['New York', '2022-06-14T08:00:51.749072045Z', '24.3'], - ['Prague', '2022-06-14T08:00:51.749072045Z', '25.3'], - ... - ] - """ - return list(self.__iter__()) diff --git a/frogpilot/third_party/influxdb_client/client/influxdb_client.py b/frogpilot/third_party/influxdb_client/client/influxdb_client.py deleted file mode 100644 index cbae75a9..00000000 --- a/frogpilot/third_party/influxdb_client/client/influxdb_client.py +++ /dev/null @@ -1,438 +0,0 @@ -"""InfluxDBClient is client for API defined in https://github.com/influxdata/influxdb/blob/master/http/swagger.yml.""" - -from __future__ import absolute_import - -import logging -import warnings - -from influxdb_client import HealthCheck, HealthService, Ready, ReadyService, PingService, \ - InvokableScriptsApi -from influxdb_client.client._base import _BaseClient -from influxdb_client.client.authorizations_api import AuthorizationsApi -from influxdb_client.client.bucket_api import BucketsApi -from influxdb_client.client.delete_api import DeleteApi -from influxdb_client.client.labels_api import LabelsApi -from influxdb_client.client.organizations_api import OrganizationsApi -from influxdb_client.client.query_api import QueryApi, QueryOptions -from influxdb_client.client.tasks_api import TasksApi -from influxdb_client.client.users_api import UsersApi -from influxdb_client.client.write_api import WriteApi, WriteOptions, PointSettings - -logger = logging.getLogger('influxdb_client.client.influxdb_client') - - -class InfluxDBClient(_BaseClient): - """InfluxDBClient is client for InfluxDB v2.""" - - def __init__(self, url, token: str = None, debug=None, timeout=10_000, enable_gzip=False, org: str = None, - default_tags: dict = None, **kwargs) -> None: - """ - Initialize defaults. - - :param url: InfluxDB server API url (ex. http://localhost:8086). - :param token: ``token`` to authenticate to the InfluxDB API - :param debug: enable verbose logging of http requests - :param timeout: HTTP client timeout setting for a request specified in milliseconds. - If one number provided, it will be total request timeout. - It can also be a pair (tuple) of (connection, read) timeouts. - :param enable_gzip: Enable Gzip compression for http requests. Currently, only the "Write" and "Query" endpoints - supports the Gzip compression. - :param org: organization name (used as a default in Query, Write and Delete API) - :key bool verify_ssl: Set this to false to skip verifying SSL certificate when calling API from https server. - :key str ssl_ca_cert: Set this to customize the certificate file to verify the peer. - :key str cert_file: Path to the certificate that will be used for mTLS authentication. - :key str cert_key_file: Path to the file contains private key for mTLS certificate. - :key str cert_key_password: String or function which returns password for decrypting the mTLS private key. - :key ssl.SSLContext ssl_context: Specify a custom Python SSL Context for the TLS/ mTLS handshake. - Be aware that only delivered certificate/ key files or an SSL Context are - possible. - :key str proxy: Set this to configure the http proxy to be used (ex. http://localhost:3128) - :key str proxy_headers: A dictionary containing headers that will be sent to the proxy. Could be used for proxy - authentication. - :key int connection_pool_maxsize: Number of connections to save that can be reused by urllib3. - Defaults to "multiprocessing.cpu_count() * 5". - :key urllib3.util.retry.Retry retries: Set the default retry strategy that is used for all HTTP requests - except batching writes. As a default there is no one retry strategy. - :key bool auth_basic: Set this to true to enable basic authentication when talking to a InfluxDB 1.8.x that - does not use auth-enabled but is protected by a reverse proxy with basic authentication. - (defaults to false, don't set to true when talking to InfluxDB 2) - :key str username: ``username`` to authenticate via username and password credentials to the InfluxDB 2.x - :key str password: ``password`` to authenticate via username and password credentials to the InfluxDB 2.x - :key list[str] profilers: list of enabled Flux profilers - """ - super().__init__(url=url, token=token, debug=debug, timeout=timeout, enable_gzip=enable_gzip, org=org, - default_tags=default_tags, http_client_logger="urllib3", **kwargs) - - from .._sync.api_client import ApiClient - self.api_client = ApiClient(configuration=self.conf, header_name=self.auth_header_name, - header_value=self.auth_header_value, retries=self.retries) - - def __enter__(self): - """ - Enter the runtime context related to this object. - - It will bind this method’s return value to the target(s) - specified in the `as` clause of the statement. - - return: self instance - """ - return self - - def __exit__(self, exc_type, exc_value, traceback): - """Exit the runtime context related to this object and close the client.""" - self.close() - - @classmethod - def from_config_file(cls, config_file: str = "config.ini", debug=None, enable_gzip=False, **kwargs): - """ - Configure client via configuration file. The configuration has to be under 'influx' section. - - :param config_file: Path to configuration file - :param debug: Enable verbose logging of http requests - :param enable_gzip: Enable Gzip compression for http requests. Currently, only the "Write" and "Query" endpoints - supports the Gzip compression. - :key config_name: Name of the configuration section of the configuration file - :key str proxy_headers: A dictionary containing headers that will be sent to the proxy. Could be used for proxy - authentication. - :key urllib3.util.retry.Retry retries: Set the default retry strategy that is used for all HTTP requests - except batching writes. As a default there is no one retry strategy. - :key ssl.SSLContext ssl_context: Specify a custom Python SSL Context for the TLS/ mTLS handshake. - Be aware that only delivered certificate/ key files or an SSL Context are - possible. - - The supported formats: - - https://docs.python.org/3/library/configparser.html - - https://toml.io/en/ - - https://www.json.org/json-en.html - - Configuration options: - - url - - org - - token - - timeout, - - verify_ssl - - ssl_ca_cert - - cert_file - - cert_key_file - - cert_key_password - - connection_pool_maxsize - - auth_basic - - profilers - - proxy - - - config.ini example:: - - [influx2] - url=http://localhost:8086 - org=my-org - token=my-token - timeout=6000 - connection_pool_maxsize=25 - auth_basic=false - profilers=query,operator - proxy=http:proxy.domain.org:8080 - - [tags] - id = 132-987-655 - customer = California Miner - data_center = ${env.data_center} - - config.toml example:: - - [influx2] - url = "http://localhost:8086" - token = "my-token" - org = "my-org" - timeout = 6000 - connection_pool_maxsize = 25 - auth_basic = false - profilers="query, operator" - proxy = "http://proxy.domain.org:8080" - - [tags] - id = "132-987-655" - customer = "California Miner" - data_center = "${env.data_center}" - - config.json example:: - - { - "url": "http://localhost:8086", - "token": "my-token", - "org": "my-org", - "active": true, - "timeout": 6000, - "connection_pool_maxsize": 55, - "auth_basic": false, - "profilers": "query, operator", - "tags": { - "id": "132-987-655", - "customer": "California Miner", - "data_center": "${env.data_center}" - } - } - - """ - return InfluxDBClient._from_config_file(config_file=config_file, debug=debug, enable_gzip=enable_gzip, **kwargs) - - @classmethod - def from_env_properties(cls, debug=None, enable_gzip=False, **kwargs): - """ - Configure client via environment properties. - - :param debug: Enable verbose logging of http requests - :param enable_gzip: Enable Gzip compression for http requests. Currently, only the "Write" and "Query" endpoints - supports the Gzip compression. - :key str proxy: Set this to configure the http proxy to be used (ex. http://localhost:3128) - :key str proxy_headers: A dictionary containing headers that will be sent to the proxy. Could be used for proxy - authentication. - :key urllib3.util.retry.Retry retries: Set the default retry strategy that is used for all HTTP requests - except batching writes. As a default there is no one retry strategy. - :key ssl.SSLContext ssl_context: Specify a custom Python SSL Context for the TLS/ mTLS handshake. - Be aware that only delivered certificate/ key files or an SSL Context are - possible. - - Supported environment properties: - - INFLUXDB_V2_URL - - INFLUXDB_V2_ORG - - INFLUXDB_V2_TOKEN - - INFLUXDB_V2_TIMEOUT - - INFLUXDB_V2_VERIFY_SSL - - INFLUXDB_V2_SSL_CA_CERT - - INFLUXDB_V2_CERT_FILE - - INFLUXDB_V2_CERT_KEY_FILE - - INFLUXDB_V2_CERT_KEY_PASSWORD - - INFLUXDB_V2_CONNECTION_POOL_MAXSIZE - - INFLUXDB_V2_AUTH_BASIC - - INFLUXDB_V2_PROFILERS - - INFLUXDB_V2_TAG - """ - return InfluxDBClient._from_env_properties(debug=debug, enable_gzip=enable_gzip, **kwargs) - - def write_api(self, write_options=WriteOptions(), point_settings=PointSettings(), **kwargs) -> WriteApi: - """ - Create Write API instance. - - Example: - .. code-block:: python - - from influxdb_client import InfluxDBClient - from influxdb_client.client.write_api import SYNCHRONOUS - - - # Initialize SYNCHRONOUS instance of WriteApi - with InfluxDBClient(url="http://localhost:8086", token="my-token", org="my-org") as client: - write_api = client.write_api(write_options=SYNCHRONOUS) - - If you would like to use a **background batching**, you have to configure client like this: - - .. code-block:: python - - from influxdb_client import InfluxDBClient - - # Initialize background batching instance of WriteApi - with InfluxDBClient(url="http://localhost:8086", token="my-token", org="my-org") as client: - with client.write_api() as write_api: - pass - - There is also possibility to use callbacks to notify about state of background batches: - - .. code-block:: python - - from influxdb_client import InfluxDBClient - from influxdb_client.client.exceptions import InfluxDBError - - - class BatchingCallback(object): - - def success(self, conf: (str, str, str), data: str): - print(f"Written batch: {conf}, data: {data}") - - def error(self, conf: (str, str, str), data: str, exception: InfluxDBError): - print(f"Cannot write batch: {conf}, data: {data} due: {exception}") - - def retry(self, conf: (str, str, str), data: str, exception: InfluxDBError): - print(f"Retryable error occurs for batch: {conf}, data: {data} retry: {exception}") - - - with InfluxDBClient(url="http://localhost:8086", token="my-token", org="my-org") as client: - callback = BatchingCallback() - with client.write_api(success_callback=callback.success, - error_callback=callback.error, - retry_callback=callback.retry) as write_api: - pass - - :param write_options: Write API configuration - :param point_settings: settings to store default tags - :key success_callback: The callable ``callback`` to run after having successfully written a batch. - - The callable must accept two arguments: - - `Tuple`: ``(bucket, organization, precision)`` - - `str`: written data - - **[batching mode]** - - :key error_callback: The callable ``callback`` to run after having unsuccessfully written a batch. - - The callable must accept three arguments: - - `Tuple`: ``(bucket, organization, precision)`` - - `str`: written data - - `Exception`: an occurred error - - **[batching mode]** - :key retry_callback: The callable ``callback`` to run after retryable error occurred. - - The callable must accept three arguments: - - `Tuple`: ``(bucket, organization, precision)`` - - `str`: written data - - `Exception`: an retryable error - - **[batching mode]** - :return: write api instance - """ - return WriteApi(influxdb_client=self, write_options=write_options, point_settings=point_settings, **kwargs) - - def query_api(self, query_options: QueryOptions = QueryOptions()) -> QueryApi: - """ - Create an Query API instance. - - :param query_options: optional query api configuration - :return: Query api instance - """ - return QueryApi(self, query_options) - - def invokable_scripts_api(self) -> InvokableScriptsApi: - """ - Create an InvokableScripts API instance. - - :return: InvokableScripts API instance - """ - return InvokableScriptsApi(self) - - def close(self): - """Shutdown the client.""" - self.__del__() - - def __del__(self): - """Shutdown the client.""" - if self.api_client: - self.api_client.__del__() - self.api_client = None - - def buckets_api(self) -> BucketsApi: - """ - Create the Bucket API instance. - - :return: buckets api - """ - return BucketsApi(self) - - def authorizations_api(self) -> AuthorizationsApi: - """ - Create the Authorizations API instance. - - :return: authorizations api - """ - return AuthorizationsApi(self) - - def users_api(self) -> UsersApi: - """ - Create the Users API instance. - - :return: users api - """ - return UsersApi(self) - - def organizations_api(self) -> OrganizationsApi: - """ - Create the Organizations API instance. - - :return: organizations api - """ - return OrganizationsApi(self) - - def tasks_api(self) -> TasksApi: - """ - Create the Tasks API instance. - - :return: tasks api - """ - return TasksApi(self) - - def labels_api(self) -> LabelsApi: - """ - Create the Labels API instance. - - :return: labels api - """ - return LabelsApi(self) - - def health(self) -> HealthCheck: - """ - Get the health of an instance. - - :return: HealthCheck - """ - warnings.warn("This method is deprecated. Call 'ping()' instead.", DeprecationWarning) - health_service = HealthService(self.api_client) - - try: - health = health_service.get_health() - return health - except Exception as e: - return HealthCheck(name="influxdb", message=str(e), status="fail") - - def ping(self) -> bool: - """ - Return the status of InfluxDB instance. - - :return: The status of InfluxDB. - """ - ping_service = PingService(self.api_client) - - try: - ping_service.get_ping() - return True - except Exception as ex: - logger.debug("Unexpected error during /ping: %s", ex) - return False - - def version(self) -> str: - """ - Return the version of the connected InfluxDB Server. - - :return: The version of InfluxDB. - """ - ping_service = PingService(self.api_client) - - response = ping_service.get_ping_with_http_info(_return_http_data_only=False) - - return ping_service.response_header(response) - - def build(self) -> str: - """ - Return the build type of the connected InfluxDB Server. - - :return: The type of InfluxDB build. - """ - ping_service = PingService(self.api_client) - - return ping_service.build_type() - - def ready(self) -> Ready: - """ - Get The readiness of the InfluxDB 2.0. - - :return: Ready - """ - ready_service = ReadyService(self.api_client) - return ready_service.get_ready() - - def delete_api(self) -> DeleteApi: - """ - Get the delete metrics API instance. - - :return: delete api - """ - return DeleteApi(self) diff --git a/frogpilot/third_party/influxdb_client/client/influxdb_client_async.py b/frogpilot/third_party/influxdb_client/client/influxdb_client_async.py deleted file mode 100644 index a8a2d173..00000000 --- a/frogpilot/third_party/influxdb_client/client/influxdb_client_async.py +++ /dev/null @@ -1,301 +0,0 @@ -"""InfluxDBClientAsync is client for API defined in https://github.com/influxdata/openapi/blob/master/contracts/oss.yml.""" # noqa: E501 -import logging -import sys - -from influxdb_client import PingService -from influxdb_client.client._base import _BaseClient -from influxdb_client.client.delete_api_async import DeleteApiAsync -from influxdb_client.client.query_api import QueryOptions -from influxdb_client.client.query_api_async import QueryApiAsync -from influxdb_client.client.write_api import PointSettings -from influxdb_client.client.write_api_async import WriteApiAsync - -logger = logging.getLogger('influxdb_client.client.influxdb_client_async') - - -class InfluxDBClientAsync(_BaseClient): - """InfluxDBClientAsync is client for InfluxDB v2.""" - - def __init__(self, url, token: str = None, org: str = None, debug=None, timeout=10_000, enable_gzip=False, - **kwargs) -> None: - """ - Initialize defaults. - - :param url: InfluxDB server API url (ex. http://localhost:8086). - :param token: ``token`` to authenticate to the InfluxDB 2.x - :param org: organization name (used as a default in Query, Write and Delete API) - :param debug: enable verbose logging of http requests - :param timeout: The maximal number of milliseconds for the whole HTTP request including - connection establishment, request sending and response reading. - It can also be a :class:`~aiohttp.ClientTimeout` which is directly pass to ``aiohttp``. - :param enable_gzip: Enable Gzip compression for http requests. Currently, only the "Write" and "Query" endpoints - supports the Gzip compression. - :key bool verify_ssl: Set this to false to skip verifying SSL certificate when calling API from https server. - :key str ssl_ca_cert: Set this to customize the certificate file to verify the peer. - :key str cert_file: Path to the certificate that will be used for mTLS authentication. - :key str cert_key_file: Path to the file contains private key for mTLS certificate. - :key str cert_key_password: String or function which returns password for decrypting the mTLS private key. - :key ssl.SSLContext ssl_context: Specify a custom Python SSL Context for the TLS/ mTLS handshake. - Be aware that only delivered certificate/ key files or an SSL Context are - possible. - :key str proxy: Set this to configure the http proxy to be used (ex. http://localhost:3128) - :key str proxy_headers: A dictionary containing headers that will be sent to the proxy. Could be used for proxy - authentication. - :key int connection_pool_maxsize: The total number of simultaneous connections. - Defaults to "multiprocessing.cpu_count() * 5". - :key bool auth_basic: Set this to true to enable basic authentication when talking to a InfluxDB 1.8.x that - does not use auth-enabled but is protected by a reverse proxy with basic authentication. - (defaults to false, don't set to true when talking to InfluxDB 2) - :key str username: ``username`` to authenticate via username and password credentials to the InfluxDB 2.x - :key str password: ``password`` to authenticate via username and password credentials to the InfluxDB 2.x - :key bool allow_redirects: If set to ``False``, do not follow HTTP redirects. ``True`` by default. - :key int max_redirects: Maximum number of HTTP redirects to follow. ``10`` by default. - :key dict client_session_kwargs: Additional configuration arguments for :class:`~aiohttp.ClientSession` - :key type client_session_type: Type of aiohttp client to use. Useful for third party wrappers like - ``aiohttp-retry``. :class:`~aiohttp.ClientSession` by default. - :key list[str] profilers: list of enabled Flux profilers - """ - super().__init__(url=url, token=token, org=org, debug=debug, timeout=timeout, enable_gzip=enable_gzip, - http_client_logger="aiohttp.client", **kwargs) - - # compatibility with Python 3.6 - if sys.version_info[:2] >= (3, 7): - from asyncio import get_running_loop - else: - from asyncio import _get_running_loop as get_running_loop - - # check present asynchronous context - try: - loop = get_running_loop() - # compatibility with Python 3.6 - if loop is None: - raise RuntimeError('no running event loop') - except RuntimeError: - from influxdb_client.client.exceptions import InfluxDBError - message = "The async client should be initialised inside async coroutine " \ - "otherwise there can be unexpected behaviour." - raise InfluxDBError(response=None, message=message) - - from .._async.api_client import ApiClientAsync - self.api_client = ApiClientAsync(configuration=self.conf, header_name=self.auth_header_name, - header_value=self.auth_header_value, **kwargs) - - async def __aenter__(self) -> 'InfluxDBClientAsync': - """ - Enter the runtime context related to this object. - - return: self instance - """ - return self - - async def __aexit__(self, exc_type, exc, tb) -> None: - """Shutdown the client.""" - await self.close() - - async def close(self): - """Shutdown the client.""" - if self.api_client: - await self.api_client.close() - self.api_client = None - - @classmethod - def from_config_file(cls, config_file: str = "config.ini", debug=None, enable_gzip=False, **kwargs): - """ - Configure client via configuration file. The configuration has to be under 'influx' section. - - :param config_file: Path to configuration file - :param debug: Enable verbose logging of http requests - :param enable_gzip: Enable Gzip compression for http requests. Currently, only the "Write" and "Query" endpoints - supports the Gzip compression. - :key config_name: Name of the configuration section of the configuration file - :key str proxy_headers: A dictionary containing headers that will be sent to the proxy. Could be used for proxy - authentication. - :key urllib3.util.retry.Retry retries: Set the default retry strategy that is used for all HTTP requests - except batching writes. As a default there is no one retry strategy. - :key ssl.SSLContext ssl_context: Specify a custom Python SSL Context for the TLS/ mTLS handshake. - Be aware that only delivered certificate/ key files or an SSL Context are - possible. - - The supported formats: - - https://docs.python.org/3/library/configparser.html - - https://toml.io/en/ - - https://www.json.org/json-en.html - - Configuration options: - - url - - org - - token - - timeout, - - verify_ssl - - ssl_ca_cert - - cert_file - - cert_key_file - - cert_key_password - - connection_pool_maxsize - - auth_basic - - profilers - - proxy - - - config.ini example:: - - [influx2] - url=http://localhost:8086 - org=my-org - token=my-token - timeout=6000 - connection_pool_maxsize=25 - auth_basic=false - profilers=query,operator - proxy=http:proxy.domain.org:8080 - - [tags] - id = 132-987-655 - customer = California Miner - data_center = ${env.data_center} - - config.toml example:: - - [influx2] - url = "http://localhost:8086" - token = "my-token" - org = "my-org" - timeout = 6000 - connection_pool_maxsize = 25 - auth_basic = false - profilers="query, operator" - proxy = "http://proxy.domain.org:8080" - - [tags] - id = "132-987-655" - customer = "California Miner" - data_center = "${env.data_center}" - - config.json example:: - - { - "url": "http://localhost:8086", - "token": "my-token", - "org": "my-org", - "active": true, - "timeout": 6000, - "connection_pool_maxsize": 55, - "auth_basic": false, - "profilers": "query, operator", - "tags": { - "id": "132-987-655", - "customer": "California Miner", - "data_center": "${env.data_center}" - } - } - - """ - return InfluxDBClientAsync._from_config_file(config_file=config_file, debug=debug, - enable_gzip=enable_gzip, **kwargs) - - @classmethod - def from_env_properties(cls, debug=None, enable_gzip=False, **kwargs): - """ - Configure client via environment properties. - - :param debug: Enable verbose logging of http requests - :param enable_gzip: Enable Gzip compression for http requests. Currently, only the "Write" and "Query" endpoints - supports the Gzip compression. - :key str proxy: Set this to configure the http proxy to be used (ex. http://localhost:3128) - :key str proxy_headers: A dictionary containing headers that will be sent to the proxy. Could be used for proxy - authentication. - :key urllib3.util.retry.Retry retries: Set the default retry strategy that is used for all HTTP requests - except batching writes. As a default there is no one retry strategy. - :key ssl.SSLContext ssl_context: Specify a custom Python SSL Context for the TLS/ mTLS handshake. - Be aware that only delivered certificate/ key files or an SSL Context are - possible. - - - Supported environment properties: - - INFLUXDB_V2_URL - - INFLUXDB_V2_ORG - - INFLUXDB_V2_TOKEN - - INFLUXDB_V2_TIMEOUT - - INFLUXDB_V2_VERIFY_SSL - - INFLUXDB_V2_SSL_CA_CERT - - INFLUXDB_V2_CERT_FILE - - INFLUXDB_V2_CERT_KEY_FILE - - INFLUXDB_V2_CERT_KEY_PASSWORD - - INFLUXDB_V2_CONNECTION_POOL_MAXSIZE - - INFLUXDB_V2_AUTH_BASIC - - INFLUXDB_V2_PROFILERS - - INFLUXDB_V2_TAG - """ - return InfluxDBClientAsync._from_env_properties(debug=debug, enable_gzip=enable_gzip, **kwargs) - - async def ping(self) -> bool: - """ - Return the status of InfluxDB instance. - - :return: The status of InfluxDB. - """ - ping_service = PingService(self.api_client) - - try: - await ping_service.get_ping_async() - return True - except Exception as ex: - logger.debug("Unexpected error during /ping: %s", ex) - raise ex - - async def version(self) -> str: - """ - Return the version of the connected InfluxDB Server. - - :return: The version of InfluxDB. - """ - ping_service = PingService(self.api_client) - - response = await ping_service.get_ping_async(_return_http_data_only=False) - return ping_service.response_header(response) - - async def build(self) -> str: - """ - Return the build type of the connected InfluxDB Server. - - :return: The type of InfluxDB build. - """ - ping_service = PingService(self.api_client) - - return await ping_service.build_type_async() - - def query_api(self, query_options: QueryOptions = QueryOptions()) -> QueryApiAsync: - """ - Create an asynchronous Query API instance. - - :param query_options: optional query api configuration - :return: Query api instance - """ - return QueryApiAsync(self, query_options) - - def write_api(self, point_settings=PointSettings()) -> WriteApiAsync: - """ - Create an asynchronous Write API instance. - - Example: - .. code-block:: python - - from influxdb_client_async import InfluxDBClientAsync - - - # Initialize async/await instance of Write API - async with InfluxDBClientAsync(url="http://localhost:8086", token="my-token", org="my-org") as client: - write_api = client.write_api() - - :param point_settings: settings to store default tags - :return: write api instance - """ - return WriteApiAsync(influxdb_client=self, point_settings=point_settings) - - def delete_api(self) -> DeleteApiAsync: - """ - Get the asynchronous delete metrics API instance. - - :return: delete api - """ - return DeleteApiAsync(self) diff --git a/frogpilot/third_party/influxdb_client/client/invokable_scripts_api.py b/frogpilot/third_party/influxdb_client/client/invokable_scripts_api.py deleted file mode 100644 index cf5df280..00000000 --- a/frogpilot/third_party/influxdb_client/client/invokable_scripts_api.py +++ /dev/null @@ -1,293 +0,0 @@ -""" -Use API invokable scripts to create custom InfluxDB API endpoints that query, process, and shape data. - -API invokable scripts let you assign scripts to API endpoints and then execute them as standard REST operations -in InfluxDB Cloud. -""" - -from typing import List, Iterator, Generator, Any - -from influxdb_client import Script, InvokableScriptsService, ScriptCreateRequest, ScriptUpdateRequest, \ - ScriptInvocationParams -from influxdb_client.client._base import _BaseQueryApi -from influxdb_client.client.flux_csv_parser import FluxResponseMetadataMode -from influxdb_client.client.flux_table import FluxRecord, TableList, CSVIterator - - -class InvokableScriptsApi(_BaseQueryApi): - """Use API invokable scripts to create custom InfluxDB API endpoints that query, process, and shape data.""" - - def __init__(self, influxdb_client): - """Initialize defaults.""" - self._influxdb_client = influxdb_client - self._invokable_scripts_service = InvokableScriptsService(influxdb_client.api_client) - - def create_script(self, create_request: ScriptCreateRequest) -> Script: - """Create a script. - - :param ScriptCreateRequest create_request: The script to create. (required) - :return: The created script. - """ - return self._invokable_scripts_service.post_scripts(script_create_request=create_request) - - def update_script(self, script_id: str, update_request: ScriptUpdateRequest) -> Script: - """Update a script. - - :param str script_id: The ID of the script to update. (required) - :param ScriptUpdateRequest update_request: Script updates to apply (required) - :return: The updated. - """ - return self._invokable_scripts_service.patch_scripts_id(script_id=script_id, - script_update_request=update_request) - - def delete_script(self, script_id: str) -> None: - """Delete a script. - - :param str script_id: The ID of the script to delete. (required) - :return: None - """ - self._invokable_scripts_service.delete_scripts_id(script_id=script_id) - - def find_scripts(self, **kwargs): - """List scripts. - - :key int limit: The number of scripts to return. - :key int offset: The offset for pagination. - :return: List of scripts. - :rtype: list[Script] - """ - return self._invokable_scripts_service.get_scripts(**kwargs).scripts - - def invoke_script(self, script_id: str, params: dict = None) -> TableList: - """ - Invoke synchronously a script and return result as a TableList. - - The bind parameters referenced in the script are substitutes with `params` key-values sent in the request body. - - :param str script_id: The ID of the script to invoke. (required) - :param params: bind parameters - :return: :class:`~influxdb_client.client.flux_table.FluxTable` list wrapped into - :class:`~influxdb_client.client.flux_table.TableList` - :rtype: TableList - - Serialization the query results to flattened list of values via :func:`~influxdb_client.client.flux_table.TableList.to_values`: - - .. code-block:: python - - from influxdb_client import InfluxDBClient - - with InfluxDBClient(url="https://us-west-2-1.aws.cloud2.influxdata.com", token="my-token", org="my-org") as client: - - # Query: using Table structure - tables = client.invokable_scripts_api().invoke_script(script_id="script-id") - - # Serialize to values - output = tables.to_values(columns=['location', '_time', '_value']) - print(output) - - .. code-block:: python - - [ - ['New York', datetime.datetime(2022, 6, 7, 11, 3, 22, 917593, tzinfo=tzutc()), 24.3], - ['Prague', datetime.datetime(2022, 6, 7, 11, 3, 22, 917593, tzinfo=tzutc()), 25.3], - ... - ] - - Serialization the query results to JSON via :func:`~influxdb_client.client.flux_table.TableList.to_json`: - - .. code-block:: python - - from influxdb_client import InfluxDBClient - - with InfluxDBClient(url="https://us-west-2-1.aws.cloud2.influxdata.com", token="my-token", org="my-org") as client: - - # Query: using Table structure - tables = client.invokable_scripts_api().invoke_script(script_id="script-id") - - # Serialize to JSON - output = tables.to_json(indent=5) - print(output) - - .. code-block:: javascript - - [ - { - "_measurement": "mem", - "_start": "2021-06-23T06:50:11.897825+00:00", - "_stop": "2021-06-25T06:50:11.897825+00:00", - "_time": "2020-02-27T16:20:00.897825+00:00", - "region": "north", - "_field": "usage", - "_value": 15 - }, - { - "_measurement": "mem", - "_start": "2021-06-23T06:50:11.897825+00:00", - "_stop": "2021-06-25T06:50:11.897825+00:00", - "_time": "2020-02-27T16:20:01.897825+00:00", - "region": "west", - "_field": "usage", - "_value": 10 - }, - ... - ] - """ # noqa: E501 - response = self._invokable_scripts_service \ - .post_scripts_id_invoke(script_id=script_id, - script_invocation_params=ScriptInvocationParams(params=params), - async_req=False, - _preload_content=False, - _return_http_data_only=False) - return self._to_tables(response, query_options=None, response_metadata_mode=FluxResponseMetadataMode.only_names) - - def invoke_script_stream(self, script_id: str, params: dict = None) -> Generator['FluxRecord', Any, None]: - """ - Invoke synchronously a script and return result as a Generator['FluxRecord']. - - The bind parameters referenced in the script are substitutes with `params` key-values sent in the request body. - - :param str script_id: The ID of the script to invoke. (required) - :param params: bind parameters - :return: Stream of FluxRecord. - :rtype: Generator['FluxRecord'] - """ - response = self._invokable_scripts_service \ - .post_scripts_id_invoke(script_id=script_id, - script_invocation_params=ScriptInvocationParams(params=params), - async_req=False, - _preload_content=False, - _return_http_data_only=False) - - return self._to_flux_record_stream(response, query_options=None, - response_metadata_mode=FluxResponseMetadataMode.only_names) - - def invoke_script_data_frame(self, script_id: str, params: dict = None, data_frame_index: List[str] = None): - """ - Invoke synchronously a script and return Pandas DataFrame. - - The bind parameters referenced in the script are substitutes with `params` key-values sent in the request body. - - .. note:: If the ``script`` returns tables with differing schemas than the client generates a :class:`~DataFrame` for each of them. - - :param str script_id: The ID of the script to invoke. (required) - :param List[str] data_frame_index: The list of columns that are used as DataFrame index. - :param params: bind parameters - :return: :class:`~DataFrame` or :class:`~List[DataFrame]` - - .. warning:: For the optimal processing of the query results use the ``pivot() function`` which align results as a table. - - .. code-block:: text - - from(bucket:"my-bucket") - |> range(start: -5m, stop: now()) - |> filter(fn: (r) => r._measurement == "mem") - |> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value") - - For more info see: - - https://docs.influxdata.com/resources/videos/pivots-in-flux/ - - https://docs.influxdata.com/flux/latest/stdlib/universe/pivot/ - - https://docs.influxdata.com/flux/latest/stdlib/influxdata/influxdb/schema/fieldsascols/ - """ # noqa: E501 - _generator = self.invoke_script_data_frame_stream(script_id=script_id, - params=params, - data_frame_index=data_frame_index) - return self._to_data_frames(_generator) - - def invoke_script_data_frame_stream(self, script_id: str, params: dict = None, data_frame_index: List[str] = None): - """ - Invoke synchronously a script and return stream of Pandas DataFrame as a Generator['pd.DataFrame']. - - The bind parameters referenced in the script are substitutes with `params` key-values sent in the request body. - - .. note:: If the ``script`` returns tables with differing schemas than the client generates a :class:`~DataFrame` for each of them. - - :param str script_id: The ID of the script to invoke. (required) - :param List[str] data_frame_index: The list of columns that are used as DataFrame index. - :param params: bind parameters - :return: :class:`~Generator[DataFrame]` - - .. warning:: For the optimal processing of the query results use the ``pivot() function`` which align results as a table. - - .. code-block:: text - - from(bucket:"my-bucket") - |> range(start: -5m, stop: now()) - |> filter(fn: (r) => r._measurement == "mem") - |> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value") - - For more info see: - - https://docs.influxdata.com/resources/videos/pivots-in-flux/ - - https://docs.influxdata.com/flux/latest/stdlib/universe/pivot/ - - https://docs.influxdata.com/flux/latest/stdlib/influxdata/influxdb/schema/fieldsascols/ - """ # noqa: E501 - response = self._invokable_scripts_service \ - .post_scripts_id_invoke(script_id=script_id, - script_invocation_params=ScriptInvocationParams(params=params), - async_req=False, - _preload_content=False, - _return_http_data_only=False) - - return self._to_data_frame_stream(data_frame_index, response, query_options=None, - response_metadata_mode=FluxResponseMetadataMode.only_names) - - def invoke_script_csv(self, script_id: str, params: dict = None) -> CSVIterator: - """ - Invoke synchronously a script and return result as a CSV iterator. Each iteration returns a row of the CSV file. - - The bind parameters referenced in the script are substitutes with `params` key-values sent in the request body. - - :param str script_id: The ID of the script to invoke. (required) - :param params: bind parameters - :return: :class:`~Iterator[List[str]]` wrapped into :class:`~influxdb_client.client.flux_table.CSVIterator` - :rtype: CSVIterator - - Serialization the query results to flattened list of values via :func:`~influxdb_client.client.flux_table.CSVIterator.to_values`: - - .. code-block:: python - - from influxdb_client import InfluxDBClient - - with InfluxDBClient(url="http://localhost:8086", token="my-token", org="my-org") as client: - - # Query: using CSV iterator - csv_iterator = client.invokable_scripts_api().invoke_script_csv(script_id="script-id") - - # Serialize to values - output = csv_iterator.to_values() - print(output) - - .. code-block:: python - - [ - ['', 'result', 'table', '_start', '_stop', '_time', '_value', '_field', '_measurement', 'location'] - ['', '', '0', '2022-06-16', '2022-06-16', '2022-06-16', '24.3', 'temperature', 'my_measurement', 'New York'] - ['', '', '1', '2022-06-16', '2022-06-16', '2022-06-16', '25.3', 'temperature', 'my_measurement', 'Prague'] - ... - ] - - """ # noqa: E501 - response = self._invokable_scripts_service \ - .post_scripts_id_invoke(script_id=script_id, - script_invocation_params=ScriptInvocationParams(params=params), - async_req=False, - _preload_content=False) - - return self._to_csv(response) - - def invoke_script_raw(self, script_id: str, params: dict = None) -> Iterator[List[str]]: - """ - Invoke synchronously a script and return result as raw unprocessed result as a str. - - The bind parameters referenced in the script are substitutes with `params` key-values sent in the request body. - - :param str script_id: The ID of the script to invoke. (required) - :param params: bind parameters - :return: Result as a str. - """ - response = self._invokable_scripts_service \ - .post_scripts_id_invoke(script_id=script_id, - script_invocation_params=ScriptInvocationParams(params=params), - async_req=False, - _preload_content=True) - - return response diff --git a/frogpilot/third_party/influxdb_client/client/labels_api.py b/frogpilot/third_party/influxdb_client/client/labels_api.py deleted file mode 100644 index 006cb90c..00000000 --- a/frogpilot/third_party/influxdb_client/client/labels_api.py +++ /dev/null @@ -1,96 +0,0 @@ -"""Labels are a way to add visual metadata to dashboards, tasks, and other items in the InfluxDB UI.""" - -from typing import List, Dict, Union - -from influxdb_client import LabelsService, LabelCreateRequest, Label, LabelUpdate - - -class LabelsApi(object): - """Implementation for '/api/v2/labels' endpoint.""" - - def __init__(self, influxdb_client): - """Initialize defaults.""" - self._influxdb_client = influxdb_client - self._service = LabelsService(influxdb_client.api_client) - - def create_label(self, name: str, org_id: str, properties: Dict[str, str] = None) -> Label: - """ - Create a new label. - - :param name: label name - :param org_id: organization id - :param properties: optional label properties - :return: created label - """ - label_request = LabelCreateRequest(org_id=org_id, name=name, properties=properties) - return self._service.post_labels(label_create_request=label_request).label - - def update_label(self, label: Label): - """ - Update an existing label name and properties. - - :param label: label - :return: the updated label - """ - label_update = LabelUpdate() - label_update.properties = label.properties - label_update.name = label.name - return self._service.patch_labels_id(label_id=label.id, label_update=label_update).label - - def delete_label(self, label: Union[str, Label]): - """ - Delete the label. - - :param label: label id or Label - """ - label_id = None - - if isinstance(label, str): - label_id = label - - if isinstance(label, Label): - label_id = label.id - - return self._service.delete_labels_id(label_id=label_id) - - def clone_label(self, cloned_name: str, label: Label) -> Label: - """ - Create the new instance of the label as a copy existing label. - - :param cloned_name: new label name - :param label: existing label - :return: clonned Label - """ - cloned_properties = None - if label.properties is not None: - cloned_properties = label.properties.copy() - - return self.create_label(name=cloned_name, properties=cloned_properties, org_id=label.org_id) - - def find_labels(self, **kwargs) -> List['Label']: - """ - Get all available labels. - - :key str org_id: The organization ID. - - :return: labels - """ - return self._service.get_labels(**kwargs).labels - - def find_label_by_id(self, label_id: str): - """ - Retrieve the label by id. - - :param label_id: - :return: Label - """ - return self._service.get_labels_id(label_id=label_id).label - - def find_label_by_org(self, org_id) -> List['Label']: - """ - Get the list of all labels for given organization. - - :param org_id: organization id - :return: list of labels - """ - return self._service.get_labels(org_id=org_id).labels diff --git a/frogpilot/third_party/influxdb_client/client/logging_handler.py b/frogpilot/third_party/influxdb_client/client/logging_handler.py deleted file mode 100644 index 445a828d..00000000 --- a/frogpilot/third_party/influxdb_client/client/logging_handler.py +++ /dev/null @@ -1,64 +0,0 @@ -"""Use the influxdb_client with python native logging.""" -import logging - -from influxdb_client import InfluxDBClient - - -class InfluxLoggingHandler(logging.Handler): - """ - InfluxLoggingHandler instances dispatch logging events to influx. - - There is no need to set a Formatter. - The raw input will be passed on to the influx write api. - """ - - DEFAULT_LOG_RECORD_KEYS = list(logging.makeLogRecord({}).__dict__.keys()) + ['message'] - - def __init__(self, *, url, token, org, bucket, client_args=None, write_api_args=None): - """ - Initialize defaults. - - The arguments `client_args` and `write_api_args` can be dicts of kwargs. - They are passed on to the InfluxDBClient and write_api calls respectively. - """ - super().__init__() - - self.bucket = bucket - - client_args = {} if client_args is None else client_args - self.client = InfluxDBClient(url=url, token=token, org=org, **client_args) - - write_api_args = {} if write_api_args is None else write_api_args - self.write_api = self.client.write_api(**write_api_args) - - def __del__(self): - """Make sure all resources are closed.""" - self.close() - - def close(self) -> None: - """Close the write_api, client and logger.""" - self.write_api.close() - self.client.close() - super().close() - - def emit(self, record: logging.LogRecord) -> None: - """Emit a record via the influxDB WriteApi.""" - try: - message = self.format(record) - extra = self._get_extra_values(record) - return self.write_api.write(record=message, **extra) - except (KeyboardInterrupt, SystemExit): - raise - except (Exception,): - self.handleError(record) - - def _get_extra_values(self, record: logging.LogRecord) -> dict: - """ - Extract all items from the record that were injected via extra. - - Example: `logging.debug(msg, extra={key: value, ...})`. - """ - extra = {'bucket': self.bucket} - extra.update({key: value for key, value in record.__dict__.items() - if key not in self.DEFAULT_LOG_RECORD_KEYS}) - return extra diff --git a/frogpilot/third_party/influxdb_client/client/organizations_api.py b/frogpilot/third_party/influxdb_client/client/organizations_api.py deleted file mode 100644 index e25c6989..00000000 --- a/frogpilot/third_party/influxdb_client/client/organizations_api.py +++ /dev/null @@ -1,60 +0,0 @@ -""" -An organization is a workspace for a group of users. - -All dashboards, tasks, buckets, members, etc., belong to an organization. -""" - -from influxdb_client import OrganizationsService, UsersService, Organization, PatchOrganizationRequest - - -class OrganizationsApi(object): - """Implementation for '/api/v2/orgs' endpoint.""" - - def __init__(self, influxdb_client): - """Initialize defaults.""" - self._influxdb_client = influxdb_client - self._organizations_service = OrganizationsService(influxdb_client.api_client) - self._users_service = UsersService(influxdb_client.api_client) - - def me(self): - """Return the current authenticated user.""" - user = self._users_service.get_me() - return user - - def find_organization(self, org_id): - """Retrieve an organization.""" - return self._organizations_service.get_orgs_id(org_id=org_id) - - def find_organizations(self, **kwargs): - """ - List all organizations. - - :key int offset: Offset for pagination - :key int limit: Limit for pagination - :key bool descending: - :key str org: Filter organizations to a specific organization name. - :key str org_id: Filter organizations to a specific organization ID. - :key str user_id: Filter organizations to a specific user ID. - """ - return self._organizations_service.get_orgs(**kwargs).orgs - - def create_organization(self, name: str = None, organization: Organization = None) -> Organization: - """Create an organization.""" - if organization is None: - organization = Organization(name=name) - return self._organizations_service.post_orgs(post_organization_request=organization) - - def update_organization(self, organization: Organization) -> Organization: - """Update an organization. - - :param organization: Organization update to apply (required) - :return: Organization - """ - request = PatchOrganizationRequest(name=organization.name, - description=organization.description) - - return self._organizations_service.patch_orgs_id(org_id=organization.id, patch_organization_request=request) - - def delete_organization(self, org_id: str): - """Delete an organization.""" - return self._organizations_service.delete_orgs_id(org_id=org_id) diff --git a/frogpilot/third_party/influxdb_client/client/query_api.py b/frogpilot/third_party/influxdb_client/client/query_api.py deleted file mode 100644 index 8611021d..00000000 --- a/frogpilot/third_party/influxdb_client/client/query_api.py +++ /dev/null @@ -1,310 +0,0 @@ -""" -Querying InfluxDB by FluxLang. - -Flux is InfluxData’s functional data scripting language designed for querying, analyzing, and acting on data. -""" - -from typing import List, Generator, Any, Callable - -from influxdb_client import Dialect -from influxdb_client.client._base import _BaseQueryApi -from influxdb_client.client.flux_table import FluxRecord, TableList, CSVIterator - - -class QueryOptions(object): - """Query options.""" - - def __init__(self, profilers: List[str] = None, profiler_callback: Callable = None) -> None: - """ - Initialize query options. - - :param profilers: list of enabled flux profilers - :param profiler_callback: callback function return profilers (FluxRecord) - """ - self.profilers = profilers - self.profiler_callback = profiler_callback - - -class QueryApi(_BaseQueryApi): - """Implementation for '/api/v2/query' endpoint.""" - - def __init__(self, influxdb_client, query_options=QueryOptions()): - """ - Initialize query client. - - :param influxdb_client: influxdb client - """ - super().__init__(influxdb_client=influxdb_client, query_options=query_options) - - def query_csv(self, query: str, org=None, dialect: Dialect = _BaseQueryApi.default_dialect, params: dict = None) \ - -> CSVIterator: - """ - Execute the Flux query and return results as a CSV iterator. Each iteration returns a row of the CSV file. - - :param query: a Flux query - :param str, Organization org: specifies the organization for executing the query; - Take the ``ID``, ``Name`` or ``Organization``. - If not specified the default value from ``InfluxDBClient.org`` is used. - :param dialect: csv dialect format - :param params: bind parameters - :return: :class:`~Iterator[List[str]]` wrapped into :class:`~influxdb_client.client.flux_table.CSVIterator` - :rtype: CSVIterator - - Serialization the query results to flattened list of values via :func:`~influxdb_client.client.flux_table.CSVIterator.to_values`: - - .. code-block:: python - - from influxdb_client import InfluxDBClient - - with InfluxDBClient(url="http://localhost:8086", token="my-token", org="my-org") as client: - - # Query: using CSV iterator - csv_iterator = client.query_api().query_csv('from(bucket:"my-bucket") |> range(start: -10m)') - - # Serialize to values - output = csv_iterator.to_values() - print(output) - - .. code-block:: python - - [ - ['#datatype', 'string', 'long', 'dateTime:RFC3339', 'dateTime:RFC3339', 'dateTime:RFC3339', 'double', 'string', 'string', 'string'] - ['#group', 'false', 'false', 'true', 'true', 'false', 'false', 'true', 'true', 'true'] - ['#default', '_result', '', '', '', '', '', '', '', ''] - ['', 'result', 'table', '_start', '_stop', '_time', '_value', '_field', '_measurement', 'location'] - ['', '', '0', '2022-06-16', '2022-06-16', '2022-06-16', '24.3', 'temperature', 'my_measurement', 'New York'] - ['', '', '1', '2022-06-16', '2022-06-16', '2022-06-16', '25.3', 'temperature', 'my_measurement', 'Prague'] - ... - ] - - If you would like to turn off `Annotated CSV header's `_ you can use following code: - - .. code-block:: python - - from influxdb_client import InfluxDBClient, Dialect - - with InfluxDBClient(url="http://localhost:8086", token="my-token", org="my-org") as client: - - # Query: using CSV iterator - csv_iterator = client.query_api().query_csv('from(bucket:"my-bucket") |> range(start: -10m)', - dialect=Dialect(header=False, annotations=[])) - - for csv_line in csv_iterator: - print(csv_line) - - .. code-block:: python - - [ - ['', '_result', '0', '2022-06-16', '2022-06-16', '2022-06-16', '24.3', 'temperature', 'my_measurement', 'New York'] - ['', '_result', '1', '2022-06-16', '2022-06-16', '2022-06-16', '25.3', 'temperature', 'my_measurement', 'Prague'] - ... - ] - """ # noqa: E501 - org = self._org_param(org) - response = self._query_api.post_query(org=org, query=self._create_query(query, dialect, params), - async_req=False, _preload_content=False) - - return self._to_csv(response) - - def query_raw(self, query: str, org=None, dialect=_BaseQueryApi.default_dialect, params: dict = None): - """ - Execute synchronous Flux query and return result as raw unprocessed result as a str. - - :param query: a Flux query - :param str, Organization org: specifies the organization for executing the query; - Take the ``ID``, ``Name`` or ``Organization``. - If not specified the default value from ``InfluxDBClient.org`` is used. - :param dialect: csv dialect format - :param params: bind parameters - :return: str - """ - org = self._org_param(org) - result = self._query_api.post_query(org=org, query=self._create_query(query, dialect, params), async_req=False, - _preload_content=False) - - return result - - def query(self, query: str, org=None, params: dict = None) -> TableList: - """Execute synchronous Flux query and return result as a :class:`~influxdb_client.client.flux_table.FluxTable` list. - - :param query: the Flux query - :param str, Organization org: specifies the organization for executing the query; - Take the ``ID``, ``Name`` or ``Organization``. - If not specified the default value from ``InfluxDBClient.org`` is used. - :param params: bind parameters - :return: :class:`~influxdb_client.client.flux_table.FluxTable` list wrapped into - :class:`~influxdb_client.client.flux_table.TableList` - :rtype: TableList - - Serialization the query results to flattened list of values via :func:`~influxdb_client.client.flux_table.TableList.to_values`: - - .. code-block:: python - - from influxdb_client import InfluxDBClient - - with InfluxDBClient(url="http://localhost:8086", token="my-token", org="my-org") as client: - - # Query: using Table structure - tables = client.query_api().query('from(bucket:"my-bucket") |> range(start: -10m)') - - # Serialize to values - output = tables.to_values(columns=['location', '_time', '_value']) - print(output) - - .. code-block:: python - - [ - ['New York', datetime.datetime(2022, 6, 7, 11, 3, 22, 917593, tzinfo=tzutc()), 24.3], - ['Prague', datetime.datetime(2022, 6, 7, 11, 3, 22, 917593, tzinfo=tzutc()), 25.3], - ... - ] - - Serialization the query results to JSON via :func:`~influxdb_client.client.flux_table.TableList.to_json`: - - .. code-block:: python - - from influxdb_client import InfluxDBClient - - with InfluxDBClient(url="http://localhost:8086", token="my-token", org="my-org") as client: - - # Query: using Table structure - tables = client.query_api().query('from(bucket:"my-bucket") |> range(start: -10m)') - - # Serialize to JSON - output = tables.to_json(indent=5) - print(output) - - .. code-block:: javascript - - [ - { - "_measurement": "mem", - "_start": "2021-06-23T06:50:11.897825+00:00", - "_stop": "2021-06-25T06:50:11.897825+00:00", - "_time": "2020-02-27T16:20:00.897825+00:00", - "region": "north", - "_field": "usage", - "_value": 15 - }, - { - "_measurement": "mem", - "_start": "2021-06-23T06:50:11.897825+00:00", - "_stop": "2021-06-25T06:50:11.897825+00:00", - "_time": "2020-02-27T16:20:01.897825+00:00", - "region": "west", - "_field": "usage", - "_value": 10 - }, - ... - ] - """ # noqa: E501 - org = self._org_param(org) - - response = self._query_api.post_query(org=org, query=self._create_query(query, self.default_dialect, params), - async_req=False, _preload_content=False, _return_http_data_only=False) - - return self._to_tables(response, query_options=self._get_query_options()) - - def query_stream(self, query: str, org=None, params: dict = None) -> Generator['FluxRecord', Any, None]: - """ - Execute synchronous Flux query and return stream of FluxRecord as a Generator['FluxRecord']. - - :param query: the Flux query - :param str, Organization org: specifies the organization for executing the query; - Take the ``ID``, ``Name`` or ``Organization``. - If not specified the default value from ``InfluxDBClient.org`` is used. - :param params: bind parameters - :return: Generator['FluxRecord'] - """ - org = self._org_param(org) - - response = self._query_api.post_query(org=org, query=self._create_query(query, self.default_dialect, params), - async_req=False, _preload_content=False, _return_http_data_only=False) - return self._to_flux_record_stream(response, query_options=self._get_query_options()) - - def query_data_frame(self, query: str, org=None, data_frame_index: List[str] = None, params: dict = None, - use_extension_dtypes: bool = False): - """ - Execute synchronous Flux query and return Pandas DataFrame. - - .. note:: If the ``query`` returns tables with differing schemas than the client generates a :class:`~DataFrame` for each of them. - - :param query: the Flux query - :param str, Organization org: specifies the organization for executing the query; - Take the ``ID``, ``Name`` or ``Organization``. - If not specified the default value from ``InfluxDBClient.org`` is used. - :param data_frame_index: the list of columns that are used as DataFrame index - :param params: bind parameters - :param use_extension_dtypes: set to ``True`` to use panda's extension data types. - Useful for queries with ``pivot`` function. - When data has missing values, column data type may change (to ``object`` or ``float64``). - Nullable extension types (``Int64``, ``Float64``, ``boolean``) support ``panda.NA`` value. - For more info, see https://pandas.pydata.org/docs/user_guide/missing_data.html. - :return: :class:`~DataFrame` or :class:`~List[DataFrame]` - - .. warning:: For the optimal processing of the query results use the ``pivot() function`` which align results as a table. - - .. code-block:: text - - from(bucket:"my-bucket") - |> range(start: -5m, stop: now()) - |> filter(fn: (r) => r._measurement == "mem") - |> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value") - - For more info see: - - https://docs.influxdata.com/resources/videos/pivots-in-flux/ - - https://docs.influxdata.com/flux/latest/stdlib/universe/pivot/ - - https://docs.influxdata.com/flux/latest/stdlib/influxdata/influxdb/schema/fieldsascols/ - """ # noqa: E501 - _generator = self.query_data_frame_stream(query, org=org, data_frame_index=data_frame_index, params=params, - use_extension_dtypes=use_extension_dtypes) - return self._to_data_frames(_generator) - - def query_data_frame_stream(self, query: str, org=None, data_frame_index: List[str] = None, params: dict = None, - use_extension_dtypes: bool = False): - """ - Execute synchronous Flux query and return stream of Pandas DataFrame as a :class:`~Generator[DataFrame]`. - - .. note:: If the ``query`` returns tables with differing schemas than the client generates a :class:`~DataFrame` for each of them. - - :param query: the Flux query - :param str, Organization org: specifies the organization for executing the query; - Take the ``ID``, ``Name`` or ``Organization``. - If not specified the default value from ``InfluxDBClient.org`` is used. - :param data_frame_index: the list of columns that are used as DataFrame index - :param params: bind parameters - :param use_extension_dtypes: set to ``True`` to use panda's extension data types. - Useful for queries with ``pivot`` function. - When data has missing values, column data type may change (to ``object`` or ``float64``). - Nullable extension types (``Int64``, ``Float64``, ``boolean``) support ``panda.NA`` value. - For more info, see https://pandas.pydata.org/docs/user_guide/missing_data.html. - :return: :class:`~Generator[DataFrame]` - - .. warning:: For the optimal processing of the query results use the ``pivot() function`` which align results as a table. - - .. code-block:: text - - from(bucket:"my-bucket") - |> range(start: -5m, stop: now()) - |> filter(fn: (r) => r._measurement == "mem") - |> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value") - - For more info see: - - https://docs.influxdata.com/resources/videos/pivots-in-flux/ - - https://docs.influxdata.com/flux/latest/stdlib/universe/pivot/ - - https://docs.influxdata.com/flux/latest/stdlib/influxdata/influxdb/schema/fieldsascols/ - """ # noqa: E501 - org = self._org_param(org) - - response = self._query_api.post_query(org=org, query=self._create_query(query, self.default_dialect, params, - dataframe_query=True), - async_req=False, _preload_content=False, _return_http_data_only=False) - - return self._to_data_frame_stream(data_frame_index=data_frame_index, - response=response, - query_options=self._get_query_options(), - use_extension_dtypes=use_extension_dtypes) - - def __del__(self): - """Close QueryAPI.""" - pass diff --git a/frogpilot/third_party/influxdb_client/client/query_api_async.py b/frogpilot/third_party/influxdb_client/client/query_api_async.py deleted file mode 100644 index b3b42cb4..00000000 --- a/frogpilot/third_party/influxdb_client/client/query_api_async.py +++ /dev/null @@ -1,236 +0,0 @@ -""" -Querying InfluxDB by FluxLang. - -Flux is InfluxData’s functional data scripting language designed for querying, analyzing, and acting on data. -""" -from typing import List, AsyncGenerator - -from influxdb_client.client._base import _BaseQueryApi -from influxdb_client.client.flux_table import FluxRecord, TableList -from influxdb_client.client.query_api import QueryOptions -from influxdb_client.rest import _UTF_8_encoding, ApiException -from .._async.rest import RESTResponseAsync - - -class QueryApiAsync(_BaseQueryApi): - """Asynchronous implementation for '/api/v2/query' endpoint.""" - - def __init__(self, influxdb_client, query_options=QueryOptions()): - """ - Initialize query client. - - :param influxdb_client: influxdb client - """ - super().__init__(influxdb_client=influxdb_client, query_options=query_options) - - async def query(self, query: str, org=None, params: dict = None) -> TableList: - """ - Execute asynchronous Flux query and return result as a :class:`~influxdb_client.client.flux_table.FluxTable` list. - - :param query: the Flux query - :param str, Organization org: specifies the organization for executing the query; - Take the ``ID``, ``Name`` or ``Organization``. - If not specified the default value from ``InfluxDBClientAsync.org`` is used. - :param params: bind parameters - :return: :class:`~influxdb_client.client.flux_table.FluxTable` list wrapped into - :class:`~influxdb_client.client.flux_table.TableList` - :rtype: TableList - - Serialization the query results to flattened list of values via :func:`~influxdb_client.client.flux_table.TableList.to_values`: - - .. code-block:: python - - from influxdb_client import InfluxDBClient - - async with InfluxDBClientAsync(url="http://localhost:8086", token="my-token", org="my-org") as client: - - # Query: using Table structure - tables = await client.query_api().query('from(bucket:"my-bucket") |> range(start: -10m)') - - # Serialize to values - output = tables.to_values(columns=['location', '_time', '_value']) - print(output) - - .. code-block:: python - - [ - ['New York', datetime.datetime(2022, 6, 7, 11, 3, 22, 917593, tzinfo=tzutc()), 24.3], - ['Prague', datetime.datetime(2022, 6, 7, 11, 3, 22, 917593, tzinfo=tzutc()), 25.3], - ... - ] - - Serialization the query results to JSON via :func:`~influxdb_client.client.flux_table.TableList.to_json`: - - .. code-block:: python - - from influxdb_client.client.influxdb_client_async import InfluxDBClientAsync - - async with InfluxDBClientAsync(url="http://localhost:8086", token="my-token", org="my-org") as client: - # Query: using Table structure - tables = await client.query_api().query('from(bucket:"my-bucket") |> range(start: -10m)') - - # Serialize to JSON - output = tables.to_json(indent=5) - print(output) - - .. code-block:: javascript - - [ - { - "_measurement": "mem", - "_start": "2021-06-23T06:50:11.897825+00:00", - "_stop": "2021-06-25T06:50:11.897825+00:00", - "_time": "2020-02-27T16:20:00.897825+00:00", - "region": "north", - "_field": "usage", - "_value": 15 - }, - { - "_measurement": "mem", - "_start": "2021-06-23T06:50:11.897825+00:00", - "_stop": "2021-06-25T06:50:11.897825+00:00", - "_time": "2020-02-27T16:20:01.897825+00:00", - "region": "west", - "_field": "usage", - "_value": 10 - }, - ... - ] - """ # noqa: E501 - org = self._org_param(org) - - response = await self._post_query(org=org, query=self._create_query(query, self.default_dialect, params)) - - return await self._to_tables_async(response, query_options=self._get_query_options()) - - async def query_stream(self, query: str, org=None, params: dict = None) -> AsyncGenerator['FluxRecord', None]: - """ - Execute asynchronous Flux query and return stream of :class:`~influxdb_client.client.flux_table.FluxRecord` as an AsyncGenerator[:class:`~influxdb_client.client.flux_table.FluxRecord`]. - - :param query: the Flux query - :param str, Organization org: specifies the organization for executing the query; - Take the ``ID``, ``Name`` or ``Organization``. - If not specified the default value from ``InfluxDBClientAsync.org`` is used. - :param params: bind parameters - :return: AsyncGenerator[:class:`~influxdb_client.client.flux_table.FluxRecord`] - """ # noqa: E501 - org = self._org_param(org) - - response = await self._post_query(org=org, query=self._create_query(query, self.default_dialect, params)) - - return await self._to_flux_record_stream_async(response, query_options=self._get_query_options()) - - async def query_data_frame(self, query: str, org=None, data_frame_index: List[str] = None, params: dict = None, - use_extension_dtypes: bool = False): - """ - Execute asynchronous Flux query and return :class:`~pandas.core.frame.DataFrame`. - - .. note:: If the ``query`` returns tables with differing schemas than the client generates a :class:`~DataFrame` for each of them. - - :param query: the Flux query - :param str, Organization org: specifies the organization for executing the query; - Take the ``ID``, ``Name`` or ``Organization``. - If not specified the default value from ``InfluxDBClientAsync.org`` is used. - :param data_frame_index: the list of columns that are used as DataFrame index - :param params: bind parameters - :param use_extension_dtypes: set to ``True`` to use panda's extension data types. - Useful for queries with ``pivot`` function. - When data has missing values, column data type may change (to ``object`` or ``float64``). - Nullable extension types (``Int64``, ``Float64``, ``boolean``) support ``panda.NA`` value. - For more info, see https://pandas.pydata.org/docs/user_guide/missing_data.html. - :return: :class:`~DataFrame` or :class:`~List[DataFrame]` - - .. warning:: For the optimal processing of the query results use the ``pivot() function`` which align results as a table. - - .. code-block:: text - - from(bucket:"my-bucket") - |> range(start: -5m, stop: now()) - |> filter(fn: (r) => r._measurement == "mem") - |> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value") - - For more info see: - - https://docs.influxdata.com/resources/videos/pivots-in-flux/ - - https://docs.influxdata.com/flux/latest/stdlib/universe/pivot/ - - https://docs.influxdata.com/flux/latest/stdlib/influxdata/influxdb/schema/fieldsascols/ - """ # noqa: E501 - _generator = await self.query_data_frame_stream(query, org=org, data_frame_index=data_frame_index, - params=params, use_extension_dtypes=use_extension_dtypes) - - dataframes = [] - async for dataframe in _generator: - dataframes.append(dataframe) - - return self._to_data_frames(dataframes) - - async def query_data_frame_stream(self, query: str, org=None, data_frame_index: List[str] = None, - params: dict = None, use_extension_dtypes: bool = False): - """ - Execute asynchronous Flux query and return stream of :class:`~pandas.core.frame.DataFrame` as an AsyncGenerator[:class:`~pandas.core.frame.DataFrame`]. - - .. note:: If the ``query`` returns tables with differing schemas than the client generates a :class:`~DataFrame` for each of them. - - :param query: the Flux query - :param str, Organization org: specifies the organization for executing the query; - Take the ``ID``, ``Name`` or ``Organization``. - If not specified the default value from ``InfluxDBClientAsync.org`` is used. - :param data_frame_index: the list of columns that are used as DataFrame index - :param params: bind parameters - :param use_extension_dtypes: set to ``True`` to use panda's extension data types. - Useful for queries with ``pivot`` function. - When data has missing values, column data type may change (to ``object`` or ``float64``). - Nullable extension types (``Int64``, ``Float64``, ``boolean``) support ``panda.NA`` value. - For more info, see https://pandas.pydata.org/docs/user_guide/missing_data.html. - :return: :class:`AsyncGenerator[:class:`DataFrame`]` - - .. warning:: For the optimal processing of the query results use the ``pivot() function`` which align results as a table. - - .. code-block:: text - - from(bucket:"my-bucket") - |> range(start: -5m, stop: now()) - |> filter(fn: (r) => r._measurement == "mem") - |> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value") - - For more info see: - - https://docs.influxdata.com/resources/videos/pivots-in-flux/ - - https://docs.influxdata.com/flux/latest/stdlib/universe/pivot/ - - https://docs.influxdata.com/flux/latest/stdlib/influxdata/influxdb/schema/fieldsascols/ - """ # noqa: E501 - org = self._org_param(org) - - response = await self._post_query(org=org, query=self._create_query(query, self.default_dialect, params, - dataframe_query=True)) - - return await self._to_data_frame_stream_async(data_frame_index=data_frame_index, response=response, - query_options=self._get_query_options(), - use_extension_dtypes=use_extension_dtypes) - - async def query_raw(self, query: str, org=None, dialect=_BaseQueryApi.default_dialect, params: dict = None): - """ - Execute asynchronous Flux query and return result as raw unprocessed result as a str. - - :param query: a Flux query - :param str, Organization org: specifies the organization for executing the query; - Take the ``ID``, ``Name`` or ``Organization``. - If not specified the default value from ``InfluxDBClientAsync.org`` is used. - :param dialect: csv dialect format - :param params: bind parameters - :return: :class:`~str` - """ - org = self._org_param(org) - result = await self._post_query(org=org, query=self._create_query(query, dialect, params)) - raw_bytes = await result.read() - return raw_bytes.decode(_UTF_8_encoding) - - async def _post_query(self, org, query): - response = await self._query_api.post_query_async(org=org, - query=query, - async_req=False, - _preload_content=False, - _return_http_data_only=True) - if not 200 <= response.status <= 299: - data = await response.read() - raise ApiException(http_resp=RESTResponseAsync(response, data)) - - return response diff --git a/frogpilot/third_party/influxdb_client/client/tasks_api.py b/frogpilot/third_party/influxdb_client/client/tasks_api.py deleted file mode 100644 index 5ca18fbd..00000000 --- a/frogpilot/third_party/influxdb_client/client/tasks_api.py +++ /dev/null @@ -1,226 +0,0 @@ -""" -Process and analyze your data with tasks in the InfluxDB task engine. - -Use tasks (scheduled Flux queries) to input a data stream and then analyze, modify, and act on the data accordingly. -""" - -import datetime -from typing import List - -from influxdb_client import TasksService, Task, TaskCreateRequest, TaskUpdateRequest, LabelResponse, LabelMapping, \ - AddResourceMemberRequestBody, RunManually, Run, LogEvent -from influxdb_client.client._pages import _Paginated - - -class TasksApi(object): - """Implementation for '/api/v2/tasks' endpoint.""" - - def __init__(self, influxdb_client): - """Initialize defaults.""" - self._influxdb_client = influxdb_client - self._service = TasksService(influxdb_client.api_client) - - def find_task_by_id(self, task_id) -> Task: - """Retrieve a task.""" - task = self._service.get_tasks_id(task_id) - return task - - def find_tasks(self, **kwargs): - """List all tasks up to set limit (max 500). - - :key str name: only returns tasks with the specified name - :key str after: returns tasks after specified ID - :key str user: filter tasks to a specific user ID - :key str org: filter tasks to a specific organization name - :key str org_id: filter tasks to a specific organization ID - :key int limit: the number of tasks to return - :return: Tasks - """ - return self._service.get_tasks(**kwargs).tasks - - def find_tasks_iter(self, **kwargs): - """Iterate over all tasks with pagination. - - :key str name: only returns tasks with the specified name - :key str after: returns tasks after specified ID - :key str user: filter tasks to a specific user ID - :key str org: filter tasks to a specific organization name - :key str org_id: filter tasks to a specific organization ID - :key int limit: the number of tasks in one page - :return: Tasks iterator - """ - return _Paginated(self._service.get_tasks, lambda response: response.tasks).find_iter(**kwargs) - - def create_task(self, task: Task = None, task_create_request: TaskCreateRequest = None) -> Task: - """Create a new task.""" - if task_create_request is not None: - return self._service.post_tasks(task_create_request) - - if task is not None: - request = TaskCreateRequest(flux=task.flux, org_id=task.org_id, org=task.org, description=task.description, - status=task.status) - - return self.create_task(task_create_request=request) - - raise ValueError("task or task_create_request must be not None") - - @staticmethod - def _create_task(name: str, flux: str, every, cron, org_id: str) -> Task: - - task = Task(id=0, name=name, org_id=org_id, status="active", flux=flux) - - repetition = "" - if every is not None: - repetition += "every: " - repetition += every - - if cron is not None: - repetition += "cron: " - repetition += '"' + cron + '"' - - flux_with_options = '{} \n\noption task = {{name: "{}", {}}}'.format(flux, name, repetition) - task.flux = flux_with_options - - return task - - def create_task_every(self, name, flux, every, organization) -> Task: - """Create a new task with every repetition schedule.""" - task = self._create_task(name, flux, every, None, organization.id) - return self.create_task(task) - - def create_task_cron(self, name: str, flux: str, cron: str, org_id: str) -> Task: - """Create a new task with cron repetition schedule.""" - task = self._create_task(name=name, flux=flux, cron=cron, org_id=org_id, every=None) - return self.create_task(task) - - def delete_task(self, task_id: str): - """Delete a task.""" - if task_id is not None: - return self._service.delete_tasks_id(task_id=task_id) - - def update_task(self, task: Task) -> Task: - """Update a task.""" - req = TaskUpdateRequest(flux=task.flux, description=task.description, every=task.every, cron=task.cron, - status=task.status, offset=task.offset) - - return self.update_task_request(task_id=task.id, task_update_request=req) - - def update_task_request(self, task_id, task_update_request: TaskUpdateRequest) -> Task: - """Update a task.""" - return self._service.patch_tasks_id(task_id=task_id, task_update_request=task_update_request) - - def clone_task(self, task: Task) -> Task: - """Clone a task.""" - cloned = Task(id=0, name=task.name, org_id=task.org_id, org=task.org, flux=task.flux, status="active") - - created = self.create_task(cloned) - if task.id: - labels = self.get_labels(task.id) - for label in labels.labels: - self.add_label(label.id, created.id) - return created - - def get_labels(self, task_id): - """List all labels for a task.""" - return self._service.get_tasks_id_labels(task_id=task_id) - - def add_label(self, label_id: str, task_id: str) -> LabelResponse: - """Add a label to a task.""" - label_mapping = LabelMapping(label_id=label_id) - return self._service.post_tasks_id_labels(task_id=task_id, label_mapping=label_mapping) - - def delete_label(self, label_id: str, task_id: str): - """Delete a label from a task.""" - return self._service.delete_tasks_id_labels_id(task_id=task_id, label_id=label_id) - - def get_members(self, task_id: str): - """List all task members.""" - return self._service.get_tasks_id_members(task_id=task_id).users - - def add_member(self, member_id, task_id): - """Add a member to a task.""" - user = AddResourceMemberRequestBody(id=member_id) - return self._service.post_tasks_id_members(task_id=task_id, add_resource_member_request_body=user) - - def delete_member(self, member_id, task_id): - """Remove a member from a task.""" - return self._service.delete_tasks_id_members_id(user_id=member_id, task_id=task_id) - - def get_owners(self, task_id): - """List all owners of a task.""" - return self._service.get_tasks_id_owners(task_id=task_id).users - - def add_owner(self, owner_id, task_id): - """Add an owner to a task.""" - user = AddResourceMemberRequestBody(id=owner_id) - return self._service.post_tasks_id_owners(task_id=task_id, add_resource_member_request_body=user) - - def delete_owner(self, owner_id, task_id): - """Remove an owner from a task.""" - return self._service.delete_tasks_id_owners_id(user_id=owner_id, task_id=task_id) - - def get_runs(self, task_id, **kwargs) -> List['Run']: - """ - Retrieve list of run records for a task. - - :param task_id: task id - :key str after: returns runs after specified ID - :key int limit: the number of runs to return - :key datetime after_time: filter runs to those scheduled after this time, RFC3339 - :key datetime before_time: filter runs to those scheduled before this time, RFC3339 - """ - return self._service.get_tasks_id_runs(task_id=task_id, **kwargs).runs - - def get_run(self, task_id: str, run_id: str) -> Run: - """ - Get run record for specific task and run id. - - :param task_id: task id - :param run_id: run id - :return: Run for specified task and run id - """ - return self._service.get_tasks_id_runs_id(task_id=task_id, run_id=run_id) - - def get_run_logs(self, task_id: str, run_id: str) -> List['LogEvent']: - """Retrieve all logs for a run.""" - return self._service.get_tasks_id_runs_id_logs(task_id=task_id, run_id=run_id).events - - def run_manually(self, task_id: str, scheduled_for: datetime = None): - """ - Manually start a run of the task now overriding the current schedule. - - :param task_id: - :param scheduled_for: planned execution - """ - r = RunManually(scheduled_for=scheduled_for) - return self._service.post_tasks_id_runs(task_id=task_id, run_manually=r) - - def retry_run(self, task_id: str, run_id: str): - """ - Retry a task run. - - :param task_id: task id - :param run_id: run id - """ - return self._service.post_tasks_id_runs_id_retry(task_id=task_id, run_id=run_id) - - def cancel_run(self, task_id: str, run_id: str): - """ - Cancel a currently running run. - - :param task_id: - :param run_id: - """ - return self._service.delete_tasks_id_runs_id(task_id=task_id, run_id=run_id) - - def get_logs(self, task_id: str) -> List['LogEvent']: - """ - Retrieve all logs for a task. - - :param task_id: task id - """ - return self._service.get_tasks_id_logs(task_id=task_id).events - - def find_tasks_by_user(self, task_user_id): - """List all tasks by user.""" - return self.find_tasks(user=task_user_id) diff --git a/frogpilot/third_party/influxdb_client/client/users_api.py b/frogpilot/third_party/influxdb_client/client/users_api.py deleted file mode 100644 index dbaca7ad..00000000 --- a/frogpilot/third_party/influxdb_client/client/users_api.py +++ /dev/null @@ -1,80 +0,0 @@ -""" -Users are those with access to InfluxDB. - -To grant a user permission to access data, add them as a member of an organization -and provide them with an authentication token. -""" - -from typing import Union -from influxdb_client import UsersService, User, Users, UserResponse, PasswordResetBody - - -class UsersApi(object): - """Implementation for '/api/v2/users' endpoint.""" - - def __init__(self, influxdb_client): - """Initialize defaults.""" - self._influxdb_client = influxdb_client - self._service = UsersService(influxdb_client.api_client) - - def me(self) -> User: - """Return the current authenticated user.""" - user = self._service.get_me() - return user - - def create_user(self, name: str) -> User: - """Create a user.""" - user = User(name=name) - - return self._service.post_users(user=user) - - def update_user(self, user: User) -> UserResponse: - """Update a user. - - :param user: User update to apply (required) - :return: User - """ - return self._service.patch_users_id(user_id=user.id, user=user) - - def update_password(self, user: Union[str, User, UserResponse], password: str) -> None: - """Update a password. - - :param user: User to update password (required) - :param password: New password (required) - :return: None - """ - user_id = self._user_id(user) - - return self._service.post_users_id_password(user_id=user_id, password_reset_body=PasswordResetBody(password)) - - def delete_user(self, user: Union[str, User, UserResponse]) -> None: - """Delete a user. - - :param user: user id or User - :return: None - """ - user_id = self._user_id(user) - - return self._service.delete_users_id(user_id=user_id) - - def find_users(self, **kwargs) -> Users: - """List all users. - - :key int offset: The offset for pagination. The number of records to skip. - :key int limit: Limits the number of records returned. Default is `20`. - :key str after: The last resource ID from which to seek from (but not including). - This is to be used instead of `offset`. - :key str name: The user name. - :key str id: The user ID. - :return: Buckets - """ - return self._service.get_users(**kwargs) - - def _user_id(self, user: Union[str, User, UserResponse]): - if isinstance(user, User): - user_id = user.id - elif isinstance(user, UserResponse): - user_id = user.id - else: - user_id = user - return user_id diff --git a/frogpilot/third_party/influxdb_client/client/util/__init__.py b/frogpilot/third_party/influxdb_client/client/util/__init__.py deleted file mode 100644 index f9a83206..00000000 --- a/frogpilot/third_party/influxdb_client/client/util/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Utils package.""" diff --git a/frogpilot/third_party/influxdb_client/client/util/date_utils.py b/frogpilot/third_party/influxdb_client/client/util/date_utils.py deleted file mode 100644 index 7b6750c8..00000000 --- a/frogpilot/third_party/influxdb_client/client/util/date_utils.py +++ /dev/null @@ -1,101 +0,0 @@ -"""Utils to get right Date parsing function.""" -import datetime -from sys import version_info -import threading -from datetime import timezone as tz - -from dateutil import parser - -date_helper = None - -lock_ = threading.Lock() - - -class DateHelper: - """ - DateHelper to groups different implementations of date operations. - - If you would like to serialize the query results to custom timezone, you can use following code: - - .. code-block:: python - - from influxdb_client.client.util import date_utils - from influxdb_client.client.util.date_utils import DateHelper - import dateutil.parser - from dateutil import tz - - def parse_date(date_string: str): - return dateutil.parser.parse(date_string).astimezone(tz.gettz('ETC/GMT+2')) - - date_utils.date_helper = DateHelper() - date_utils.date_helper.parse_date = parse_date - """ - - def __init__(self, timezone: datetime.tzinfo = tz.utc) -> None: - """ - Initialize defaults. - - :param timezone: Default timezone used for serialization "datetime" without "tzinfo". - Default value is "UTC". - """ - self.timezone = timezone - - def parse_date(self, date_string: str): - """ - Parse string into Date or Timestamp. - - :return: Returns a :class:`datetime.datetime` object or compliant implementation - like :class:`class 'pandas._libs.tslibs.timestamps.Timestamp` - """ - pass - - def to_nanoseconds(self, delta): - """ - Get number of nanoseconds in timedelta. - - Solution comes from v1 client. Thx. - https://github.com/influxdata/influxdb-python/pull/811 - """ - nanoseconds_in_days = delta.days * 86400 * 10 ** 9 - nanoseconds_in_seconds = delta.seconds * 10 ** 9 - nanoseconds_in_micros = delta.microseconds * 10 ** 3 - - return nanoseconds_in_days + nanoseconds_in_seconds + nanoseconds_in_micros - - def to_utc(self, value: datetime): - """ - Convert datetime to UTC timezone. - - :param value: datetime - :return: datetime in UTC - """ - if not value.tzinfo: - return self.to_utc(value.replace(tzinfo=self.timezone)) - else: - return value.astimezone(tz.utc) - - -def get_date_helper() -> DateHelper: - """ - Return DateHelper with proper implementation. - - If there is a 'ciso8601' than use 'ciso8601.parse_datetime' else - use 'datetime.fromisoformat' (Python >= 3.11) or 'dateutil.parse' (Python < 3.11). - """ - global date_helper - if date_helper is None: - with lock_: - # avoid duplicate initialization - if date_helper is None: - _date_helper = DateHelper() - try: - import ciso8601 - _date_helper.parse_date = ciso8601.parse_datetime - except ModuleNotFoundError: - if (version_info.major, version_info.minor) >= (3, 11): - _date_helper.parse_date = datetime.datetime.fromisoformat - else: - _date_helper.parse_date = parser.parse - date_helper = _date_helper - - return date_helper diff --git a/frogpilot/third_party/influxdb_client/client/util/date_utils_pandas.py b/frogpilot/third_party/influxdb_client/client/util/date_utils_pandas.py deleted file mode 100644 index 9a87c6ab..00000000 --- a/frogpilot/third_party/influxdb_client/client/util/date_utils_pandas.py +++ /dev/null @@ -1,15 +0,0 @@ -"""Pandas date utils.""" -from influxdb_client.client.util.date_utils import DateHelper -from influxdb_client.extras import pd - - -class PandasDateTimeHelper(DateHelper): - """DateHelper that use Pandas library with nanosecond precision.""" - - def parse_date(self, date_string: str): - """Parse date string into `class 'pandas._libs.tslibs.timestamps.Timestamp`.""" - return pd.to_datetime(date_string) - - def to_nanoseconds(self, delta): - """Get number of nanoseconds with nanos precision.""" - return super().to_nanoseconds(delta) + (delta.nanoseconds if hasattr(delta, 'nanoseconds') else 0) diff --git a/frogpilot/third_party/influxdb_client/client/util/helpers.py b/frogpilot/third_party/influxdb_client/client/util/helpers.py deleted file mode 100644 index e1fdce90..00000000 --- a/frogpilot/third_party/influxdb_client/client/util/helpers.py +++ /dev/null @@ -1,50 +0,0 @@ -"""Functions to share utility across client classes.""" -from influxdb_client.rest import ApiException - - -def _is_id(value): - """ - Check if the value is valid InfluxDB ID. - - :param value: to check - :return: True if provided parameter is valid InfluxDB ID. - """ - if value and len(value) == 16: - try: - int(value, 16) - return True - except ValueError: - return False - return False - - -def get_org_query_param(org, client, required_id=False): - """ - Get required type of Org query parameter. - - :param str, Organization org: value provided as a parameter into API (optional) - :param InfluxDBClient client: with default value for Org parameter - :param bool required_id: true if the query param has to be a ID - :return: request type of org query parameter or None - """ - _org = client.org if org is None else org - if 'Organization' in type(_org).__name__: - _org = _org.id - if required_id and _org and not _is_id(_org): - try: - organizations = client.organizations_api().find_organizations(org=_org) - if len(organizations) < 1: - from influxdb_client.client.exceptions import InfluxDBError - message = f"The client cannot find organization with name: '{_org}' " \ - "to determine their ID. Are you using token with sufficient permission?" - raise InfluxDBError(response=None, message=message) - return organizations[0].id - except ApiException as e: - if e.status == 404: - from influxdb_client.client.exceptions import InfluxDBError - message = f"The client cannot find organization with name: '{_org}' " \ - "to determine their ID." - raise InfluxDBError(response=None, message=message) - raise e - - return _org diff --git a/frogpilot/third_party/influxdb_client/client/util/multiprocessing_helper.py b/frogpilot/third_party/influxdb_client/client/util/multiprocessing_helper.py deleted file mode 100644 index 41530a23..00000000 --- a/frogpilot/third_party/influxdb_client/client/util/multiprocessing_helper.py +++ /dev/null @@ -1,205 +0,0 @@ -""" -Helpers classes to make easier use the client in multiprocessing environment. - -For more information how the multiprocessing works see Python's -`reference docs `_. -""" -import logging -import multiprocessing - -from influxdb_client import InfluxDBClient, WriteOptions -from influxdb_client.client.exceptions import InfluxDBError - -logger = logging.getLogger('influxdb_client.client.util.multiprocessing_helper') - - -def _success_callback(conf: (str, str, str), data: str): - """Successfully writen batch.""" - logger.debug(f"Written batch: {conf}, data: {data}") - - -def _error_callback(conf: (str, str, str), data: str, exception: InfluxDBError): - """Unsuccessfully writen batch.""" - logger.debug(f"Cannot write batch: {conf}, data: {data} due: {exception}") - - -def _retry_callback(conf: (str, str, str), data: str, exception: InfluxDBError): - """Retryable error.""" - logger.debug(f"Retryable error occurs for batch: {conf}, data: {data} retry: {exception}") - - -class _PoisonPill: - """To notify process to terminate.""" - - pass - - -class MultiprocessingWriter(multiprocessing.Process): - """ - The Helper class to write data into InfluxDB in independent OS process. - - Example: - .. code-block:: python - - from influxdb_client import WriteOptions - from influxdb_client.client.util.multiprocessing_helper import MultiprocessingWriter - - - def main(): - writer = MultiprocessingWriter(url="http://localhost:8086", token="my-token", org="my-org", - write_options=WriteOptions(batch_size=100)) - writer.start() - - for x in range(1, 1000): - writer.write(bucket="my-bucket", record=f"mem,tag=a value={x}i {x}") - - writer.__del__() - - - if __name__ == '__main__': - main() - - - How to use with context_manager: - .. code-block:: python - - from influxdb_client import WriteOptions - from influxdb_client.client.util.multiprocessing_helper import MultiprocessingWriter - - - def main(): - with MultiprocessingWriter(url="http://localhost:8086", token="my-token", org="my-org", - write_options=WriteOptions(batch_size=100)) as writer: - for x in range(1, 1000): - writer.write(bucket="my-bucket", record=f"mem,tag=a value={x}i {x}") - - - if __name__ == '__main__': - main() - - - How to handle batch events: - .. code-block:: python - - from influxdb_client import WriteOptions - from influxdb_client.client.exceptions import InfluxDBError - from influxdb_client.client.util.multiprocessing_helper import MultiprocessingWriter - - - class BatchingCallback(object): - - def success(self, conf: (str, str, str), data: str): - print(f"Written batch: {conf}, data: {data}") - - def error(self, conf: (str, str, str), data: str, exception: InfluxDBError): - print(f"Cannot write batch: {conf}, data: {data} due: {exception}") - - def retry(self, conf: (str, str, str), data: str, exception: InfluxDBError): - print(f"Retryable error occurs for batch: {conf}, data: {data} retry: {exception}") - - - def main(): - callback = BatchingCallback() - with MultiprocessingWriter(url="http://localhost:8086", token="my-token", org="my-org", - success_callback=callback.success, - error_callback=callback.error, - retry_callback=callback.retry) as writer: - - for x in range(1, 1000): - writer.write(bucket="my-bucket", record=f"mem,tag=a value={x}i {x}") - - - if __name__ == '__main__': - main() - - - """ - - __started__ = False - __disposed__ = False - - def __init__(self, **kwargs) -> None: - """ - Initialize defaults. - - For more information how to initialize the writer see the examples above. - - :param kwargs: arguments are passed into ``__init__`` function of ``InfluxDBClient`` and ``write_api``. - """ - multiprocessing.Process.__init__(self) - self.kwargs = kwargs - self.client = None - self.write_api = None - self.queue_ = multiprocessing.Manager().Queue() - - def write(self, **kwargs) -> None: - """ - Append time-series data into underlying queue. - - For more information how to pass arguments see the examples above. - - :param kwargs: arguments are passed into ``write`` function of ``WriteApi`` - :return: None - """ - assert self.__disposed__ is False, 'Cannot write data: the writer is closed.' - assert self.__started__ is True, 'Cannot write data: the writer is not started.' - self.queue_.put(kwargs) - - def run(self): - """Initialize ``InfluxDBClient`` and waits for data to writes into InfluxDB.""" - # Initialize Client and Write API - self.client = InfluxDBClient(**self.kwargs) - self.write_api = self.client.write_api(write_options=self.kwargs.get('write_options', WriteOptions()), - success_callback=self.kwargs.get('success_callback', _success_callback), - error_callback=self.kwargs.get('error_callback', _error_callback), - retry_callback=self.kwargs.get('retry_callback', _retry_callback)) - # Infinite loop - until poison pill - while True: - next_record = self.queue_.get() - if type(next_record) is _PoisonPill: - # Poison pill means break the loop - self.terminate() - self.queue_.task_done() - break - self.write_api.write(**next_record) - self.queue_.task_done() - - def start(self) -> None: - """Start independent process for writing data into InfluxDB.""" - super().start() - self.__started__ = True - - def terminate(self) -> None: - """ - Cleanup resources in independent process. - - This function **cannot be used** to terminate the ``MultiprocessingWriter``. - If you want to finish your writes please call: ``__del__``. - """ - if self.write_api: - logger.info("flushing data...") - self.write_api.__del__() - self.write_api = None - if self.client: - self.client.__del__() - self.client = None - logger.info("closed") - - def __enter__(self): - """Enter the runtime context related to this object.""" - self.start() - return self - - def __exit__(self, exc_type, exc_value, traceback): - """Exit the runtime context related to this object.""" - self.__del__() - - def __del__(self): - """Dispose the client and write_api.""" - if self.__started__: - self.queue_.put(_PoisonPill()) - self.queue_.join() - self.join() - self.queue_ = None - self.__started__ = False - self.__disposed__ = True diff --git a/frogpilot/third_party/influxdb_client/client/warnings.py b/frogpilot/third_party/influxdb_client/client/warnings.py deleted file mode 100644 index b682ff86..00000000 --- a/frogpilot/third_party/influxdb_client/client/warnings.py +++ /dev/null @@ -1,52 +0,0 @@ -"""The warnings message definition.""" -import warnings - - -class MissingPivotFunction(UserWarning): - """User warning about missing pivot() function.""" - - @staticmethod - def print_warning(query: str): - """Print warning about missing pivot() function and how to deal with that.""" - if 'fieldsAsCols' in query or 'pivot' in query: - return - - message = f"""The query doesn't contains the pivot() function. - -The result will not be shaped to optimal processing by pandas.DataFrame. Use the pivot() function by: - - {query} |> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value") - -You can disable this warning by: - import warnings - from influxdb_client.client.warnings import MissingPivotFunction - - warnings.simplefilter("ignore", MissingPivotFunction) - -For more info see: - - https://docs.influxdata.com/resources/videos/pivots-in-flux/ - - https://docs.influxdata.com/flux/latest/stdlib/universe/pivot/ - - https://docs.influxdata.com/flux/latest/stdlib/influxdata/influxdb/schema/fieldsascols/ -""" - warnings.warn(message, MissingPivotFunction) - - -class CloudOnlyWarning(UserWarning): - """User warning about availability only on the InfluxDB Cloud.""" - - @staticmethod - def print_warning(api_name: str, doc_url: str): - """Print warning about availability only on the InfluxDB Cloud.""" - message = f"""The '{api_name}' is available only on the InfluxDB Cloud. - -For more info see: - - {doc_url} - - https://docs.influxdata.com/influxdb/cloud/ - -You can disable this warning by: - import warnings - from influxdb_client.client.warnings import CloudOnlyWarning - - warnings.simplefilter("ignore", CloudOnlyWarning) -""" - warnings.warn(message, CloudOnlyWarning) diff --git a/frogpilot/third_party/influxdb_client/client/write/__init__.py b/frogpilot/third_party/influxdb_client/client/write/__init__.py deleted file mode 100644 index 0d21a438..00000000 --- a/frogpilot/third_party/influxdb_client/client/write/__init__.py +++ /dev/null @@ -1,56 +0,0 @@ -# flake8: noqa - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -# import apis into api package -from influxdb_client.service.authorizations_service import AuthorizationsService -from influxdb_client.service.backup_service import BackupService -from influxdb_client.service.bucket_schemas_service import BucketSchemasService -from influxdb_client.service.buckets_service import BucketsService -from influxdb_client.service.cells_service import CellsService -from influxdb_client.service.checks_service import ChecksService -from influxdb_client.service.config_service import ConfigService -from influxdb_client.service.dbr_ps_service import DBRPsService -from influxdb_client.service.dashboards_service import DashboardsService -from influxdb_client.service.delete_service import DeleteService -from influxdb_client.service.health_service import HealthService -from influxdb_client.service.invokable_scripts_service import InvokableScriptsService -from influxdb_client.service.labels_service import LabelsService -from influxdb_client.service.legacy_authorizations_service import LegacyAuthorizationsService -from influxdb_client.service.metrics_service import MetricsService -from influxdb_client.service.notification_endpoints_service import NotificationEndpointsService -from influxdb_client.service.notification_rules_service import NotificationRulesService -from influxdb_client.service.organizations_service import OrganizationsService -from influxdb_client.service.ping_service import PingService -from influxdb_client.service.query_service import QueryService -from influxdb_client.service.ready_service import ReadyService -from influxdb_client.service.remote_connections_service import RemoteConnectionsService -from influxdb_client.service.replications_service import ReplicationsService -from influxdb_client.service.resources_service import ResourcesService -from influxdb_client.service.restore_service import RestoreService -from influxdb_client.service.routes_service import RoutesService -from influxdb_client.service.rules_service import RulesService -from influxdb_client.service.scraper_targets_service import ScraperTargetsService -from influxdb_client.service.secrets_service import SecretsService -from influxdb_client.service.setup_service import SetupService -from influxdb_client.service.signin_service import SigninService -from influxdb_client.service.signout_service import SignoutService -from influxdb_client.service.sources_service import SourcesService -from influxdb_client.service.tasks_service import TasksService -from influxdb_client.service.telegraf_plugins_service import TelegrafPluginsService -from influxdb_client.service.telegrafs_service import TelegrafsService -from influxdb_client.service.templates_service import TemplatesService -from influxdb_client.service.users_service import UsersService -from influxdb_client.service.variables_service import VariablesService -from influxdb_client.service.views_service import ViewsService -from influxdb_client.service.write_service import WriteService diff --git a/frogpilot/third_party/influxdb_client/client/write/dataframe_serializer.py b/frogpilot/third_party/influxdb_client/client/write/dataframe_serializer.py deleted file mode 100644 index ccc198ac..00000000 --- a/frogpilot/third_party/influxdb_client/client/write/dataframe_serializer.py +++ /dev/null @@ -1,290 +0,0 @@ -""" -Functions for serialize Pandas DataFrame. - -Much of the code here is inspired by that in the aioinflux packet found here: https://github.com/gusutabopb/aioinflux -""" - -import logging -import math -import re - -from influxdb_client import WritePrecision -from influxdb_client.client.write.point import _ESCAPE_KEY, _ESCAPE_STRING, _ESCAPE_MEASUREMENT, DEFAULT_WRITE_PRECISION - -logger = logging.getLogger('influxdb_client.client.write.dataframe_serializer') - - -def _itertuples(data_frame): - cols = [data_frame.iloc[:, k] for k in range(len(data_frame.columns))] - return zip(data_frame.index, *cols) - - -class DataframeSerializer: - """Serialize DataFrame into LineProtocols.""" - - def __init__(self, data_frame, point_settings, precision=DEFAULT_WRITE_PRECISION, chunk_size: int = None, - **kwargs) -> None: - """ - Init serializer. - - :param data_frame: Pandas DataFrame to serialize - :param point_settings: Default Tags - :param precision: The precision for the unix timestamps within the body line-protocol. - :param chunk_size: The size of chunk for serializing into chunks. - :key data_frame_measurement_name: name of measurement for writing Pandas DataFrame - :key data_frame_tag_columns: list of DataFrame columns which are tags, rest columns will be fields - :key data_frame_timestamp_column: name of DataFrame column which contains a timestamp. The column can be defined as a :class:`~str` value - formatted as `2018-10-26`, `2018-10-26 12:00`, `2018-10-26 12:00:00-05:00` - or other formats and types supported by `pandas.to_datetime `_ - ``DataFrame`` - :key data_frame_timestamp_timezone: name of the timezone which is used for timestamp column - ``DataFrame`` - """ # noqa: E501 - # This function is hard to understand but for good reason: - # the approach used here is considerably more efficient - # than the alternatives. - # - # We build up a Python expression that efficiently converts a data point - # tuple into line-protocol entry, and then evaluate the expression - # as a lambda so that we can call it. This avoids the overhead of - # invoking a function on every data value - we only have one function - # call per row instead. The expression consists of exactly - # one f-string, so we build up the parts of it as segments - # that are concatenated together to make the full f-string inside - # the lambda. - # - # Things are made a little more complex because fields and tags with NaN - # values and empty tags are omitted from the generated line-protocol - # output. - # - # As an example, say we have a data frame with two value columns: - # a float - # b int - # - # This will generate a lambda expression to be evaluated that looks like - # this: - # - # lambda p: f"""{measurement_name} {keys[0]}={p[1]},{keys[1]}={p[2]}i {p[0].value}""" - # - # This lambda is then executed for each row p. - # - # When NaNs are present, the expression looks like this (split - # across two lines to satisfy the code-style checker) - # - # lambda p: f"""{measurement_name} {"" if pd.isna(p[1]) - # else f"{keys[0]}={p[1]}"},{keys[1]}={p[2]}i {p[0].value}""" - # - # When there's a NaN value in column a, we'll end up with a comma at the start of the - # fields, so we run a regexp substitution after generating the line-protocol entries - # to remove this. - # - # We're careful to run these potentially costly extra steps only when NaN values actually - # exist in the data. - - from ...extras import pd, np - if not isinstance(data_frame, pd.DataFrame): - raise TypeError('Must be DataFrame, but type was: {0}.' - .format(type(data_frame))) - - data_frame_measurement_name = kwargs.get('data_frame_measurement_name') - if data_frame_measurement_name is None: - raise TypeError('"data_frame_measurement_name" is a Required Argument') - - timestamp_column = kwargs.get('data_frame_timestamp_column', None) - timestamp_timezone = kwargs.get('data_frame_timestamp_timezone', None) - data_frame = data_frame.copy(deep=False) - data_frame_timestamp = data_frame.index if timestamp_column is None else data_frame[timestamp_column] - if isinstance(data_frame_timestamp, pd.PeriodIndex): - data_frame_timestamp = data_frame_timestamp.to_timestamp() - else: - # TODO: this is almost certainly not what you want - # when the index is the default RangeIndex. - # Instead, it would probably be better to leave - # out the timestamp unless a time column is explicitly - # enabled. - data_frame_timestamp = pd.to_datetime(data_frame_timestamp, unit=precision) - - if timestamp_timezone: - if isinstance(data_frame_timestamp, pd.DatetimeIndex): - data_frame_timestamp = data_frame_timestamp.tz_localize(timestamp_timezone) - else: - data_frame_timestamp = data_frame_timestamp.dt.tz_localize(timestamp_timezone) - - if hasattr(data_frame_timestamp, 'tzinfo') and data_frame_timestamp.tzinfo is None: - data_frame_timestamp = data_frame_timestamp.tz_localize('UTC') - if timestamp_column is None: - data_frame.index = data_frame_timestamp - else: - data_frame[timestamp_column] = data_frame_timestamp - - data_frame_tag_columns = kwargs.get('data_frame_tag_columns') - data_frame_tag_columns = set(data_frame_tag_columns or []) - - # keys holds a list of string keys. - keys = [] - # tags holds a list of tag f-string segments ordered alphabetically by tag key. - tags = [] - # fields holds a list of field f-string segments ordered alphebetically by field key - fields = [] - # field_indexes holds the index into each row of all the fields. - field_indexes = [] - - if point_settings.defaultTags: - for key, value in point_settings.defaultTags.items(): - # Avoid overwriting existing data if there's a column - # that already exists with the default tag's name. - # Note: when a new column is added, the old DataFrame - # that we've made a shallow copy of is unaffected. - # TODO: when there are NaN or empty values in - # the column, we could make a deep copy of the - # data and fill in those values with the default tag value. - if key not in data_frame.columns: - data_frame[key] = value - data_frame_tag_columns.add(key) - - # Get a list of all the columns sorted by field/tag key. - # We want to iterate through the columns in sorted order - # so that we know when we're on the first field so we - # can know whether a comma is needed for that - # field. - columns = sorted(enumerate(data_frame.dtypes.items()), key=lambda col: col[1][0]) - - # null_columns has a bool value for each column holding - # whether that column contains any null (NaN or None) values. - null_columns = data_frame.isnull().any() - timestamp_index = 0 - - # Iterate through the columns building up the expression for each column. - for index, (key, value) in columns: - key = str(key) - key_format = f'{{keys[{len(keys)}]}}' - keys.append(key.translate(_ESCAPE_KEY)) - # The field index is one more than the column index because the - # time index is at column zero in the finally zipped-together - # result columns. - field_index = index + 1 - val_format = f'p[{field_index}]' - - if key in data_frame_tag_columns: - # This column is a tag column. - if null_columns.iloc[index]: - key_value = f"""{{ - '' if {val_format} == '' or pd.isna({val_format}) else - f',{key_format}={{str({val_format}).translate(_ESCAPE_STRING)}}' - }}""" - else: - key_value = f',{key_format}={{str({val_format}).translate(_ESCAPE_KEY)}}' - tags.append(key_value) - continue - elif timestamp_column is not None and key in timestamp_column: - timestamp_index = field_index - continue - - # This column is a field column. - # Note: no comma separator is needed for the first field. - # It's important to omit it because when the first - # field column has no nulls, we don't run the comma-removal - # regexp substitution step. - sep = '' if len(field_indexes) == 0 else ',' - if issubclass(value.type, np.integer) or issubclass(value.type, np.floating) or issubclass(value.type, np.bool_): # noqa: E501 - suffix = 'i' if issubclass(value.type, np.integer) else '' - if null_columns.iloc[index]: - field_value = f"""{{"" if pd.isna({val_format}) else f"{sep}{key_format}={{{val_format}}}{suffix}"}}""" # noqa: E501 - else: - field_value = f"{sep}{key_format}={{{val_format}}}{suffix}" - else: - if null_columns.iloc[index]: - field_value = f"""{{ - '' if pd.isna({val_format}) else - f'{sep}{key_format}="{{str({val_format}).translate(_ESCAPE_STRING)}}"' - }}""" - else: - field_value = f'''{sep}{key_format}="{{str({val_format}).translate(_ESCAPE_STRING)}}"''' - field_indexes.append(field_index) - fields.append(field_value) - - measurement_name = str(data_frame_measurement_name).translate(_ESCAPE_MEASUREMENT) - - tags = ''.join(tags) - fields = ''.join(fields) - timestamp = '{p[%s].value}' % timestamp_index - if precision == WritePrecision.US: - timestamp = '{int(p[%s].value / 1e3)}' % timestamp_index - elif precision == WritePrecision.MS: - timestamp = '{int(p[%s].value / 1e6)}' % timestamp_index - elif precision == WritePrecision.S: - timestamp = '{int(p[%s].value / 1e9)}' % timestamp_index - - f = eval(f'lambda p: f"""{{measurement_name}}{tags} {fields} {timestamp}"""', { - 'measurement_name': measurement_name, - '_ESCAPE_KEY': _ESCAPE_KEY, - '_ESCAPE_STRING': _ESCAPE_STRING, - 'keys': keys, - 'pd': pd, - }) - - for k, v in dict(data_frame.dtypes).items(): - if k in data_frame_tag_columns: - data_frame = data_frame.replace({k: ''}, np.nan) - - def _any_not_nan(p, indexes): - return any(map(lambda x: not pd.isna(p[x]), indexes)) - - self.data_frame = data_frame - self.f = f - self.field_indexes = field_indexes - self.first_field_maybe_null = null_columns.iloc[field_indexes[0] - 1] - self._any_not_nan = _any_not_nan - - # - # prepare chunks - # - if chunk_size is not None: - self.number_of_chunks = int(math.ceil(len(data_frame) / float(chunk_size))) - self.chunk_size = chunk_size - else: - self.number_of_chunks = None - - def serialize(self, chunk_idx: int = None): - """ - Serialize chunk into LineProtocols. - - :param chunk_idx: The index of chunk to serialize. If `None` then serialize whole dataframe. - """ - if chunk_idx is None: - chunk = self.data_frame - else: - logger.debug("Serialize chunk %s/%s ...", chunk_idx + 1, self.number_of_chunks) - chunk = self.data_frame[chunk_idx * self.chunk_size:(chunk_idx + 1) * self.chunk_size] - - if self.first_field_maybe_null: - # When the first field is null (None/NaN), we'll have - # a spurious leading comma which needs to be removed. - lp = (re.sub('^(( |[^ ])* ),([a-zA-Z0-9])(.*)', '\\1\\3\\4', self.f(p)) - for p in filter(lambda x: self._any_not_nan(x, self.field_indexes), _itertuples(chunk))) - return list(lp) - else: - return list(map(self.f, _itertuples(chunk))) - - def number_of_chunks(self): - """ - Return the number of chunks. - - :return: number of chunks or None if chunk_size is not specified. - """ - return self.number_of_chunks - - -def data_frame_to_list_of_points(data_frame, point_settings, precision=DEFAULT_WRITE_PRECISION, **kwargs): - """ - Serialize DataFrame into LineProtocols. - - :param data_frame: Pandas DataFrame to serialize - :param point_settings: Default Tags - :param precision: The precision for the unix timestamps within the body line-protocol. - :key data_frame_measurement_name: name of measurement for writing Pandas DataFrame - :key data_frame_tag_columns: list of DataFrame columns which are tags, rest columns will be fields - :key data_frame_timestamp_column: name of DataFrame column which contains a timestamp. The column can be defined as a :class:`~str` value - formatted as `2018-10-26`, `2018-10-26 12:00`, `2018-10-26 12:00:00-05:00` - or other formats and types supported by `pandas.to_datetime `_ - ``DataFrame`` - :key data_frame_timestamp_timezone: name of the timezone which is used for timestamp column - ``DataFrame`` - """ # noqa: E501 - return DataframeSerializer(data_frame, point_settings, precision, **kwargs).serialize() diff --git a/frogpilot/third_party/influxdb_client/client/write/point.py b/frogpilot/third_party/influxdb_client/client/write/point.py deleted file mode 100644 index cc95d204..00000000 --- a/frogpilot/third_party/influxdb_client/client/write/point.py +++ /dev/null @@ -1,371 +0,0 @@ -"""Point data structure to represent LineProtocol.""" - -import math -import warnings -from builtins import int -from datetime import datetime, timedelta, timezone -from decimal import Decimal -from numbers import Integral - -from influxdb_client.client.util.date_utils import get_date_helper -from influxdb_client.domain.write_precision import WritePrecision - -EPOCH = datetime.fromtimestamp(0, tz=timezone.utc) - -DEFAULT_WRITE_PRECISION = WritePrecision.NS - -_ESCAPE_MEASUREMENT = str.maketrans({ - ',': r'\,', - ' ': r'\ ', - '\n': r'\n', - '\t': r'\t', - '\r': r'\r', -}) - -_ESCAPE_KEY = str.maketrans({ - ',': r'\,', - '=': r'\=', - ' ': r'\ ', - '\n': r'\n', - '\t': r'\t', - '\r': r'\r', -}) - -_ESCAPE_STRING = str.maketrans({ - '"': r'\"', - '\\': r'\\', -}) - -try: - import numpy as np - - _HAS_NUMPY = True -except ModuleNotFoundError: - _HAS_NUMPY = False - - -class Point(object): - """ - Point defines the values that will be written to the database. - - Ref: https://docs.influxdata.com/influxdb/latest/reference/key-concepts/data-elements/#point - """ - - @staticmethod - def measurement(measurement): - """Create a new Point with specified measurement name.""" - p = Point(measurement) - return p - - @staticmethod - def from_dict(dictionary: dict, write_precision: WritePrecision = DEFAULT_WRITE_PRECISION, **kwargs): - """ - Initialize point from 'dict' structure. - - The expected dict structure is: - - measurement - - tags - - fields - - time - - Example: - .. code-block:: python - - # Use default dictionary structure - dict_structure = { - "measurement": "h2o_feet", - "tags": {"location": "coyote_creek"}, - "fields": {"water_level": 1.0}, - "time": 1 - } - point = Point.from_dict(dict_structure, WritePrecision.NS) - - Example: - .. code-block:: python - - # Use custom dictionary structure - dictionary = { - "name": "sensor_pt859", - "location": "warehouse_125", - "version": "2021.06.05.5874", - "pressure": 125, - "temperature": 10, - "created": 1632208639, - } - point = Point.from_dict(dictionary, - write_precision=WritePrecision.S, - record_measurement_key="name", - record_time_key="created", - record_tag_keys=["location", "version"], - record_field_keys=["pressure", "temperature"]) - - Int Types: - The following example shows how to configure the types of integers fields. - It is useful when you want to serialize integers always as ``float`` to avoid ``field type conflict`` - or use ``unsigned 64-bit integer`` as the type for serialization. - - .. code-block:: python - - # Use custom dictionary structure - dict_structure = { - "measurement": "h2o_feet", - "tags": {"location": "coyote_creek"}, - "fields": { - "water_level": 1.0, - "some_counter": 108913123234 - }, - "time": 1 - } - - point = Point.from_dict(dict_structure, field_types={"some_counter": "uint"}) - - :param dictionary: dictionary for serialize into data Point - :param write_precision: sets the precision for the supplied time values - :key record_measurement_key: key of dictionary with specified measurement - :key record_measurement_name: static measurement name for data Point - :key record_time_key: key of dictionary with specified timestamp - :key record_tag_keys: list of dictionary keys to use as a tag - :key record_field_keys: list of dictionary keys to use as a field - :key field_types: optional dictionary to specify types of serialized fields. Currently, is supported customization for integer types. - Possible integers types: - - ``int`` - serialize integers as "**Signed 64-bit integers**" - ``9223372036854775807i`` (default behaviour) - - ``uint`` - serialize integers as "**Unsigned 64-bit integers**" - ``9223372036854775807u`` - - ``float`` - serialize integers as "**IEEE-754 64-bit floating-point numbers**". Useful for unify number types in your pipeline to avoid field type conflict - ``9223372036854775807`` - The ``field_types`` can be also specified as part of incoming dictionary. For more info see an example above. - :return: new data point - """ # noqa: E501 - measurement_ = kwargs.get('record_measurement_name', None) - if measurement_ is None: - measurement_ = dictionary[kwargs.get('record_measurement_key', 'measurement')] - point = Point(measurement_) - - record_tag_keys = kwargs.get('record_tag_keys', None) - if record_tag_keys is not None: - for tag_key in record_tag_keys: - if tag_key in dictionary: - point.tag(tag_key, dictionary[tag_key]) - elif 'tags' in dictionary: - for tag_key, tag_value in dictionary['tags'].items(): - point.tag(tag_key, tag_value) - - record_field_keys = kwargs.get('record_field_keys', None) - if record_field_keys is not None: - for field_key in record_field_keys: - if field_key in dictionary: - point.field(field_key, dictionary[field_key]) - else: - for field_key, field_value in dictionary['fields'].items(): - point.field(field_key, field_value) - - record_time_key = kwargs.get('record_time_key', 'time') - if record_time_key in dictionary: - point.time(dictionary[record_time_key], write_precision=write_precision) - - _field_types = kwargs.get('field_types', {}) - if 'field_types' in dictionary: - _field_types = dictionary['field_types'] - # Map API fields types to Line Protocol types postfix: - # - int: 'i' - # - uint: 'u' - # - float: '' - point._field_types = dict(map( - lambda item: (item[0], 'i' if item[1] == 'int' else 'u' if item[1] == 'uint' else ''), - _field_types.items() - )) - - return point - - def __init__(self, measurement_name): - """Initialize defaults.""" - self._tags = {} - self._fields = {} - self._name = measurement_name - self._time = None - self._write_precision = DEFAULT_WRITE_PRECISION - self._field_types = {} - - def time(self, time, write_precision=DEFAULT_WRITE_PRECISION): - """ - Specify timestamp for DataPoint with declared precision. - - If time doesn't have specified timezone we assume that timezone is UTC. - - Examples:: - Point.measurement("h2o").field("val", 1).time("2009-11-10T23:00:00.123456Z") - Point.measurement("h2o").field("val", 1).time(1257894000123456000) - Point.measurement("h2o").field("val", 1).time(datetime(2009, 11, 10, 23, 0, 0, 123456)) - Point.measurement("h2o").field("val", 1).time(1257894000123456000, write_precision=WritePrecision.NS) - - - :param time: the timestamp for your data - :param write_precision: sets the precision for the supplied time values - :return: this point - """ - self._write_precision = write_precision - self._time = time - return self - - def tag(self, key, value): - """Add tag with key and value.""" - self._tags[key] = value - return self - - def field(self, field, value): - """Add field with key and value.""" - self._fields[field] = value - return self - - def to_line_protocol(self, precision=None): - """ - Create LineProtocol. - - :param precision: required precision of LineProtocol. If it's not set then use the precision from ``Point``. - """ - _measurement = _escape_key(self._name, _ESCAPE_MEASUREMENT) - if _measurement.startswith("#"): - message = f"""The measurement name '{_measurement}' start with '#'. - -The output Line protocol will be interpret as a comment by InfluxDB. For more info see: - - https://docs.influxdata.com/influxdb/latest/reference/syntax/line-protocol/#comments -""" - warnings.warn(message, SyntaxWarning) - _tags = _append_tags(self._tags) - _fields = _append_fields(self._fields, self._field_types) - if not _fields: - return "" - _time = _append_time(self._time, self._write_precision if precision is None else precision) - - return f"{_measurement}{_tags}{_fields}{_time}" - - @property - def write_precision(self): - """Get precision.""" - return self._write_precision - - @classmethod - def set_str_rep(cls, rep_function): - """Set the string representation for all Points.""" - cls.__str___rep = rep_function - - def __str__(self): - """Create string representation of this Point.""" - return self.to_line_protocol() - - def __eq__(self, other): - """Return true iff other is equal to self.""" - if not isinstance(other, Point): - return False - # assume points are equal iff their instance fields are equal - return (self._tags == other._tags and - self._fields == other._fields and - self._name == other._name and - self._time == other._time and - self._write_precision == other._write_precision and - self._field_types == other._field_types) - - -def _append_tags(tags): - _return = [] - for tag_key, tag_value in sorted(tags.items()): - - if tag_value is None: - continue - - tag = _escape_key(tag_key) - value = _escape_tag_value(tag_value) - if tag != '' and value != '': - _return.append(f'{tag}={value}') - - return f"{',' if _return else ''}{','.join(_return)} " - - -def _append_fields(fields, field_types): - _return = [] - - for field, value in sorted(fields.items()): - if value is None: - continue - - if isinstance(value, float) or isinstance(value, Decimal) or _np_is_subtype(value, 'float'): - if not math.isfinite(value): - continue - s = str(value) - # It's common to represent whole numbers as floats - # and the trailing ".0" that Python produces is unnecessary - # in line-protocol, inconsistent with other line-protocol encoders, - # and takes more space than needed, so trim it off. - if s.endswith('.0'): - s = s[:-2] - _return.append(f'{_escape_key(field)}={s}') - elif (isinstance(value, int) or _np_is_subtype(value, 'int')) and not isinstance(value, bool): - _type = field_types.get(field, "i") - _return.append(f'{_escape_key(field)}={str(value)}{_type}') - elif isinstance(value, bool): - _return.append(f'{_escape_key(field)}={str(value).lower()}') - elif isinstance(value, str): - _return.append(f'{_escape_key(field)}="{_escape_string(value)}"') - else: - raise ValueError(f'Type: "{type(value)}" of field: "{field}" is not supported.') - - return f"{','.join(_return)}" - - -def _append_time(time, write_precision) -> str: - if time is None: - return '' - return f" {int(_convert_timestamp(time, write_precision))}" - - -def _escape_key(tag, escape_list=None) -> str: - if escape_list is None: - escape_list = _ESCAPE_KEY - return str(tag).translate(escape_list) - - -def _escape_tag_value(value) -> str: - ret = _escape_key(value) - if ret.endswith('\\'): - ret += ' ' - return ret - - -def _escape_string(value) -> str: - return str(value).translate(_ESCAPE_STRING) - - -def _convert_timestamp(timestamp, precision=DEFAULT_WRITE_PRECISION): - date_helper = get_date_helper() - if isinstance(timestamp, Integral): - return timestamp # assume precision is correct if timestamp is int - - if isinstance(timestamp, str): - timestamp = date_helper.parse_date(timestamp) - - if isinstance(timestamp, timedelta) or isinstance(timestamp, datetime): - - if isinstance(timestamp, datetime): - timestamp = date_helper.to_utc(timestamp) - EPOCH - - ns = date_helper.to_nanoseconds(timestamp) - - if precision is None or precision == WritePrecision.NS: - return ns - elif precision == WritePrecision.US: - return ns / 1e3 - elif precision == WritePrecision.MS: - return ns / 1e6 - elif precision == WritePrecision.S: - return ns / 1e9 - - raise ValueError(timestamp) - - -def _np_is_subtype(value, np_type): - if not _HAS_NUMPY or not hasattr(value, 'dtype'): - return False - - if np_type == 'float': - return np.issubdtype(value, np.floating) - elif np_type == 'int': - return np.issubdtype(value, np.integer) - return False diff --git a/frogpilot/third_party/influxdb_client/client/write/retry.py b/frogpilot/third_party/influxdb_client/client/write/retry.py deleted file mode 100644 index 2c4b359e..00000000 --- a/frogpilot/third_party/influxdb_client/client/write/retry.py +++ /dev/null @@ -1,148 +0,0 @@ -"""Implementation for Retry strategy during HTTP requests.""" - -import logging -from datetime import datetime, timedelta -from itertools import takewhile -from random import random -from typing import Callable - -from urllib3 import Retry -from urllib3.exceptions import MaxRetryError, ResponseError - -from influxdb_client.client.exceptions import InfluxDBError - -logger = logging.getLogger('influxdb_client.client.write.retry') - - -class WritesRetry(Retry): - """ - Writes retry configuration. - - The next delay is computed as random value between range - `retry_interval * exponential_base^(attempts-1)` and `retry_interval * exponential_base^(attempts) - - Example: - for retry_interval=5, exponential_base=2, max_retry_delay=125, total=5 - retry delays are random distributed values within the ranges of - [5-10, 10-20, 20-40, 40-80, 80-125] - """ - - def __init__(self, jitter_interval=0, max_retry_delay=125, exponential_base=2, max_retry_time=180, total=5, - retry_interval=5, retry_callback: Callable[[Exception], int] = None, **kw): - """ - Initialize defaults. - - :param int jitter_interval: random milliseconds when retrying writes - :param num max_retry_delay: maximum delay when retrying write in seconds - :param int max_retry_time: maximum total retry timeout in seconds, - attempt after this timout throws MaxRetryError - :param int total: maximum number of retries - :param num retry_interval: initial first retry delay range in seconds - :param int exponential_base: base for the exponential retry delay, - :param Callable[[Exception], int] retry_callback: the callable ``callback`` to run after retryable - error occurred. - The callable must accept one argument: - - `Exception`: an retryable error - """ - super().__init__(**kw) - self.jitter_interval = jitter_interval - self.total = total - self.retry_interval = retry_interval - self.max_retry_delay = max_retry_delay - self.max_retry_time = max_retry_time - self.exponential_base = exponential_base - self.retry_timeout = datetime.now() + timedelta(seconds=max_retry_time) - self.retry_callback = retry_callback - - def new(self, **kw): - """Initialize defaults.""" - if 'jitter_interval' not in kw: - kw['jitter_interval'] = self.jitter_interval - if 'retry_interval' not in kw: - kw['retry_interval'] = self.retry_interval - if 'max_retry_delay' not in kw: - kw['max_retry_delay'] = self.max_retry_delay - if 'max_retry_time' not in kw: - kw['max_retry_time'] = self.max_retry_time - if 'exponential_base' not in kw: - kw['exponential_base'] = self.exponential_base - if 'retry_callback' not in kw: - kw['retry_callback'] = self.retry_callback - - new = super().new(**kw) - new.retry_timeout = self.retry_timeout - return new - - def is_retry(self, method, status_code, has_retry_after=False): - """is_retry doesn't require retry_after header. If there is not Retry-After we will use backoff.""" - if not self._is_method_retryable(method): - return False - - return self.total and (status_code >= 429) - - def get_backoff_time(self): - """Variant of exponential backoff with initial and max delay and a random jitter delay.""" - # We want to consider only the last consecutive errors sequence (Ignore redirects). - consecutive_errors_len = len( - list( - takewhile(lambda x: x.redirect_location is None, reversed(self.history)) - ) - ) - # First fail doesn't increase backoff - consecutive_errors_len -= 1 - if consecutive_errors_len < 0: - return 0 - - range_start = self.retry_interval - range_stop = self.retry_interval * self.exponential_base - - i = 1 - while i <= consecutive_errors_len: - i += 1 - range_start = range_stop - range_stop = range_stop * self.exponential_base - if range_stop > self.max_retry_delay: - break - - if range_stop > self.max_retry_delay: - range_stop = self.max_retry_delay - - return range_start + (range_stop - range_start) * self._random() - - def get_retry_after(self, response): - """Get the value of Retry-After header and append random jitter delay.""" - retry_after = super().get_retry_after(response) - if retry_after: - retry_after += self._jitter_delay() - return retry_after - - def increment(self, method=None, url=None, response=None, error=None, _pool=None, _stacktrace=None): - """Return a new Retry object with incremented retry counters.""" - if self.retry_timeout < datetime.now(): - raise MaxRetryError(_pool, url, error or ResponseError("max_retry_time exceeded")) - - new_retry = super().increment(method, url, response, error, _pool, _stacktrace) - - if response is not None: - parsed_error = InfluxDBError(response=response) - elif error is not None: - parsed_error = error - else: - parsed_error = f"Failed request to: {url}" - - message = f"The retriable error occurred during request. Reason: '{parsed_error}'." - if isinstance(parsed_error, InfluxDBError): - message += f" Retry in {parsed_error.retry_after}s." - - if self.retry_callback: - self.retry_callback(parsed_error) - - logger.warning(message) - - return new_retry - - def _jitter_delay(self): - return self.jitter_interval * random() - - def _random(self): - return random() diff --git a/frogpilot/third_party/influxdb_client/client/write_api.py b/frogpilot/third_party/influxdb_client/client/write_api.py deleted file mode 100644 index 3b3db68f..00000000 --- a/frogpilot/third_party/influxdb_client/client/write_api.py +++ /dev/null @@ -1,587 +0,0 @@ -"""Collect and write time series data to InfluxDB Cloud or InfluxDB OSS.""" - -# coding: utf-8 -import logging -import os -import warnings -from collections import defaultdict -from datetime import timedelta -from enum import Enum -from random import random -from time import sleep -from typing import Union, Any, Iterable, NamedTuple - -import reactivex as rx -from reactivex import operators as ops, Observable -from reactivex.scheduler import ThreadPoolScheduler -from reactivex.subject import Subject - -from influxdb_client import WritePrecision -from influxdb_client.client._base import _BaseWriteApi, _HAS_DATACLASS -from influxdb_client.client.util.helpers import get_org_query_param -from influxdb_client.client.write.dataframe_serializer import DataframeSerializer -from influxdb_client.client.write.point import Point, DEFAULT_WRITE_PRECISION -from influxdb_client.client.write.retry import WritesRetry -from influxdb_client.rest import _UTF_8_encoding - -logger = logging.getLogger('influxdb_client.client.write_api') - - -if _HAS_DATACLASS: - import dataclasses - from dataclasses import dataclass - - -class WriteType(Enum): - """Configuration which type of writes will client use.""" - - batching = 1 - asynchronous = 2 - synchronous = 3 - - -class WriteOptions(object): - """Write configuration.""" - - def __init__(self, write_type: WriteType = WriteType.batching, - batch_size=1_000, flush_interval=1_000, - jitter_interval=0, - retry_interval=5_000, - max_retries=5, - max_retry_delay=125_000, - max_retry_time=180_000, - exponential_base=2, - max_close_wait=300_000, - write_scheduler=ThreadPoolScheduler(max_workers=1)) -> None: - """ - Create write api configuration. - - :param write_type: methods of write (batching, asynchronous, synchronous) - :param batch_size: the number of data point to collect in batch - :param flush_interval: flush data at least in this interval (milliseconds) - :param jitter_interval: this is primarily to avoid large write spikes for users running a large number of - client instances ie, a jitter of 5s and flush duration 10s means flushes will happen every 10-15s - (milliseconds) - :param retry_interval: the time to wait before retry unsuccessful write (milliseconds) - :param max_retries: the number of max retries when write fails, 0 means retry is disabled - :param max_retry_delay: the maximum delay between each retry attempt in milliseconds - :param max_retry_time: total timeout for all retry attempts in milliseconds, if 0 retry is disabled - :param exponential_base: base for the exponential retry delay - :parama max_close_wait: the maximum time to wait for writes to be flushed if close() is called - :param write_scheduler: - """ - self.write_type = write_type - self.batch_size = batch_size - self.flush_interval = flush_interval - self.jitter_interval = jitter_interval - self.retry_interval = retry_interval - self.max_retries = max_retries - self.max_retry_delay = max_retry_delay - self.max_retry_time = max_retry_time - self.exponential_base = exponential_base - self.write_scheduler = write_scheduler - self.max_close_wait = max_close_wait - - def to_retry_strategy(self, **kwargs): - """ - Create a Retry strategy from write options. - - :key retry_callback: The callable ``callback`` to run after retryable error occurred. - The callable must accept one argument: - - `Exception`: an retryable error - """ - return WritesRetry( - total=self.max_retries, - retry_interval=self.retry_interval / 1_000, - jitter_interval=self.jitter_interval / 1_000, - max_retry_delay=self.max_retry_delay / 1_000, - max_retry_time=self.max_retry_time / 1_000, - exponential_base=self.exponential_base, - retry_callback=kwargs.get("retry_callback", None), - allowed_methods=["POST"]) - - def __getstate__(self): - """Return a dict of attributes that you want to pickle.""" - state = self.__dict__.copy() - # Remove write scheduler - del state['write_scheduler'] - return state - - def __setstate__(self, state): - """Set your object with the provided dict.""" - self.__dict__.update(state) - # Init default write Scheduler - self.write_scheduler = ThreadPoolScheduler(max_workers=1) - - -SYNCHRONOUS = WriteOptions(write_type=WriteType.synchronous) -ASYNCHRONOUS = WriteOptions(write_type=WriteType.asynchronous) - - -class PointSettings(object): - """Settings to store default tags.""" - - def __init__(self, **default_tags) -> None: - """ - Create point settings for write api. - - :param default_tags: Default tags which will be added to each point written by api. - """ - self.defaultTags = dict() - - for key, val in default_tags.items(): - self.add_default_tag(key, val) - - @staticmethod - def _get_value(value): - - if value.startswith("${env."): - return os.environ.get(value[6:-1]) - - return value - - def add_default_tag(self, key, value) -> None: - """Add new default tag with key and value.""" - self.defaultTags[key] = self._get_value(value) - - -class _BatchItemKey(object): - def __init__(self, bucket, org, precision=DEFAULT_WRITE_PRECISION) -> None: - self.bucket = bucket - self.org = org - self.precision = precision - pass - - def __hash__(self) -> int: - return hash((self.bucket, self.org, self.precision)) - - def __eq__(self, o: object) -> bool: - return isinstance(o, self.__class__) \ - and self.bucket == o.bucket and self.org == o.org and self.precision == o.precision - - def __str__(self) -> str: - return '_BatchItemKey[bucket:\'{}\', org:\'{}\', precision:\'{}\']' \ - .format(str(self.bucket), str(self.org), str(self.precision)) - - -class _BatchItem(object): - def __init__(self, key: _BatchItemKey, data, size=1) -> None: - self.key = key - self.data = data - self.size = size - pass - - def to_key_tuple(self) -> (str, str, str): - return self.key.bucket, self.key.org, self.key.precision - - def __str__(self) -> str: - return '_BatchItem[key:\'{}\', size: \'{}\']' \ - .format(str(self.key), str(self.size)) - - -class _BatchResponse(object): - def __init__(self, data: _BatchItem, exception: Exception = None): - self.data = data - self.exception = exception - pass - - def __str__(self) -> str: - return '_BatchResponse[status:\'{}\', \'{}\']' \ - .format("failed" if self.exception else "success", str(self.data)) - - -def _body_reduce(batch_items): - return b'\n'.join(map(lambda batch_item: batch_item.data, batch_items)) - - -class WriteApi(_BaseWriteApi): - """ - Implementation for '/api/v2/write' endpoint. - - Example: - .. code-block:: python - - from influxdb_client import InfluxDBClient - from influxdb_client.client.write_api import SYNCHRONOUS - - - # Initialize SYNCHRONOUS instance of WriteApi - with InfluxDBClient(url="http://localhost:8086", token="my-token", org="my-org") as client: - write_api = client.write_api(write_options=SYNCHRONOUS) - """ - - def __init__(self, - influxdb_client, - write_options: WriteOptions = WriteOptions(), - point_settings: PointSettings = PointSettings(), - **kwargs) -> None: - """ - Initialize defaults. - - :param influxdb_client: with default settings (organization) - :param write_options: write api configuration - :param point_settings: settings to store default tags. - :key success_callback: The callable ``callback`` to run after successfully writen a batch. - - The callable must accept two arguments: - - `Tuple`: ``(bucket, organization, precision)`` - - `str`: written data - - **[batching mode]** - :key error_callback: The callable ``callback`` to run after unsuccessfully writen a batch. - - The callable must accept three arguments: - - `Tuple`: ``(bucket, organization, precision)`` - - `str`: written data - - `Exception`: an occurred error - - **[batching mode]** - :key retry_callback: The callable ``callback`` to run after retryable error occurred. - - The callable must accept three arguments: - - `Tuple`: ``(bucket, organization, precision)`` - - `str`: written data - - `Exception`: an retryable error - - **[batching mode]** - """ - super().__init__(influxdb_client=influxdb_client, point_settings=point_settings) - self._write_options = write_options - self._success_callback = kwargs.get('success_callback', None) - self._error_callback = kwargs.get('error_callback', None) - self._retry_callback = kwargs.get('retry_callback', None) - self._window_scheduler = None - - if self._write_options.write_type is WriteType.batching: - # Define Subject that listen incoming data and produces writes into InfluxDB - self._subject = Subject() - - self._window_scheduler = ThreadPoolScheduler(1) - self._disposable = self._subject.pipe( - # Split incoming data to windows by batch_size or flush_interval - ops.window_with_time_or_count(count=write_options.batch_size, - timespan=timedelta(milliseconds=write_options.flush_interval), - scheduler=self._window_scheduler), - # Map window into groups defined by 'organization', 'bucket' and 'precision' - ops.flat_map(lambda window: window.pipe( - # Group window by 'organization', 'bucket' and 'precision' - ops.group_by(lambda batch_item: batch_item.key), - # Create batch (concatenation line protocols by \n) - ops.map(lambda group: group.pipe( - ops.to_iterable(), - ops.map(lambda xs: _BatchItem(key=group.key, data=_body_reduce(xs), size=len(xs))))), - ops.merge_all())), - # Write data into InfluxDB (possibility to retry if its fail) - ops.filter(lambda batch: batch.size > 0), - ops.map(mapper=lambda batch: self._to_response(data=batch, delay=self._jitter_delay())), - ops.merge_all()) \ - .subscribe(self._on_next, self._on_error, self._on_complete) - - else: - self._subject = None - self._disposable = None - - if self._write_options.write_type is WriteType.asynchronous: - message = """The 'WriteType.asynchronous' is deprecated and will be removed in future major version. - -You can use native asynchronous version of the client: -- https://influxdb-client.readthedocs.io/en/stable/usage.html#how-to-use-asyncio - """ - warnings.warn(message, DeprecationWarning) - - def write(self, bucket: str, org: str = None, - record: Union[ - str, Iterable['str'], Point, Iterable['Point'], dict, Iterable['dict'], bytes, Iterable['bytes'], - Observable, NamedTuple, Iterable['NamedTuple'], 'dataclass', Iterable['dataclass'] - ] = None, - write_precision: WritePrecision = DEFAULT_WRITE_PRECISION, **kwargs) -> Any: - """ - Write time-series data into InfluxDB. - - :param str bucket: specifies the destination bucket for writes (required) - :param str, Organization org: specifies the destination organization for writes; - take the ID, Name or Organization. - If not specified the default value from ``InfluxDBClient.org`` is used. - :param WritePrecision write_precision: specifies the precision for the unix timestamps within - the body line-protocol. The precision specified on a Point has precedes - and is use for write. - :param record: Point, Line Protocol, Dictionary, NamedTuple, Data Classes, Pandas DataFrame or - RxPY Observable to write - :key data_frame_measurement_name: name of measurement for writing Pandas DataFrame - ``DataFrame`` - :key data_frame_tag_columns: list of DataFrame columns which are tags, - rest columns will be fields - ``DataFrame`` - :key data_frame_timestamp_column: name of DataFrame column which contains a timestamp. The column can be defined as a :class:`~str` value - formatted as `2018-10-26`, `2018-10-26 12:00`, `2018-10-26 12:00:00-05:00` - or other formats and types supported by `pandas.to_datetime `_ - ``DataFrame`` - :key data_frame_timestamp_timezone: name of the timezone which is used for timestamp column - ``DataFrame`` - :key record_measurement_key: key of record with specified measurement - - ``dictionary``, ``NamedTuple``, ``dataclass`` - :key record_measurement_name: static measurement name - ``dictionary``, ``NamedTuple``, ``dataclass`` - :key record_time_key: key of record with specified timestamp - ``dictionary``, ``NamedTuple``, ``dataclass`` - :key record_tag_keys: list of record keys to use as a tag - ``dictionary``, ``NamedTuple``, ``dataclass`` - :key record_field_keys: list of record keys to use as a field - ``dictionary``, ``NamedTuple``, ``dataclass`` - - Example: - .. code-block:: python - - # Record as Line Protocol - write_api.write("my-bucket", "my-org", "h2o_feet,location=us-west level=125i 1") - - # Record as Dictionary - dictionary = { - "measurement": "h2o_feet", - "tags": {"location": "us-west"}, - "fields": {"level": 125}, - "time": 1 - } - write_api.write("my-bucket", "my-org", dictionary) - - # Record as Point - from influxdb_client import Point - point = Point("h2o_feet").tag("location", "us-west").field("level", 125).time(1) - write_api.write("my-bucket", "my-org", point) - - DataFrame: - If the ``data_frame_timestamp_column`` is not specified the index of `Pandas DataFrame `_ - is used as a ``timestamp`` for written data. The index can be `PeriodIndex `_ - or its must be transformable to ``datetime`` by - `pandas.to_datetime `_. - - If you would like to transform a column to ``PeriodIndex``, you can use something like: - - .. code-block:: python - - import pandas as pd - - # DataFrame - data_frame = ... - # Set column as Index - data_frame.set_index('column_name', inplace=True) - # Transform index to PeriodIndex - data_frame.index = pd.to_datetime(data_frame.index, unit='s') - - """ # noqa: E501 - org = get_org_query_param(org=org, client=self._influxdb_client) - - self._append_default_tags(record) - - if self._write_options.write_type is WriteType.batching: - return self._write_batching(bucket, org, record, - write_precision, **kwargs) - - payloads = defaultdict(list) - self._serialize(record, write_precision, payloads, **kwargs) - - _async_req = True if self._write_options.write_type == WriteType.asynchronous else False - - def write_payload(payload): - final_string = b'\n'.join(payload[1]) - return self._post_write(_async_req, bucket, org, final_string, payload[0]) - - results = list(map(write_payload, payloads.items())) - if not _async_req: - return None - elif len(results) == 1: - return results[0] - return results - - def flush(self): - """Flush data.""" - # TODO - pass - - def close(self): - """Flush data and dispose a batching buffer.""" - self.__del__() - - def __enter__(self): - """ - Enter the runtime context related to this object. - - It will bind this method’s return value to the target(s) - specified in the `as` clause of the statement. - - return: self instance - """ - return self - - def __exit__(self, exc_type, exc_val, exc_tb): - """Exit the runtime context related to this object and close the WriteApi.""" - self.close() - - def __del__(self): - """Close WriteApi.""" - if self._subject: - self._subject.on_completed() - self._subject.dispose() - self._subject = None - - """ - We impose a maximum wait time to ensure that we do not cause a deadlock if the - background thread has exited abnormally - - Each iteration waits 100ms, but sleep expects the unit to be seconds so convert - the maximum wait time to seconds. - - We keep a counter of how long we've waited - """ - max_wait_time = self._write_options.max_close_wait / 1000 - waited = 0 - sleep_period = 0.1 - - # Wait for writing to finish - while not self._disposable.is_disposed: - sleep(sleep_period) - waited += sleep_period - - # Have we reached the upper limit? - if waited >= max_wait_time: - logger.warning( - "Reached max_close_wait (%s seconds) waiting for batches to finish writing. Force closing", - max_wait_time - ) - break - - if self._window_scheduler: - self._window_scheduler.executor.shutdown(wait=False) - self._window_scheduler = None - - if self._disposable: - self._disposable = None - pass - - def _write_batching(self, bucket, org, data, - precision=DEFAULT_WRITE_PRECISION, - **kwargs): - if isinstance(data, bytes): - _key = _BatchItemKey(bucket, org, precision) - self._subject.on_next(_BatchItem(key=_key, data=data)) - - elif isinstance(data, str): - self._write_batching(bucket, org, data.encode(_UTF_8_encoding), - precision, **kwargs) - - elif isinstance(data, Point): - self._write_batching(bucket, org, data.to_line_protocol(), data.write_precision, **kwargs) - - elif isinstance(data, dict): - self._write_batching(bucket, org, Point.from_dict(data, write_precision=precision, **kwargs), - precision, **kwargs) - - elif 'DataFrame' in type(data).__name__: - serializer = DataframeSerializer(data, self._point_settings, precision, self._write_options.batch_size, - **kwargs) - for chunk_idx in range(serializer.number_of_chunks): - self._write_batching(bucket, org, - serializer.serialize(chunk_idx), - precision, **kwargs) - elif hasattr(data, "_asdict"): - # noinspection PyProtectedMember - self._write_batching(bucket, org, data._asdict(), precision, **kwargs) - - elif _HAS_DATACLASS and dataclasses.is_dataclass(data): - self._write_batching(bucket, org, dataclasses.asdict(data), precision, **kwargs) - - elif isinstance(data, Iterable): - for item in data: - self._write_batching(bucket, org, item, precision, **kwargs) - - elif isinstance(data, Observable): - data.subscribe(lambda it: self._write_batching(bucket, org, it, precision, **kwargs)) - pass - - return None - - def _http(self, batch_item: _BatchItem): - - logger.debug("Write time series data into InfluxDB: %s", batch_item) - - if self._retry_callback: - def _retry_callback_delegate(exception): - return self._retry_callback(batch_item.to_key_tuple(), batch_item.data, exception) - else: - _retry_callback_delegate = None - - retry = self._write_options.to_retry_strategy(retry_callback=_retry_callback_delegate) - - self._post_write(False, batch_item.key.bucket, batch_item.key.org, batch_item.data, - batch_item.key.precision, urlopen_kw={'retries': retry}) - - logger.debug("Write request finished %s", batch_item) - - return _BatchResponse(data=batch_item) - - def _post_write(self, _async_req, bucket, org, body, precision, **kwargs): - - return self._write_service.post_write(org=org, bucket=bucket, body=body, precision=precision, - async_req=_async_req, - content_type="text/plain; charset=utf-8", - **kwargs) - - def _to_response(self, data: _BatchItem, delay: timedelta): - - return rx.of(data).pipe( - ops.subscribe_on(self._write_options.write_scheduler), - # use delay if its specified - ops.delay(duetime=delay, scheduler=self._write_options.write_scheduler), - # invoke http call - ops.map(lambda x: self._http(x)), - # catch exception to fail batch response - ops.catch(handler=lambda exception, source: rx.just(_BatchResponse(exception=exception, data=data))), - ) - - def _jitter_delay(self): - return timedelta(milliseconds=random() * self._write_options.jitter_interval) - - def _on_next(self, response: _BatchResponse): - if response.exception: - logger.error("The batch item wasn't processed successfully because: %s", response.exception) - if self._error_callback: - try: - self._error_callback(response.data.to_key_tuple(), response.data.data, response.exception) - except Exception as e: - """ - Unfortunately, because callbacks are user-provided generic code, exceptions can be entirely - arbitrary - - We trap it, log that it occurred and then proceed - there's not much more that we can - really do. - """ - logger.error("The configured error callback threw an exception: %s", e) - - else: - logger.debug("The batch item: %s was processed successfully.", response) - if self._success_callback: - try: - self._success_callback(response.data.to_key_tuple(), response.data.data) - except Exception as e: - logger.error("The configured success callback threw an exception: %s", e) - - @staticmethod - def _on_error(ex): - logger.error("unexpected error during batching: %s", ex) - - def _on_complete(self): - self._disposable.dispose() - logger.info("the batching processor was disposed") - - def __getstate__(self): - """Return a dict of attributes that you want to pickle.""" - state = self.__dict__.copy() - # Remove rx - del state['_subject'] - del state['_disposable'] - del state['_window_scheduler'] - del state['_write_service'] - return state - - def __setstate__(self, state): - """Set your object with the provided dict.""" - self.__dict__.update(state) - # Init Rx - self.__init__(self._influxdb_client, - self._write_options, - self._point_settings, - success_callback=self._success_callback, - error_callback=self._error_callback, - retry_callback=self._retry_callback) diff --git a/frogpilot/third_party/influxdb_client/client/write_api_async.py b/frogpilot/third_party/influxdb_client/client/write_api_async.py deleted file mode 100644 index 38937eca..00000000 --- a/frogpilot/third_party/influxdb_client/client/write_api_async.py +++ /dev/null @@ -1,134 +0,0 @@ -"""Collect and async write time series data to InfluxDB Cloud or InfluxDB OSS.""" -import logging -from asyncio import ensure_future, gather -from collections import defaultdict -from typing import Union, Iterable, NamedTuple - -from influxdb_client import Point, WritePrecision -from influxdb_client.client._base import _BaseWriteApi, _HAS_DATACLASS -from influxdb_client.client.util.helpers import get_org_query_param -from influxdb_client.client.write.point import DEFAULT_WRITE_PRECISION -from influxdb_client.client.write_api import PointSettings - -logger = logging.getLogger('influxdb_client.client.write_api_async') - -if _HAS_DATACLASS: - from dataclasses import dataclass - - -class WriteApiAsync(_BaseWriteApi): - """ - Implementation for '/api/v2/write' endpoint. - - Example: - .. code-block:: python - - from influxdb_client_async import InfluxDBClientAsync - - - # Initialize async/await instance of Write API - async with InfluxDBClientAsync(url="http://localhost:8086", token="my-token", org="my-org") as client: - write_api = client.write_api() - """ - - def __init__(self, influxdb_client, point_settings: PointSettings = PointSettings()) -> None: - """ - Initialize defaults. - - :param influxdb_client: with default settings (organization) - :param point_settings: settings to store default tags. - """ - super().__init__(influxdb_client=influxdb_client, point_settings=point_settings) - - async def write(self, bucket: str, org: str = None, - record: Union[str, Iterable['str'], Point, Iterable['Point'], dict, Iterable['dict'], bytes, - Iterable['bytes'], NamedTuple, Iterable['NamedTuple'], 'dataclass', - Iterable['dataclass']] = None, - write_precision: WritePrecision = DEFAULT_WRITE_PRECISION, **kwargs) -> bool: - """ - Write time-series data into InfluxDB. - - :param str bucket: specifies the destination bucket for writes (required) - :param str, Organization org: specifies the destination organization for writes; - take the ID, Name or Organization. - If not specified the default value from ``InfluxDBClientAsync.org`` is used. - :param WritePrecision write_precision: specifies the precision for the unix timestamps within - the body line-protocol. The precision specified on a Point has precedes - and is use for write. - :param record: Point, Line Protocol, Dictionary, NamedTuple, Data Classes, Pandas DataFrame - :key data_frame_measurement_name: name of measurement for writing Pandas DataFrame - ``DataFrame`` - :key data_frame_tag_columns: list of DataFrame columns which are tags, - rest columns will be fields - ``DataFrame`` - :key data_frame_timestamp_column: name of DataFrame column which contains a timestamp. The column can be defined as a :class:`~str` value - formatted as `2018-10-26`, `2018-10-26 12:00`, `2018-10-26 12:00:00-05:00` - or other formats and types supported by `pandas.to_datetime `_ - ``DataFrame`` - :key data_frame_timestamp_timezone: name of the timezone which is used for timestamp column - ``DataFrame`` - :key record_measurement_key: key of record with specified measurement - - ``dictionary``, ``NamedTuple``, ``dataclass`` - :key record_measurement_name: static measurement name - ``dictionary``, ``NamedTuple``, ``dataclass`` - :key record_time_key: key of record with specified timestamp - ``dictionary``, ``NamedTuple``, ``dataclass`` - :key record_tag_keys: list of record keys to use as a tag - ``dictionary``, ``NamedTuple``, ``dataclass`` - :key record_field_keys: list of record keys to use as a field - ``dictionary``, ``NamedTuple``, ``dataclass`` - :return: ``True`` for successfully accepted data, otherwise raise an exception - - Example: - .. code-block:: python - - # Record as Line Protocol - await write_api.write("my-bucket", "my-org", "h2o_feet,location=us-west level=125i 1") - - # Record as Dictionary - dictionary = { - "measurement": "h2o_feet", - "tags": {"location": "us-west"}, - "fields": {"level": 125}, - "time": 1 - } - await write_api.write("my-bucket", "my-org", dictionary) - - # Record as Point - from influxdb_client import Point - point = Point("h2o_feet").tag("location", "us-west").field("level", 125).time(1) - await write_api.write("my-bucket", "my-org", point) - - DataFrame: - If the ``data_frame_timestamp_column`` is not specified the index of `Pandas DataFrame `_ - is used as a ``timestamp`` for written data. The index can be `PeriodIndex `_ - or its must be transformable to ``datetime`` by - `pandas.to_datetime `_. - - If you would like to transform a column to ``PeriodIndex``, you can use something like: - - .. code-block:: python - - import pandas as pd - - # DataFrame - data_frame = ... - # Set column as Index - data_frame.set_index('column_name', inplace=True) - # Transform index to PeriodIndex - data_frame.index = pd.to_datetime(data_frame.index, unit='s') - - """ # noqa: E501 - org = get_org_query_param(org=org, client=self._influxdb_client) - self._append_default_tags(record) - - payloads = defaultdict(list) - self._serialize(record, write_precision, payloads, precision_from_point=True, **kwargs) - - futures = [] - for payload_precision, payload_line in payloads.items(): - futures.append(ensure_future - (self._write_service.post_write_async(org=org, bucket=bucket, - body=b'\n'.join(payload_line), - precision=payload_precision, async_req=False, - _return_http_data_only=False, - content_type="text/plain; charset=utf-8"))) - - results = await gather(*futures, return_exceptions=True) - for result in results: - if isinstance(result, Exception): - raise result - - return False not in [re[1] in (201, 204) for re in results] diff --git a/frogpilot/third_party/influxdb_client/configuration.py b/frogpilot/third_party/influxdb_client/configuration.py deleted file mode 100644 index 96b10301..00000000 --- a/frogpilot/third_party/influxdb_client/configuration.py +++ /dev/null @@ -1,283 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import copy -import logging -import multiprocessing -import sys - -import urllib3 - - -class TypeWithDefault(type): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - Do not edit the class manually. - """ - - def __init__(cls, name, bases, dct): - """Initialize with defaults.""" - super(TypeWithDefault, cls).__init__(name, bases, dct) - cls._default = None - - def __call__(cls): - """Call self as a function.""" - if cls._default is None: - cls._default = type.__call__(cls) - return copy.copy(cls._default) - - def set_default(cls, default): - """Set dafaults.""" - cls._default = copy.copy(default) - - -class Configuration(object, metaclass=TypeWithDefault): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - Do not edit the class manually. - """ - - def __init__(self): - """Initialize configuration.""" - # Default Base url - self.host = "http://localhost/api/v2" - # Temp file folder for downloading files - self.temp_folder_path = None - - # Authentication Settings - # dict to store API key(s) - self.api_key = {} - # dict to store API prefix (e.g. Bearer) - self.api_key_prefix = {} - # Username for HTTP basic authentication - self.username = "" - # Password for HTTP basic authentication - self.password = "" - - # Logging Settings - self.loggers = {} - # Log format - self.logger_format = '%(asctime)s %(levelname)s %(message)s' - # Log stream handler - self.logger_stream_handler = None - # Log file handler - self.logger_file_handler = None - # Debug file location - self.logger_file = None - # Debug switch - self.debug = False - - # SSL/TLS verification - # Set this to false to skip verifying SSL certificate when calling API - # from https server. - self.verify_ssl = True - # Set this to customize the certificate file to verify the peer. - self.ssl_ca_cert = None - # client certificate file - self.cert_file = None - # client key file - self.cert_key_file = None - # client key file password - self.cert_key_password = None - # Set this to True/False to enable/disable SSL hostname verification. - self.assert_hostname = None - - # Set this to specify a custom ssl context to inject this context inside the urllib3 connection pool. - self.ssl_context = None - - # urllib3 connection pool's maximum number of connections saved - # per pool. urllib3 uses 1 connection as default value, but this is - # not the best value when you are making a lot of possibly parallel - # requests to the same host, which is often the case here. - # cpu_count * 5 is used as default value to increase performance. - self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 - # Timeout setting for a request. If one number provided, it will be total request timeout. - # It can also be a pair (tuple) of (connection, read) timeouts. - self.timeout = None - - # Set to True/False to enable basic authentication when using proxied InfluxDB 1.8.x with no auth-enabled - self.auth_basic = False - - # Proxy URL - self.proxy = None - # A dictionary containing headers that will be sent to the proxy - self.proxy_headers = None - # Safe chars for path_param - self.safe_chars_for_path_param = '' - - @property - def logger_file(self): - """Logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - return self.__logger_file - - @logger_file.setter - def logger_file(self, value): - """Logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - self.__logger_file = value - if self.__logger_file: - # If set logging file, - # then add file handler and remove stream handler. - self.logger_file_handler = logging.FileHandler(self.__logger_file) - self.logger_file_handler.setFormatter(self.logger_formatter) - for _, logger in self.loggers.items(): - logger.addHandler(self.logger_file_handler) - - @property - def debug(self): - """Debug status. - - :param value: The debug status, True or False. - :type: bool - """ - return self.__debug - - @debug.setter - def debug(self, value): - """Debug status. - - :param value: The debug status, True or False. - :type: bool - """ - self.__debug = value - if self.__debug: - # if debug status is True, turn on debug logging - for name, logger in self.loggers.items(): - logger.setLevel(logging.DEBUG) - if name == 'influxdb_client.client.http': - # makes sure to do not duplicate stdout handler - if not any(map(lambda h: isinstance(h, logging.StreamHandler) and h.stream == sys.stdout, - logger.handlers)): - logger.addHandler(logging.StreamHandler(sys.stdout)) - # we use 'influxdb_client.client.http' logger instead of this - # httplib.HTTPConnection.debuglevel = 1 - else: - # if debug status is False, turn off debug logging, - # setting log level to default `logging.WARNING` - for _, logger in self.loggers.items(): - logger.setLevel(logging.WARNING) - # we use 'influxdb_client.client.http' logger instead of this - # httplib.HTTPConnection.debuglevel = 0 - - @property - def logger_format(self): - """Logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - return self.__logger_format - - @logger_format.setter - def logger_format(self, value): - """Logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - self.__logger_format = value - self.logger_formatter = logging.Formatter(self.__logger_format) - - def get_api_key_with_prefix(self, identifier): - """Get API key (with prefix if set). - - :param identifier: The identifier of apiKey. - :return: The token for api key authentication. - """ - if (self.api_key.get(identifier) and - self.api_key_prefix.get(identifier)): - return self.api_key_prefix[identifier] + ' ' + self.api_key[identifier] # noqa: E501 - elif self.api_key.get(identifier): - return self.api_key[identifier] - - def get_basic_auth_token(self): - """Get HTTP basic authentication header (string). - - :return: The token for basic HTTP authentication. - """ - return urllib3.util.make_headers( - basic_auth=self.username + ':' + self.password - ).get('authorization') - - def auth_settings(self): - """Get Auth Settings dict for api client. - - :return: The Auth Settings information dict. - """ - return { - 'BasicAuthentication': - { - 'type': 'basic', - 'in': 'header', - 'key': 'Authorization', - 'value': self.get_basic_auth_token() - }, - 'TokenAuthentication': - { - 'type': 'api_key', - 'in': 'header', - 'key': 'Authorization', - 'value': self.get_api_key_with_prefix('Authorization') - }, - - } - - def to_debug_report(self): - """Get the essential information for debugging. - - :return: The report for debugging. - """ - from influxdb_client import VERSION - return "Python SDK Debug Report:\n"\ - "OS: {env}\n"\ - "Python Version: {pyversion}\n"\ - "Version of the API: 2.0.0\n"\ - "SDK Package Version: {client_version}".\ - format(env=sys.platform, pyversion=sys.version, client_version=VERSION) - - def update_request_header_params(self, path: str, params: dict): - """Update header params based on custom settings. - - :param path: Resource path - :param params: Header parameters dict to be updated. - """ - pass - - def update_request_body(self, path: str, body): - """Update http body based on custom settings. - - :param path: Resource path - :param body: Request body to be updated. - :return: Updated body - """ - return body diff --git a/frogpilot/third_party/influxdb_client/domain/__init__.py b/frogpilot/third_party/influxdb_client/domain/__init__.py deleted file mode 100644 index e9a69d61..00000000 --- a/frogpilot/third_party/influxdb_client/domain/__init__.py +++ /dev/null @@ -1,335 +0,0 @@ -# coding: utf-8 - -# flake8: noqa -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -# import models into model package -from influxdb_client.domain.ast_response import ASTResponse -from influxdb_client.domain.add_resource_member_request_body import AddResourceMemberRequestBody -from influxdb_client.domain.analyze_query_response import AnalyzeQueryResponse -from influxdb_client.domain.analyze_query_response_errors import AnalyzeQueryResponseErrors -from influxdb_client.domain.array_expression import ArrayExpression -from influxdb_client.domain.authorization import Authorization -from influxdb_client.domain.authorization_post_request import AuthorizationPostRequest -from influxdb_client.domain.authorization_update_request import AuthorizationUpdateRequest -from influxdb_client.domain.authorizations import Authorizations -from influxdb_client.domain.axes import Axes -from influxdb_client.domain.axis import Axis -from influxdb_client.domain.axis_scale import AxisScale -from influxdb_client.domain.bad_statement import BadStatement -from influxdb_client.domain.band_view_properties import BandViewProperties -from influxdb_client.domain.binary_expression import BinaryExpression -from influxdb_client.domain.block import Block -from influxdb_client.domain.boolean_literal import BooleanLiteral -from influxdb_client.domain.bucket import Bucket -from influxdb_client.domain.bucket_links import BucketLinks -from influxdb_client.domain.bucket_metadata_manifest import BucketMetadataManifest -from influxdb_client.domain.bucket_retention_rules import BucketRetentionRules -from influxdb_client.domain.bucket_shard_mapping import BucketShardMapping -from influxdb_client.domain.buckets import Buckets -from influxdb_client.domain.builder_aggregate_function_type import BuilderAggregateFunctionType -from influxdb_client.domain.builder_config import BuilderConfig -from influxdb_client.domain.builder_config_aggregate_window import BuilderConfigAggregateWindow -from influxdb_client.domain.builder_functions_type import BuilderFunctionsType -from influxdb_client.domain.builder_tags_type import BuilderTagsType -from influxdb_client.domain.builtin_statement import BuiltinStatement -from influxdb_client.domain.call_expression import CallExpression -from influxdb_client.domain.cell import Cell -from influxdb_client.domain.cell_links import CellLinks -from influxdb_client.domain.cell_update import CellUpdate -from influxdb_client.domain.cell_with_view_properties import CellWithViewProperties -from influxdb_client.domain.check import Check -from influxdb_client.domain.check_base import CheckBase -from influxdb_client.domain.check_base_links import CheckBaseLinks -from influxdb_client.domain.check_discriminator import CheckDiscriminator -from influxdb_client.domain.check_patch import CheckPatch -from influxdb_client.domain.check_status_level import CheckStatusLevel -from influxdb_client.domain.check_view_properties import CheckViewProperties -from influxdb_client.domain.checks import Checks -from influxdb_client.domain.column_data_type import ColumnDataType -from influxdb_client.domain.column_semantic_type import ColumnSemanticType -from influxdb_client.domain.conditional_expression import ConditionalExpression -from influxdb_client.domain.config import Config -from influxdb_client.domain.constant_variable_properties import ConstantVariableProperties -from influxdb_client.domain.create_cell import CreateCell -from influxdb_client.domain.create_dashboard_request import CreateDashboardRequest -from influxdb_client.domain.custom_check import CustomCheck -from influxdb_client.domain.dbrp import DBRP -from influxdb_client.domain.dbrp_create import DBRPCreate -from influxdb_client.domain.dbrp_get import DBRPGet -from influxdb_client.domain.dbrp_update import DBRPUpdate -from influxdb_client.domain.dbr_ps import DBRPs -from influxdb_client.domain.dashboard import Dashboard -from influxdb_client.domain.dashboard_color import DashboardColor -from influxdb_client.domain.dashboard_query import DashboardQuery -from influxdb_client.domain.dashboard_with_view_properties import DashboardWithViewProperties -from influxdb_client.domain.dashboards import Dashboards -from influxdb_client.domain.date_time_literal import DateTimeLiteral -from influxdb_client.domain.deadman_check import DeadmanCheck -from influxdb_client.domain.decimal_places import DecimalPlaces -from influxdb_client.domain.delete_predicate_request import DeletePredicateRequest -from influxdb_client.domain.dialect import Dialect -from influxdb_client.domain.dict_expression import DictExpression -from influxdb_client.domain.dict_item import DictItem -from influxdb_client.domain.duration import Duration -from influxdb_client.domain.duration_literal import DurationLiteral -from influxdb_client.domain.error import Error -from influxdb_client.domain.expression import Expression -from influxdb_client.domain.expression_statement import ExpressionStatement -from influxdb_client.domain.field import Field -from influxdb_client.domain.file import File -from influxdb_client.domain.float_literal import FloatLiteral -from influxdb_client.domain.flux_response import FluxResponse -from influxdb_client.domain.flux_suggestion import FluxSuggestion -from influxdb_client.domain.flux_suggestions import FluxSuggestions -from influxdb_client.domain.function_expression import FunctionExpression -from influxdb_client.domain.gauge_view_properties import GaugeViewProperties -from influxdb_client.domain.greater_threshold import GreaterThreshold -from influxdb_client.domain.http_notification_endpoint import HTTPNotificationEndpoint -from influxdb_client.domain.http_notification_rule import HTTPNotificationRule -from influxdb_client.domain.http_notification_rule_base import HTTPNotificationRuleBase -from influxdb_client.domain.health_check import HealthCheck -from influxdb_client.domain.heatmap_view_properties import HeatmapViewProperties -from influxdb_client.domain.histogram_view_properties import HistogramViewProperties -from influxdb_client.domain.identifier import Identifier -from influxdb_client.domain.import_declaration import ImportDeclaration -from influxdb_client.domain.index_expression import IndexExpression -from influxdb_client.domain.integer_literal import IntegerLiteral -from influxdb_client.domain.is_onboarding import IsOnboarding -from influxdb_client.domain.label import Label -from influxdb_client.domain.label_create_request import LabelCreateRequest -from influxdb_client.domain.label_mapping import LabelMapping -from influxdb_client.domain.label_response import LabelResponse -from influxdb_client.domain.label_update import LabelUpdate -from influxdb_client.domain.labels_response import LabelsResponse -from influxdb_client.domain.language_request import LanguageRequest -from influxdb_client.domain.legacy_authorization_post_request import LegacyAuthorizationPostRequest -from influxdb_client.domain.lesser_threshold import LesserThreshold -from influxdb_client.domain.line_plus_single_stat_properties import LinePlusSingleStatProperties -from influxdb_client.domain.line_protocol_error import LineProtocolError -from influxdb_client.domain.line_protocol_length_error import LineProtocolLengthError -from influxdb_client.domain.links import Links -from influxdb_client.domain.list_stacks_response import ListStacksResponse -from influxdb_client.domain.log_event import LogEvent -from influxdb_client.domain.logical_expression import LogicalExpression -from influxdb_client.domain.logs import Logs -from influxdb_client.domain.map_variable_properties import MapVariableProperties -from influxdb_client.domain.markdown_view_properties import MarkdownViewProperties -from influxdb_client.domain.measurement_schema import MeasurementSchema -from influxdb_client.domain.measurement_schema_column import MeasurementSchemaColumn -from influxdb_client.domain.measurement_schema_create_request import MeasurementSchemaCreateRequest -from influxdb_client.domain.measurement_schema_list import MeasurementSchemaList -from influxdb_client.domain.measurement_schema_update_request import MeasurementSchemaUpdateRequest -from influxdb_client.domain.member_assignment import MemberAssignment -from influxdb_client.domain.member_expression import MemberExpression -from influxdb_client.domain.metadata_backup import MetadataBackup -from influxdb_client.domain.model_property import ModelProperty -from influxdb_client.domain.mosaic_view_properties import MosaicViewProperties -from influxdb_client.domain.node import Node -from influxdb_client.domain.notification_endpoint import NotificationEndpoint -from influxdb_client.domain.notification_endpoint_base import NotificationEndpointBase -from influxdb_client.domain.notification_endpoint_base_links import NotificationEndpointBaseLinks -from influxdb_client.domain.notification_endpoint_discriminator import NotificationEndpointDiscriminator -from influxdb_client.domain.notification_endpoint_type import NotificationEndpointType -from influxdb_client.domain.notification_endpoint_update import NotificationEndpointUpdate -from influxdb_client.domain.notification_endpoints import NotificationEndpoints -from influxdb_client.domain.notification_rule import NotificationRule -from influxdb_client.domain.notification_rule_base import NotificationRuleBase -from influxdb_client.domain.notification_rule_base_links import NotificationRuleBaseLinks -from influxdb_client.domain.notification_rule_discriminator import NotificationRuleDiscriminator -from influxdb_client.domain.notification_rule_update import NotificationRuleUpdate -from influxdb_client.domain.notification_rules import NotificationRules -from influxdb_client.domain.object_expression import ObjectExpression -from influxdb_client.domain.onboarding_request import OnboardingRequest -from influxdb_client.domain.onboarding_response import OnboardingResponse -from influxdb_client.domain.option_statement import OptionStatement -from influxdb_client.domain.organization import Organization -from influxdb_client.domain.organization_links import OrganizationLinks -from influxdb_client.domain.organizations import Organizations -from influxdb_client.domain.package import Package -from influxdb_client.domain.package_clause import PackageClause -from influxdb_client.domain.pager_duty_notification_endpoint import PagerDutyNotificationEndpoint -from influxdb_client.domain.pager_duty_notification_rule import PagerDutyNotificationRule -from influxdb_client.domain.pager_duty_notification_rule_base import PagerDutyNotificationRuleBase -from influxdb_client.domain.paren_expression import ParenExpression -from influxdb_client.domain.password_reset_body import PasswordResetBody -from influxdb_client.domain.patch_bucket_request import PatchBucketRequest -from influxdb_client.domain.patch_dashboard_request import PatchDashboardRequest -from influxdb_client.domain.patch_organization_request import PatchOrganizationRequest -from influxdb_client.domain.patch_retention_rule import PatchRetentionRule -from influxdb_client.domain.patch_stack_request import PatchStackRequest -from influxdb_client.domain.patch_stack_request_additional_resources import PatchStackRequestAdditionalResources -from influxdb_client.domain.permission import Permission -from influxdb_client.domain.permission_resource import PermissionResource -from influxdb_client.domain.pipe_expression import PipeExpression -from influxdb_client.domain.pipe_literal import PipeLiteral -from influxdb_client.domain.post_bucket_request import PostBucketRequest -from influxdb_client.domain.post_check import PostCheck -from influxdb_client.domain.post_notification_endpoint import PostNotificationEndpoint -from influxdb_client.domain.post_notification_rule import PostNotificationRule -from influxdb_client.domain.post_organization_request import PostOrganizationRequest -from influxdb_client.domain.post_restore_kv_response import PostRestoreKVResponse -from influxdb_client.domain.post_stack_request import PostStackRequest -from influxdb_client.domain.property_key import PropertyKey -from influxdb_client.domain.query import Query -from influxdb_client.domain.query_edit_mode import QueryEditMode -from influxdb_client.domain.query_variable_properties import QueryVariableProperties -from influxdb_client.domain.query_variable_properties_values import QueryVariablePropertiesValues -from influxdb_client.domain.range_threshold import RangeThreshold -from influxdb_client.domain.ready import Ready -from influxdb_client.domain.regexp_literal import RegexpLiteral -from influxdb_client.domain.remote_connection import RemoteConnection -from influxdb_client.domain.remote_connection_creation_request import RemoteConnectionCreationRequest -from influxdb_client.domain.remote_connection_update_request import RemoteConnectionUpdateRequest -from influxdb_client.domain.remote_connections import RemoteConnections -from influxdb_client.domain.renamable_field import RenamableField -from influxdb_client.domain.replication import Replication -from influxdb_client.domain.replication_creation_request import ReplicationCreationRequest -from influxdb_client.domain.replication_update_request import ReplicationUpdateRequest -from influxdb_client.domain.replications import Replications -from influxdb_client.domain.resource_member import ResourceMember -from influxdb_client.domain.resource_members import ResourceMembers -from influxdb_client.domain.resource_members_links import ResourceMembersLinks -from influxdb_client.domain.resource_owner import ResourceOwner -from influxdb_client.domain.resource_owners import ResourceOwners -from influxdb_client.domain.restored_bucket_mappings import RestoredBucketMappings -from influxdb_client.domain.retention_policy_manifest import RetentionPolicyManifest -from influxdb_client.domain.return_statement import ReturnStatement -from influxdb_client.domain.routes import Routes -from influxdb_client.domain.routes_external import RoutesExternal -from influxdb_client.domain.routes_query import RoutesQuery -from influxdb_client.domain.routes_system import RoutesSystem -from influxdb_client.domain.rule_status_level import RuleStatusLevel -from influxdb_client.domain.run import Run -from influxdb_client.domain.run_links import RunLinks -from influxdb_client.domain.run_manually import RunManually -from influxdb_client.domain.runs import Runs -from influxdb_client.domain.smtp_notification_rule import SMTPNotificationRule -from influxdb_client.domain.smtp_notification_rule_base import SMTPNotificationRuleBase -from influxdb_client.domain.scatter_view_properties import ScatterViewProperties -from influxdb_client.domain.schema_type import SchemaType -from influxdb_client.domain.scraper_target_request import ScraperTargetRequest -from influxdb_client.domain.scraper_target_response import ScraperTargetResponse -from influxdb_client.domain.scraper_target_responses import ScraperTargetResponses -from influxdb_client.domain.script import Script -from influxdb_client.domain.script_create_request import ScriptCreateRequest -from influxdb_client.domain.script_invocation_params import ScriptInvocationParams -from influxdb_client.domain.script_language import ScriptLanguage -from influxdb_client.domain.script_update_request import ScriptUpdateRequest -from influxdb_client.domain.scripts import Scripts -from influxdb_client.domain.secret_keys import SecretKeys -from influxdb_client.domain.secret_keys_response import SecretKeysResponse -from influxdb_client.domain.shard_group_manifest import ShardGroupManifest -from influxdb_client.domain.shard_manifest import ShardManifest -from influxdb_client.domain.shard_owner import ShardOwner -from influxdb_client.domain.simple_table_view_properties import SimpleTableViewProperties -from influxdb_client.domain.single_stat_view_properties import SingleStatViewProperties -from influxdb_client.domain.slack_notification_endpoint import SlackNotificationEndpoint -from influxdb_client.domain.slack_notification_rule import SlackNotificationRule -from influxdb_client.domain.slack_notification_rule_base import SlackNotificationRuleBase -from influxdb_client.domain.source import Source -from influxdb_client.domain.source_links import SourceLinks -from influxdb_client.domain.sources import Sources -from influxdb_client.domain.stack import Stack -from influxdb_client.domain.stack_associations import StackAssociations -from influxdb_client.domain.stack_events import StackEvents -from influxdb_client.domain.stack_links import StackLinks -from influxdb_client.domain.stack_resources import StackResources -from influxdb_client.domain.statement import Statement -from influxdb_client.domain.static_legend import StaticLegend -from influxdb_client.domain.status_rule import StatusRule -from influxdb_client.domain.string_literal import StringLiteral -from influxdb_client.domain.subscription_manifest import SubscriptionManifest -from influxdb_client.domain.table_view_properties import TableViewProperties -from influxdb_client.domain.table_view_properties_table_options import TableViewPropertiesTableOptions -from influxdb_client.domain.tag_rule import TagRule -from influxdb_client.domain.task import Task -from influxdb_client.domain.task_create_request import TaskCreateRequest -from influxdb_client.domain.task_links import TaskLinks -from influxdb_client.domain.task_status_type import TaskStatusType -from influxdb_client.domain.task_update_request import TaskUpdateRequest -from influxdb_client.domain.tasks import Tasks -from influxdb_client.domain.telegraf import Telegraf -from influxdb_client.domain.telegraf_plugin import TelegrafPlugin -from influxdb_client.domain.telegraf_plugin_request import TelegrafPluginRequest -from influxdb_client.domain.telegraf_plugin_request_plugins import TelegrafPluginRequestPlugins -from influxdb_client.domain.telegraf_plugins import TelegrafPlugins -from influxdb_client.domain.telegraf_request import TelegrafRequest -from influxdb_client.domain.telegraf_request_metadata import TelegrafRequestMetadata -from influxdb_client.domain.telegrafs import Telegrafs -from influxdb_client.domain.telegram_notification_endpoint import TelegramNotificationEndpoint -from influxdb_client.domain.telegram_notification_rule import TelegramNotificationRule -from influxdb_client.domain.telegram_notification_rule_base import TelegramNotificationRuleBase -from influxdb_client.domain.template_apply import TemplateApply -from influxdb_client.domain.template_apply_remotes import TemplateApplyRemotes -from influxdb_client.domain.template_apply_template import TemplateApplyTemplate -from influxdb_client.domain.template_chart import TemplateChart -from influxdb_client.domain.template_export_by_id import TemplateExportByID -from influxdb_client.domain.template_export_by_id_org_ids import TemplateExportByIDOrgIDs -from influxdb_client.domain.template_export_by_id_resource_filters import TemplateExportByIDResourceFilters -from influxdb_client.domain.template_export_by_id_resources import TemplateExportByIDResources -from influxdb_client.domain.template_export_by_name import TemplateExportByName -from influxdb_client.domain.template_export_by_name_resources import TemplateExportByNameResources -from influxdb_client.domain.template_kind import TemplateKind -from influxdb_client.domain.template_summary import TemplateSummary -from influxdb_client.domain.template_summary_diff import TemplateSummaryDiff -from influxdb_client.domain.template_summary_diff_buckets import TemplateSummaryDiffBuckets -from influxdb_client.domain.template_summary_diff_buckets_new_old import TemplateSummaryDiffBucketsNewOld -from influxdb_client.domain.template_summary_diff_checks import TemplateSummaryDiffChecks -from influxdb_client.domain.template_summary_diff_dashboards import TemplateSummaryDiffDashboards -from influxdb_client.domain.template_summary_diff_dashboards_new_old import TemplateSummaryDiffDashboardsNewOld -from influxdb_client.domain.template_summary_diff_label_mappings import TemplateSummaryDiffLabelMappings -from influxdb_client.domain.template_summary_diff_labels import TemplateSummaryDiffLabels -from influxdb_client.domain.template_summary_diff_labels_new_old import TemplateSummaryDiffLabelsNewOld -from influxdb_client.domain.template_summary_diff_notification_endpoints import TemplateSummaryDiffNotificationEndpoints -from influxdb_client.domain.template_summary_diff_notification_rules import TemplateSummaryDiffNotificationRules -from influxdb_client.domain.template_summary_diff_notification_rules_new_old import TemplateSummaryDiffNotificationRulesNewOld -from influxdb_client.domain.template_summary_diff_tasks import TemplateSummaryDiffTasks -from influxdb_client.domain.template_summary_diff_tasks_new_old import TemplateSummaryDiffTasksNewOld -from influxdb_client.domain.template_summary_diff_telegraf_configs import TemplateSummaryDiffTelegrafConfigs -from influxdb_client.domain.template_summary_diff_variables import TemplateSummaryDiffVariables -from influxdb_client.domain.template_summary_diff_variables_new_old import TemplateSummaryDiffVariablesNewOld -from influxdb_client.domain.template_summary_errors import TemplateSummaryErrors -from influxdb_client.domain.template_summary_label import TemplateSummaryLabel -from influxdb_client.domain.template_summary_label_properties import TemplateSummaryLabelProperties -from influxdb_client.domain.template_summary_summary import TemplateSummarySummary -from influxdb_client.domain.template_summary_summary_buckets import TemplateSummarySummaryBuckets -from influxdb_client.domain.template_summary_summary_dashboards import TemplateSummarySummaryDashboards -from influxdb_client.domain.template_summary_summary_label_mappings import TemplateSummarySummaryLabelMappings -from influxdb_client.domain.template_summary_summary_notification_rules import TemplateSummarySummaryNotificationRules -from influxdb_client.domain.template_summary_summary_status_rules import TemplateSummarySummaryStatusRules -from influxdb_client.domain.template_summary_summary_tag_rules import TemplateSummarySummaryTagRules -from influxdb_client.domain.template_summary_summary_tasks import TemplateSummarySummaryTasks -from influxdb_client.domain.template_summary_summary_variables import TemplateSummarySummaryVariables -from influxdb_client.domain.test_statement import TestStatement -from influxdb_client.domain.threshold import Threshold -from influxdb_client.domain.threshold_base import ThresholdBase -from influxdb_client.domain.threshold_check import ThresholdCheck -from influxdb_client.domain.unary_expression import UnaryExpression -from influxdb_client.domain.unsigned_integer_literal import UnsignedIntegerLiteral -from influxdb_client.domain.user import User -from influxdb_client.domain.user_response import UserResponse -from influxdb_client.domain.user_response_links import UserResponseLinks -from influxdb_client.domain.users import Users -from influxdb_client.domain.variable import Variable -from influxdb_client.domain.variable_assignment import VariableAssignment -from influxdb_client.domain.variable_links import VariableLinks -from influxdb_client.domain.variable_properties import VariableProperties -from influxdb_client.domain.variables import Variables -from influxdb_client.domain.view import View -from influxdb_client.domain.view_links import ViewLinks -from influxdb_client.domain.view_properties import ViewProperties -from influxdb_client.domain.views import Views -from influxdb_client.domain.write_precision import WritePrecision -from influxdb_client.domain.xy_geom import XYGeom -from influxdb_client.domain.xy_view_properties import XYViewProperties diff --git a/frogpilot/third_party/influxdb_client/domain/add_resource_member_request_body.py b/frogpilot/third_party/influxdb_client/domain/add_resource_member_request_body.py deleted file mode 100644 index ffcddd86..00000000 --- a/frogpilot/third_party/influxdb_client/domain/add_resource_member_request_body.py +++ /dev/null @@ -1,139 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class AddResourceMemberRequestBody(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'str', - 'name': 'str' - } - - attribute_map = { - 'id': 'id', - 'name': 'name' - } - - def __init__(self, id=None, name=None): # noqa: E501,D401,D403 - """AddResourceMemberRequestBody - a model defined in OpenAPI.""" # noqa: E501 - self._id = None - self._name = None - self.discriminator = None - - self.id = id - if name is not None: - self.name = name - - @property - def id(self): - """Get the id of this AddResourceMemberRequestBody. - - The ID of the user to add to the resource. - - :return: The id of this AddResourceMemberRequestBody. - :rtype: str - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this AddResourceMemberRequestBody. - - The ID of the user to add to the resource. - - :param id: The id of this AddResourceMemberRequestBody. - :type: str - """ # noqa: E501 - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 - self._id = id - - @property - def name(self): - """Get the name of this AddResourceMemberRequestBody. - - The name of the user to add to the resource. - - :return: The name of this AddResourceMemberRequestBody. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this AddResourceMemberRequestBody. - - The name of the user to add to the resource. - - :param name: The name of this AddResourceMemberRequestBody. - :type: str - """ # noqa: E501 - self._name = name - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, AddResourceMemberRequestBody): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/analyze_query_response.py b/frogpilot/third_party/influxdb_client/domain/analyze_query_response.py deleted file mode 100644 index ef7d1828..00000000 --- a/frogpilot/third_party/influxdb_client/domain/analyze_query_response.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class AnalyzeQueryResponse(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'errors': 'list[AnalyzeQueryResponseErrors]' - } - - attribute_map = { - 'errors': 'errors' - } - - def __init__(self, errors=None): # noqa: E501,D401,D403 - """AnalyzeQueryResponse - a model defined in OpenAPI.""" # noqa: E501 - self._errors = None - self.discriminator = None - - if errors is not None: - self.errors = errors - - @property - def errors(self): - """Get the errors of this AnalyzeQueryResponse. - - :return: The errors of this AnalyzeQueryResponse. - :rtype: list[AnalyzeQueryResponseErrors] - """ # noqa: E501 - return self._errors - - @errors.setter - def errors(self, errors): - """Set the errors of this AnalyzeQueryResponse. - - :param errors: The errors of this AnalyzeQueryResponse. - :type: list[AnalyzeQueryResponseErrors] - """ # noqa: E501 - self._errors = errors - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, AnalyzeQueryResponse): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/analyze_query_response_errors.py b/frogpilot/third_party/influxdb_client/domain/analyze_query_response_errors.py deleted file mode 100644 index 7a35dc68..00000000 --- a/frogpilot/third_party/influxdb_client/domain/analyze_query_response_errors.py +++ /dev/null @@ -1,176 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class AnalyzeQueryResponseErrors(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'line': 'int', - 'column': 'int', - 'character': 'int', - 'message': 'str' - } - - attribute_map = { - 'line': 'line', - 'column': 'column', - 'character': 'character', - 'message': 'message' - } - - def __init__(self, line=None, column=None, character=None, message=None): # noqa: E501,D401,D403 - """AnalyzeQueryResponseErrors - a model defined in OpenAPI.""" # noqa: E501 - self._line = None - self._column = None - self._character = None - self._message = None - self.discriminator = None - - if line is not None: - self.line = line - if column is not None: - self.column = column - if character is not None: - self.character = character - if message is not None: - self.message = message - - @property - def line(self): - """Get the line of this AnalyzeQueryResponseErrors. - - :return: The line of this AnalyzeQueryResponseErrors. - :rtype: int - """ # noqa: E501 - return self._line - - @line.setter - def line(self, line): - """Set the line of this AnalyzeQueryResponseErrors. - - :param line: The line of this AnalyzeQueryResponseErrors. - :type: int - """ # noqa: E501 - self._line = line - - @property - def column(self): - """Get the column of this AnalyzeQueryResponseErrors. - - :return: The column of this AnalyzeQueryResponseErrors. - :rtype: int - """ # noqa: E501 - return self._column - - @column.setter - def column(self, column): - """Set the column of this AnalyzeQueryResponseErrors. - - :param column: The column of this AnalyzeQueryResponseErrors. - :type: int - """ # noqa: E501 - self._column = column - - @property - def character(self): - """Get the character of this AnalyzeQueryResponseErrors. - - :return: The character of this AnalyzeQueryResponseErrors. - :rtype: int - """ # noqa: E501 - return self._character - - @character.setter - def character(self, character): - """Set the character of this AnalyzeQueryResponseErrors. - - :param character: The character of this AnalyzeQueryResponseErrors. - :type: int - """ # noqa: E501 - self._character = character - - @property - def message(self): - """Get the message of this AnalyzeQueryResponseErrors. - - :return: The message of this AnalyzeQueryResponseErrors. - :rtype: str - """ # noqa: E501 - return self._message - - @message.setter - def message(self, message): - """Set the message of this AnalyzeQueryResponseErrors. - - :param message: The message of this AnalyzeQueryResponseErrors. - :type: str - """ # noqa: E501 - self._message = message - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, AnalyzeQueryResponseErrors): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/array_expression.py b/frogpilot/third_party/influxdb_client/domain/array_expression.py deleted file mode 100644 index 0c285317..00000000 --- a/frogpilot/third_party/influxdb_client/domain/array_expression.py +++ /dev/null @@ -1,142 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.expression import Expression - - -class ArrayExpression(Expression): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'elements': 'list[Expression]' - } - - attribute_map = { - 'type': 'type', - 'elements': 'elements' - } - - def __init__(self, type=None, elements=None): # noqa: E501,D401,D403 - """ArrayExpression - a model defined in OpenAPI.""" # noqa: E501 - Expression.__init__(self) # noqa: E501 - - self._type = None - self._elements = None - self.discriminator = None - - if type is not None: - self.type = type - if elements is not None: - self.elements = elements - - @property - def type(self): - """Get the type of this ArrayExpression. - - Type of AST node - - :return: The type of this ArrayExpression. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this ArrayExpression. - - Type of AST node - - :param type: The type of this ArrayExpression. - :type: str - """ # noqa: E501 - self._type = type - - @property - def elements(self): - """Get the elements of this ArrayExpression. - - Elements of the array - - :return: The elements of this ArrayExpression. - :rtype: list[Expression] - """ # noqa: E501 - return self._elements - - @elements.setter - def elements(self, elements): - """Set the elements of this ArrayExpression. - - Elements of the array - - :param elements: The elements of this ArrayExpression. - :type: list[Expression] - """ # noqa: E501 - self._elements = elements - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, ArrayExpression): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/ast_response.py b/frogpilot/third_party/influxdb_client/domain/ast_response.py deleted file mode 100644 index 227cfddd..00000000 --- a/frogpilot/third_party/influxdb_client/domain/ast_response.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class ASTResponse(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'ast': 'Package' - } - - attribute_map = { - 'ast': 'ast' - } - - def __init__(self, ast=None): # noqa: E501,D401,D403 - """ASTResponse - a model defined in OpenAPI.""" # noqa: E501 - self._ast = None - self.discriminator = None - - if ast is not None: - self.ast = ast - - @property - def ast(self): - """Get the ast of this ASTResponse. - - :return: The ast of this ASTResponse. - :rtype: Package - """ # noqa: E501 - return self._ast - - @ast.setter - def ast(self, ast): - """Set the ast of this ASTResponse. - - :param ast: The ast of this ASTResponse. - :type: Package - """ # noqa: E501 - self._ast = ast - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, ASTResponse): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/authorization.py b/frogpilot/third_party/influxdb_client/domain/authorization.py deleted file mode 100644 index aef38d9c..00000000 --- a/frogpilot/third_party/influxdb_client/domain/authorization.py +++ /dev/null @@ -1,354 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.authorization_update_request import AuthorizationUpdateRequest - - -class Authorization(AuthorizationUpdateRequest): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'created_at': 'datetime', - 'updated_at': 'datetime', - 'org_id': 'str', - 'permissions': 'list[Permission]', - 'id': 'str', - 'token': 'str', - 'user_id': 'str', - 'user': 'str', - 'org': 'str', - 'links': 'object', - 'status': 'str', - 'description': 'str' - } - - attribute_map = { - 'created_at': 'createdAt', - 'updated_at': 'updatedAt', - 'org_id': 'orgID', - 'permissions': 'permissions', - 'id': 'id', - 'token': 'token', - 'user_id': 'userID', - 'user': 'user', - 'org': 'org', - 'links': 'links', - 'status': 'status', - 'description': 'description' - } - - def __init__(self, created_at=None, updated_at=None, org_id=None, permissions=None, id=None, token=None, user_id=None, user=None, org=None, links=None, status='active', description=None): # noqa: E501,D401,D403 - """Authorization - a model defined in OpenAPI.""" # noqa: E501 - AuthorizationUpdateRequest.__init__(self, status=status, description=description) # noqa: E501 - - self._created_at = None - self._updated_at = None - self._org_id = None - self._permissions = None - self._id = None - self._token = None - self._user_id = None - self._user = None - self._org = None - self._links = None - self.discriminator = None - - if created_at is not None: - self.created_at = created_at - if updated_at is not None: - self.updated_at = updated_at - if org_id is not None: - if not isinstance(org_id, str): - raise TypeError("org_id must be a string.") - self.org_id = org_id - if permissions is not None: - if not isinstance(permissions, list): - raise TypeError("permissions must be a list.") - self.permissions = permissions - if id is not None: - self.id = id - if token is not None: - self.token = token - if user_id is not None: - self.user_id = user_id - if user is not None: - self.user = user - if org is not None: - self.org = org - if links is not None: - self.links = links - - @property - def created_at(self): - """Get the created_at of this Authorization. - - :return: The created_at of this Authorization. - :rtype: datetime - """ # noqa: E501 - return self._created_at - - @created_at.setter - def created_at(self, created_at): - """Set the created_at of this Authorization. - - :param created_at: The created_at of this Authorization. - :type: datetime - """ # noqa: E501 - self._created_at = created_at - - @property - def updated_at(self): - """Get the updated_at of this Authorization. - - :return: The updated_at of this Authorization. - :rtype: datetime - """ # noqa: E501 - return self._updated_at - - @updated_at.setter - def updated_at(self, updated_at): - """Set the updated_at of this Authorization. - - :param updated_at: The updated_at of this Authorization. - :type: datetime - """ # noqa: E501 - self._updated_at = updated_at - - @property - def org_id(self): - """Get the org_id of this Authorization. - - The organization ID. Specifies the [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization) that the authorization is scoped to. - - :return: The org_id of this Authorization. - :rtype: str - """ # noqa: E501 - return self._org_id - - @org_id.setter - def org_id(self, org_id): - """Set the org_id of this Authorization. - - The organization ID. Specifies the [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization) that the authorization is scoped to. - - :param org_id: The org_id of this Authorization. - :type: str - """ # noqa: E501 - self._org_id = org_id - - @property - def permissions(self): - """Get the permissions of this Authorization. - - The list of permissions. An authorization must have at least one permission. - - :return: The permissions of this Authorization. - :rtype: list[Permission] - """ # noqa: E501 - return self._permissions - - @permissions.setter - def permissions(self, permissions): - """Set the permissions of this Authorization. - - The list of permissions. An authorization must have at least one permission. - - :param permissions: The permissions of this Authorization. - :type: list[Permission] - """ # noqa: E501 - self._permissions = permissions - - @property - def id(self): - """Get the id of this Authorization. - - The authorization ID. - - :return: The id of this Authorization. - :rtype: str - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this Authorization. - - The authorization ID. - - :param id: The id of this Authorization. - :type: str - """ # noqa: E501 - self._id = id - - @property - def token(self): - """Get the token of this Authorization. - - The API token. The token value is unique to the authorization. [API tokens](https://docs.influxdata.com/influxdb/latest/reference/glossary/#token) are used to authenticate and authorize InfluxDB API requests and `influx` CLI commands--after receiving the request, InfluxDB checks that the token is valid and that the `permissions` allow the requested action(s). - - :return: The token of this Authorization. - :rtype: str - """ # noqa: E501 - return self._token - - @token.setter - def token(self, token): - """Set the token of this Authorization. - - The API token. The token value is unique to the authorization. [API tokens](https://docs.influxdata.com/influxdb/latest/reference/glossary/#token) are used to authenticate and authorize InfluxDB API requests and `influx` CLI commands--after receiving the request, InfluxDB checks that the token is valid and that the `permissions` allow the requested action(s). - - :param token: The token of this Authorization. - :type: str - """ # noqa: E501 - self._token = token - - @property - def user_id(self): - """Get the user_id of this Authorization. - - The user ID. Specifies the [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user) that owns the authorization. If _scoped_, the user that the authorization is scoped to; otherwise, the creator of the authorization. - - :return: The user_id of this Authorization. - :rtype: str - """ # noqa: E501 - return self._user_id - - @user_id.setter - def user_id(self, user_id): - """Set the user_id of this Authorization. - - The user ID. Specifies the [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user) that owns the authorization. If _scoped_, the user that the authorization is scoped to; otherwise, the creator of the authorization. - - :param user_id: The user_id of this Authorization. - :type: str - """ # noqa: E501 - self._user_id = user_id - - @property - def user(self): - """Get the user of this Authorization. - - The user name. Specifies the [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user) that owns the authorization. If the authorization is _scoped_ to a user, the user; otherwise, the creator of the authorization. - - :return: The user of this Authorization. - :rtype: str - """ # noqa: E501 - return self._user - - @user.setter - def user(self, user): - """Set the user of this Authorization. - - The user name. Specifies the [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user) that owns the authorization. If the authorization is _scoped_ to a user, the user; otherwise, the creator of the authorization. - - :param user: The user of this Authorization. - :type: str - """ # noqa: E501 - self._user = user - - @property - def org(self): - """Get the org of this Authorization. - - The organization name. Specifies the [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization) that the token is scoped to. - - :return: The org of this Authorization. - :rtype: str - """ # noqa: E501 - return self._org - - @org.setter - def org(self, org): - """Set the org of this Authorization. - - The organization name. Specifies the [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization) that the token is scoped to. - - :param org: The org of this Authorization. - :type: str - """ # noqa: E501 - self._org = org - - @property - def links(self): - """Get the links of this Authorization. - - :return: The links of this Authorization. - :rtype: object - """ # noqa: E501 - return self._links - - @links.setter - def links(self, links): - """Set the links of this Authorization. - - :param links: The links of this Authorization. - :type: object - """ # noqa: E501 - self._links = links - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Authorization): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/authorization_post_request.py b/frogpilot/third_party/influxdb_client/domain/authorization_post_request.py deleted file mode 100644 index 94bcd96f..00000000 --- a/frogpilot/third_party/influxdb_client/domain/authorization_post_request.py +++ /dev/null @@ -1,173 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.authorization_update_request import AuthorizationUpdateRequest - - -class AuthorizationPostRequest(AuthorizationUpdateRequest): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'org_id': 'str', - 'user_id': 'str', - 'permissions': 'list[Permission]', - 'status': 'str', - 'description': 'str' - } - - attribute_map = { - 'org_id': 'orgID', - 'user_id': 'userID', - 'permissions': 'permissions', - 'status': 'status', - 'description': 'description' - } - - def __init__(self, org_id=None, user_id=None, permissions=None, status='active', description=None): # noqa: E501,D401,D403 - """AuthorizationPostRequest - a model defined in OpenAPI.""" # noqa: E501 - AuthorizationUpdateRequest.__init__(self, status=status, description=description) # noqa: E501 - - self._org_id = None - self._user_id = None - self._permissions = None - self.discriminator = None - - if org_id is not None: - self.org_id = org_id - if user_id is not None: - self.user_id = user_id - if permissions is not None: - self.permissions = permissions - - @property - def org_id(self): - """Get the org_id of this AuthorizationPostRequest. - - An organization ID. Specifies the organization that owns the authorization. - - :return: The org_id of this AuthorizationPostRequest. - :rtype: str - """ # noqa: E501 - return self._org_id - - @org_id.setter - def org_id(self, org_id): - """Set the org_id of this AuthorizationPostRequest. - - An organization ID. Specifies the organization that owns the authorization. - - :param org_id: The org_id of this AuthorizationPostRequest. - :type: str - """ # noqa: E501 - self._org_id = org_id - - @property - def user_id(self): - """Get the user_id of this AuthorizationPostRequest. - - A user ID. Specifies the user that the authorization is scoped to. When a user authenticates with username and password, InfluxDB generates a _user session_ with all the permissions specified by all the user's authorizations. - - :return: The user_id of this AuthorizationPostRequest. - :rtype: str - """ # noqa: E501 - return self._user_id - - @user_id.setter - def user_id(self, user_id): - """Set the user_id of this AuthorizationPostRequest. - - A user ID. Specifies the user that the authorization is scoped to. When a user authenticates with username and password, InfluxDB generates a _user session_ with all the permissions specified by all the user's authorizations. - - :param user_id: The user_id of this AuthorizationPostRequest. - :type: str - """ # noqa: E501 - self._user_id = user_id - - @property - def permissions(self): - """Get the permissions of this AuthorizationPostRequest. - - A list of permissions for an authorization. In the list, provide at least one `permission` object. In a `permission`, the `resource.type` property grants access to all resources of the specified type. To grant access to only a specific resource, specify the `resource.id` property. - - :return: The permissions of this AuthorizationPostRequest. - :rtype: list[Permission] - """ # noqa: E501 - return self._permissions - - @permissions.setter - def permissions(self, permissions): - """Set the permissions of this AuthorizationPostRequest. - - A list of permissions for an authorization. In the list, provide at least one `permission` object. In a `permission`, the `resource.type` property grants access to all resources of the specified type. To grant access to only a specific resource, specify the `resource.id` property. - - :param permissions: The permissions of this AuthorizationPostRequest. - :type: list[Permission] - """ # noqa: E501 - self._permissions = permissions - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, AuthorizationPostRequest): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/authorization_update_request.py b/frogpilot/third_party/influxdb_client/domain/authorization_update_request.py deleted file mode 100644 index 097d9654..00000000 --- a/frogpilot/third_party/influxdb_client/domain/authorization_update_request.py +++ /dev/null @@ -1,138 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class AuthorizationUpdateRequest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'status': 'str', - 'description': 'str' - } - - attribute_map = { - 'status': 'status', - 'description': 'description' - } - - def __init__(self, status='active', description=None): # noqa: E501,D401,D403 - """AuthorizationUpdateRequest - a model defined in OpenAPI.""" # noqa: E501 - self._status = None - self._description = None - self.discriminator = None - - if status is not None: - self.status = status - if description is not None: - self.description = description - - @property - def status(self): - """Get the status of this AuthorizationUpdateRequest. - - Status of the token. If `inactive`, InfluxDB rejects requests that use the token. - - :return: The status of this AuthorizationUpdateRequest. - :rtype: str - """ # noqa: E501 - return self._status - - @status.setter - def status(self, status): - """Set the status of this AuthorizationUpdateRequest. - - Status of the token. If `inactive`, InfluxDB rejects requests that use the token. - - :param status: The status of this AuthorizationUpdateRequest. - :type: str - """ # noqa: E501 - self._status = status - - @property - def description(self): - """Get the description of this AuthorizationUpdateRequest. - - A description of the token. - - :return: The description of this AuthorizationUpdateRequest. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this AuthorizationUpdateRequest. - - A description of the token. - - :param description: The description of this AuthorizationUpdateRequest. - :type: str - """ # noqa: E501 - self._description = description - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, AuthorizationUpdateRequest): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/authorizations.py b/frogpilot/third_party/influxdb_client/domain/authorizations.py deleted file mode 100644 index ad3a4d09..00000000 --- a/frogpilot/third_party/influxdb_client/domain/authorizations.py +++ /dev/null @@ -1,130 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class Authorizations(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'links': 'Links', - 'authorizations': 'list[Authorization]' - } - - attribute_map = { - 'links': 'links', - 'authorizations': 'authorizations' - } - - def __init__(self, links=None, authorizations=None): # noqa: E501,D401,D403 - """Authorizations - a model defined in OpenAPI.""" # noqa: E501 - self._links = None - self._authorizations = None - self.discriminator = None - - if links is not None: - self.links = links - if authorizations is not None: - self.authorizations = authorizations - - @property - def links(self): - """Get the links of this Authorizations. - - :return: The links of this Authorizations. - :rtype: Links - """ # noqa: E501 - return self._links - - @links.setter - def links(self, links): - """Set the links of this Authorizations. - - :param links: The links of this Authorizations. - :type: Links - """ # noqa: E501 - self._links = links - - @property - def authorizations(self): - """Get the authorizations of this Authorizations. - - :return: The authorizations of this Authorizations. - :rtype: list[Authorization] - """ # noqa: E501 - return self._authorizations - - @authorizations.setter - def authorizations(self, authorizations): - """Set the authorizations of this Authorizations. - - :param authorizations: The authorizations of this Authorizations. - :type: list[Authorization] - """ # noqa: E501 - self._authorizations = authorizations - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Authorizations): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/axes.py b/frogpilot/third_party/influxdb_client/domain/axes.py deleted file mode 100644 index 738e3b3b..00000000 --- a/frogpilot/third_party/influxdb_client/domain/axes.py +++ /dev/null @@ -1,132 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class Axes(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'x': 'Axis', - 'y': 'Axis' - } - - attribute_map = { - 'x': 'x', - 'y': 'y' - } - - def __init__(self, x=None, y=None): # noqa: E501,D401,D403 - """Axes - a model defined in OpenAPI.""" # noqa: E501 - self._x = None - self._y = None - self.discriminator = None - - self.x = x - self.y = y - - @property - def x(self): - """Get the x of this Axes. - - :return: The x of this Axes. - :rtype: Axis - """ # noqa: E501 - return self._x - - @x.setter - def x(self, x): - """Set the x of this Axes. - - :param x: The x of this Axes. - :type: Axis - """ # noqa: E501 - if x is None: - raise ValueError("Invalid value for `x`, must not be `None`") # noqa: E501 - self._x = x - - @property - def y(self): - """Get the y of this Axes. - - :return: The y of this Axes. - :rtype: Axis - """ # noqa: E501 - return self._y - - @y.setter - def y(self, y): - """Set the y of this Axes. - - :param y: The y of this Axes. - :type: Axis - """ # noqa: E501 - if y is None: - raise ValueError("Invalid value for `y`, must not be `None`") # noqa: E501 - self._y = y - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Axes): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/axis.py b/frogpilot/third_party/influxdb_client/domain/axis.py deleted file mode 100644 index 44420753..00000000 --- a/frogpilot/third_party/influxdb_client/domain/axis.py +++ /dev/null @@ -1,242 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class Axis(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'bounds': 'list[str]', - 'label': 'str', - 'prefix': 'str', - 'suffix': 'str', - 'base': 'str', - 'scale': 'AxisScale' - } - - attribute_map = { - 'bounds': 'bounds', - 'label': 'label', - 'prefix': 'prefix', - 'suffix': 'suffix', - 'base': 'base', - 'scale': 'scale' - } - - def __init__(self, bounds=None, label=None, prefix=None, suffix=None, base=None, scale=None): # noqa: E501,D401,D403 - """Axis - a model defined in OpenAPI.""" # noqa: E501 - self._bounds = None - self._label = None - self._prefix = None - self._suffix = None - self._base = None - self._scale = None - self.discriminator = None - - if bounds is not None: - self.bounds = bounds - if label is not None: - self.label = label - if prefix is not None: - self.prefix = prefix - if suffix is not None: - self.suffix = suffix - if base is not None: - self.base = base - if scale is not None: - self.scale = scale - - @property - def bounds(self): - """Get the bounds of this Axis. - - The extents of the axis in the form [lower, upper]. Clients determine whether bounds are inclusive or exclusive of their limits. - - :return: The bounds of this Axis. - :rtype: list[str] - """ # noqa: E501 - return self._bounds - - @bounds.setter - def bounds(self, bounds): - """Set the bounds of this Axis. - - The extents of the axis in the form [lower, upper]. Clients determine whether bounds are inclusive or exclusive of their limits. - - :param bounds: The bounds of this Axis. - :type: list[str] - """ # noqa: E501 - self._bounds = bounds - - @property - def label(self): - """Get the label of this Axis. - - Description of the axis. - - :return: The label of this Axis. - :rtype: str - """ # noqa: E501 - return self._label - - @label.setter - def label(self, label): - """Set the label of this Axis. - - Description of the axis. - - :param label: The label of this Axis. - :type: str - """ # noqa: E501 - self._label = label - - @property - def prefix(self): - """Get the prefix of this Axis. - - Label prefix for formatting axis values. - - :return: The prefix of this Axis. - :rtype: str - """ # noqa: E501 - return self._prefix - - @prefix.setter - def prefix(self, prefix): - """Set the prefix of this Axis. - - Label prefix for formatting axis values. - - :param prefix: The prefix of this Axis. - :type: str - """ # noqa: E501 - self._prefix = prefix - - @property - def suffix(self): - """Get the suffix of this Axis. - - Label suffix for formatting axis values. - - :return: The suffix of this Axis. - :rtype: str - """ # noqa: E501 - return self._suffix - - @suffix.setter - def suffix(self, suffix): - """Set the suffix of this Axis. - - Label suffix for formatting axis values. - - :param suffix: The suffix of this Axis. - :type: str - """ # noqa: E501 - self._suffix = suffix - - @property - def base(self): - """Get the base of this Axis. - - Radix for formatting axis values. - - :return: The base of this Axis. - :rtype: str - """ # noqa: E501 - return self._base - - @base.setter - def base(self, base): - """Set the base of this Axis. - - Radix for formatting axis values. - - :param base: The base of this Axis. - :type: str - """ # noqa: E501 - self._base = base - - @property - def scale(self): - """Get the scale of this Axis. - - :return: The scale of this Axis. - :rtype: AxisScale - """ # noqa: E501 - return self._scale - - @scale.setter - def scale(self, scale): - """Set the scale of this Axis. - - :param scale: The scale of this Axis. - :type: AxisScale - """ # noqa: E501 - self._scale = scale - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Axis): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/axis_scale.py b/frogpilot/third_party/influxdb_client/domain/axis_scale.py deleted file mode 100644 index a678feff..00000000 --- a/frogpilot/third_party/influxdb_client/domain/axis_scale.py +++ /dev/null @@ -1,88 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class AxisScale(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - allowed enum values - """ - LOG = "log" - LINEAR = "linear" - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501,D401,D403 - """AxisScale - a model defined in OpenAPI.""" # noqa: E501 self.discriminator = None - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, AxisScale): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/bad_statement.py b/frogpilot/third_party/influxdb_client/domain/bad_statement.py deleted file mode 100644 index d1f455e6..00000000 --- a/frogpilot/third_party/influxdb_client/domain/bad_statement.py +++ /dev/null @@ -1,142 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.statement import Statement - - -class BadStatement(Statement): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'text': 'str' - } - - attribute_map = { - 'type': 'type', - 'text': 'text' - } - - def __init__(self, type=None, text=None): # noqa: E501,D401,D403 - """BadStatement - a model defined in OpenAPI.""" # noqa: E501 - Statement.__init__(self) # noqa: E501 - - self._type = None - self._text = None - self.discriminator = None - - if type is not None: - self.type = type - if text is not None: - self.text = text - - @property - def type(self): - """Get the type of this BadStatement. - - Type of AST node - - :return: The type of this BadStatement. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this BadStatement. - - Type of AST node - - :param type: The type of this BadStatement. - :type: str - """ # noqa: E501 - self._type = type - - @property - def text(self): - """Get the text of this BadStatement. - - Raw source text - - :return: The text of this BadStatement. - :rtype: str - """ # noqa: E501 - return self._text - - @text.setter - def text(self, text): - """Set the text of this BadStatement. - - Raw source text - - :param text: The text of this BadStatement. - :type: str - """ # noqa: E501 - self._text = text - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, BadStatement): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/band_view_properties.py b/frogpilot/third_party/influxdb_client/domain/band_view_properties.py deleted file mode 100644 index 1b03b7b4..00000000 --- a/frogpilot/third_party/influxdb_client/domain/band_view_properties.py +++ /dev/null @@ -1,771 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.view_properties import ViewProperties - - -class BandViewProperties(ViewProperties): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'adaptive_zoom_hide': 'bool', - 'time_format': 'str', - 'type': 'str', - 'queries': 'list[DashboardQuery]', - 'colors': 'list[DashboardColor]', - 'shape': 'str', - 'note': 'str', - 'show_note_when_empty': 'bool', - 'axes': 'Axes', - 'static_legend': 'StaticLegend', - 'x_column': 'str', - 'generate_x_axis_ticks': 'list[str]', - 'x_total_ticks': 'int', - 'x_tick_start': 'float', - 'x_tick_step': 'float', - 'y_column': 'str', - 'generate_y_axis_ticks': 'list[str]', - 'y_total_ticks': 'int', - 'y_tick_start': 'float', - 'y_tick_step': 'float', - 'upper_column': 'str', - 'main_column': 'str', - 'lower_column': 'str', - 'hover_dimension': 'str', - 'geom': 'XYGeom', - 'legend_colorize_rows': 'bool', - 'legend_hide': 'bool', - 'legend_opacity': 'float', - 'legend_orientation_threshold': 'int' - } - - attribute_map = { - 'adaptive_zoom_hide': 'adaptiveZoomHide', - 'time_format': 'timeFormat', - 'type': 'type', - 'queries': 'queries', - 'colors': 'colors', - 'shape': 'shape', - 'note': 'note', - 'show_note_when_empty': 'showNoteWhenEmpty', - 'axes': 'axes', - 'static_legend': 'staticLegend', - 'x_column': 'xColumn', - 'generate_x_axis_ticks': 'generateXAxisTicks', - 'x_total_ticks': 'xTotalTicks', - 'x_tick_start': 'xTickStart', - 'x_tick_step': 'xTickStep', - 'y_column': 'yColumn', - 'generate_y_axis_ticks': 'generateYAxisTicks', - 'y_total_ticks': 'yTotalTicks', - 'y_tick_start': 'yTickStart', - 'y_tick_step': 'yTickStep', - 'upper_column': 'upperColumn', - 'main_column': 'mainColumn', - 'lower_column': 'lowerColumn', - 'hover_dimension': 'hoverDimension', - 'geom': 'geom', - 'legend_colorize_rows': 'legendColorizeRows', - 'legend_hide': 'legendHide', - 'legend_opacity': 'legendOpacity', - 'legend_orientation_threshold': 'legendOrientationThreshold' - } - - def __init__(self, adaptive_zoom_hide=None, time_format=None, type=None, queries=None, colors=None, shape=None, note=None, show_note_when_empty=None, axes=None, static_legend=None, x_column=None, generate_x_axis_ticks=None, x_total_ticks=None, x_tick_start=None, x_tick_step=None, y_column=None, generate_y_axis_ticks=None, y_total_ticks=None, y_tick_start=None, y_tick_step=None, upper_column=None, main_column=None, lower_column=None, hover_dimension=None, geom=None, legend_colorize_rows=None, legend_hide=None, legend_opacity=None, legend_orientation_threshold=None): # noqa: E501,D401,D403 - """BandViewProperties - a model defined in OpenAPI.""" # noqa: E501 - ViewProperties.__init__(self) # noqa: E501 - - self._adaptive_zoom_hide = None - self._time_format = None - self._type = None - self._queries = None - self._colors = None - self._shape = None - self._note = None - self._show_note_when_empty = None - self._axes = None - self._static_legend = None - self._x_column = None - self._generate_x_axis_ticks = None - self._x_total_ticks = None - self._x_tick_start = None - self._x_tick_step = None - self._y_column = None - self._generate_y_axis_ticks = None - self._y_total_ticks = None - self._y_tick_start = None - self._y_tick_step = None - self._upper_column = None - self._main_column = None - self._lower_column = None - self._hover_dimension = None - self._geom = None - self._legend_colorize_rows = None - self._legend_hide = None - self._legend_opacity = None - self._legend_orientation_threshold = None - self.discriminator = None - - if adaptive_zoom_hide is not None: - self.adaptive_zoom_hide = adaptive_zoom_hide - if time_format is not None: - self.time_format = time_format - self.type = type - self.queries = queries - self.colors = colors - self.shape = shape - self.note = note - self.show_note_when_empty = show_note_when_empty - self.axes = axes - if static_legend is not None: - self.static_legend = static_legend - if x_column is not None: - self.x_column = x_column - if generate_x_axis_ticks is not None: - self.generate_x_axis_ticks = generate_x_axis_ticks - if x_total_ticks is not None: - self.x_total_ticks = x_total_ticks - if x_tick_start is not None: - self.x_tick_start = x_tick_start - if x_tick_step is not None: - self.x_tick_step = x_tick_step - if y_column is not None: - self.y_column = y_column - if generate_y_axis_ticks is not None: - self.generate_y_axis_ticks = generate_y_axis_ticks - if y_total_ticks is not None: - self.y_total_ticks = y_total_ticks - if y_tick_start is not None: - self.y_tick_start = y_tick_start - if y_tick_step is not None: - self.y_tick_step = y_tick_step - if upper_column is not None: - self.upper_column = upper_column - if main_column is not None: - self.main_column = main_column - if lower_column is not None: - self.lower_column = lower_column - if hover_dimension is not None: - self.hover_dimension = hover_dimension - self.geom = geom - if legend_colorize_rows is not None: - self.legend_colorize_rows = legend_colorize_rows - if legend_hide is not None: - self.legend_hide = legend_hide - if legend_opacity is not None: - self.legend_opacity = legend_opacity - if legend_orientation_threshold is not None: - self.legend_orientation_threshold = legend_orientation_threshold - - @property - def adaptive_zoom_hide(self): - """Get the adaptive_zoom_hide of this BandViewProperties. - - :return: The adaptive_zoom_hide of this BandViewProperties. - :rtype: bool - """ # noqa: E501 - return self._adaptive_zoom_hide - - @adaptive_zoom_hide.setter - def adaptive_zoom_hide(self, adaptive_zoom_hide): - """Set the adaptive_zoom_hide of this BandViewProperties. - - :param adaptive_zoom_hide: The adaptive_zoom_hide of this BandViewProperties. - :type: bool - """ # noqa: E501 - self._adaptive_zoom_hide = adaptive_zoom_hide - - @property - def time_format(self): - """Get the time_format of this BandViewProperties. - - :return: The time_format of this BandViewProperties. - :rtype: str - """ # noqa: E501 - return self._time_format - - @time_format.setter - def time_format(self, time_format): - """Set the time_format of this BandViewProperties. - - :param time_format: The time_format of this BandViewProperties. - :type: str - """ # noqa: E501 - self._time_format = time_format - - @property - def type(self): - """Get the type of this BandViewProperties. - - :return: The type of this BandViewProperties. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this BandViewProperties. - - :param type: The type of this BandViewProperties. - :type: str - """ # noqa: E501 - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - self._type = type - - @property - def queries(self): - """Get the queries of this BandViewProperties. - - :return: The queries of this BandViewProperties. - :rtype: list[DashboardQuery] - """ # noqa: E501 - return self._queries - - @queries.setter - def queries(self, queries): - """Set the queries of this BandViewProperties. - - :param queries: The queries of this BandViewProperties. - :type: list[DashboardQuery] - """ # noqa: E501 - if queries is None: - raise ValueError("Invalid value for `queries`, must not be `None`") # noqa: E501 - self._queries = queries - - @property - def colors(self): - """Get the colors of this BandViewProperties. - - Colors define color encoding of data into a visualization - - :return: The colors of this BandViewProperties. - :rtype: list[DashboardColor] - """ # noqa: E501 - return self._colors - - @colors.setter - def colors(self, colors): - """Set the colors of this BandViewProperties. - - Colors define color encoding of data into a visualization - - :param colors: The colors of this BandViewProperties. - :type: list[DashboardColor] - """ # noqa: E501 - if colors is None: - raise ValueError("Invalid value for `colors`, must not be `None`") # noqa: E501 - self._colors = colors - - @property - def shape(self): - """Get the shape of this BandViewProperties. - - :return: The shape of this BandViewProperties. - :rtype: str - """ # noqa: E501 - return self._shape - - @shape.setter - def shape(self, shape): - """Set the shape of this BandViewProperties. - - :param shape: The shape of this BandViewProperties. - :type: str - """ # noqa: E501 - if shape is None: - raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 - self._shape = shape - - @property - def note(self): - """Get the note of this BandViewProperties. - - :return: The note of this BandViewProperties. - :rtype: str - """ # noqa: E501 - return self._note - - @note.setter - def note(self, note): - """Set the note of this BandViewProperties. - - :param note: The note of this BandViewProperties. - :type: str - """ # noqa: E501 - if note is None: - raise ValueError("Invalid value for `note`, must not be `None`") # noqa: E501 - self._note = note - - @property - def show_note_when_empty(self): - """Get the show_note_when_empty of this BandViewProperties. - - If true, will display note when empty - - :return: The show_note_when_empty of this BandViewProperties. - :rtype: bool - """ # noqa: E501 - return self._show_note_when_empty - - @show_note_when_empty.setter - def show_note_when_empty(self, show_note_when_empty): - """Set the show_note_when_empty of this BandViewProperties. - - If true, will display note when empty - - :param show_note_when_empty: The show_note_when_empty of this BandViewProperties. - :type: bool - """ # noqa: E501 - if show_note_when_empty is None: - raise ValueError("Invalid value for `show_note_when_empty`, must not be `None`") # noqa: E501 - self._show_note_when_empty = show_note_when_empty - - @property - def axes(self): - """Get the axes of this BandViewProperties. - - :return: The axes of this BandViewProperties. - :rtype: Axes - """ # noqa: E501 - return self._axes - - @axes.setter - def axes(self, axes): - """Set the axes of this BandViewProperties. - - :param axes: The axes of this BandViewProperties. - :type: Axes - """ # noqa: E501 - if axes is None: - raise ValueError("Invalid value for `axes`, must not be `None`") # noqa: E501 - self._axes = axes - - @property - def static_legend(self): - """Get the static_legend of this BandViewProperties. - - :return: The static_legend of this BandViewProperties. - :rtype: StaticLegend - """ # noqa: E501 - return self._static_legend - - @static_legend.setter - def static_legend(self, static_legend): - """Set the static_legend of this BandViewProperties. - - :param static_legend: The static_legend of this BandViewProperties. - :type: StaticLegend - """ # noqa: E501 - self._static_legend = static_legend - - @property - def x_column(self): - """Get the x_column of this BandViewProperties. - - :return: The x_column of this BandViewProperties. - :rtype: str - """ # noqa: E501 - return self._x_column - - @x_column.setter - def x_column(self, x_column): - """Set the x_column of this BandViewProperties. - - :param x_column: The x_column of this BandViewProperties. - :type: str - """ # noqa: E501 - self._x_column = x_column - - @property - def generate_x_axis_ticks(self): - """Get the generate_x_axis_ticks of this BandViewProperties. - - :return: The generate_x_axis_ticks of this BandViewProperties. - :rtype: list[str] - """ # noqa: E501 - return self._generate_x_axis_ticks - - @generate_x_axis_ticks.setter - def generate_x_axis_ticks(self, generate_x_axis_ticks): - """Set the generate_x_axis_ticks of this BandViewProperties. - - :param generate_x_axis_ticks: The generate_x_axis_ticks of this BandViewProperties. - :type: list[str] - """ # noqa: E501 - self._generate_x_axis_ticks = generate_x_axis_ticks - - @property - def x_total_ticks(self): - """Get the x_total_ticks of this BandViewProperties. - - :return: The x_total_ticks of this BandViewProperties. - :rtype: int - """ # noqa: E501 - return self._x_total_ticks - - @x_total_ticks.setter - def x_total_ticks(self, x_total_ticks): - """Set the x_total_ticks of this BandViewProperties. - - :param x_total_ticks: The x_total_ticks of this BandViewProperties. - :type: int - """ # noqa: E501 - self._x_total_ticks = x_total_ticks - - @property - def x_tick_start(self): - """Get the x_tick_start of this BandViewProperties. - - :return: The x_tick_start of this BandViewProperties. - :rtype: float - """ # noqa: E501 - return self._x_tick_start - - @x_tick_start.setter - def x_tick_start(self, x_tick_start): - """Set the x_tick_start of this BandViewProperties. - - :param x_tick_start: The x_tick_start of this BandViewProperties. - :type: float - """ # noqa: E501 - self._x_tick_start = x_tick_start - - @property - def x_tick_step(self): - """Get the x_tick_step of this BandViewProperties. - - :return: The x_tick_step of this BandViewProperties. - :rtype: float - """ # noqa: E501 - return self._x_tick_step - - @x_tick_step.setter - def x_tick_step(self, x_tick_step): - """Set the x_tick_step of this BandViewProperties. - - :param x_tick_step: The x_tick_step of this BandViewProperties. - :type: float - """ # noqa: E501 - self._x_tick_step = x_tick_step - - @property - def y_column(self): - """Get the y_column of this BandViewProperties. - - :return: The y_column of this BandViewProperties. - :rtype: str - """ # noqa: E501 - return self._y_column - - @y_column.setter - def y_column(self, y_column): - """Set the y_column of this BandViewProperties. - - :param y_column: The y_column of this BandViewProperties. - :type: str - """ # noqa: E501 - self._y_column = y_column - - @property - def generate_y_axis_ticks(self): - """Get the generate_y_axis_ticks of this BandViewProperties. - - :return: The generate_y_axis_ticks of this BandViewProperties. - :rtype: list[str] - """ # noqa: E501 - return self._generate_y_axis_ticks - - @generate_y_axis_ticks.setter - def generate_y_axis_ticks(self, generate_y_axis_ticks): - """Set the generate_y_axis_ticks of this BandViewProperties. - - :param generate_y_axis_ticks: The generate_y_axis_ticks of this BandViewProperties. - :type: list[str] - """ # noqa: E501 - self._generate_y_axis_ticks = generate_y_axis_ticks - - @property - def y_total_ticks(self): - """Get the y_total_ticks of this BandViewProperties. - - :return: The y_total_ticks of this BandViewProperties. - :rtype: int - """ # noqa: E501 - return self._y_total_ticks - - @y_total_ticks.setter - def y_total_ticks(self, y_total_ticks): - """Set the y_total_ticks of this BandViewProperties. - - :param y_total_ticks: The y_total_ticks of this BandViewProperties. - :type: int - """ # noqa: E501 - self._y_total_ticks = y_total_ticks - - @property - def y_tick_start(self): - """Get the y_tick_start of this BandViewProperties. - - :return: The y_tick_start of this BandViewProperties. - :rtype: float - """ # noqa: E501 - return self._y_tick_start - - @y_tick_start.setter - def y_tick_start(self, y_tick_start): - """Set the y_tick_start of this BandViewProperties. - - :param y_tick_start: The y_tick_start of this BandViewProperties. - :type: float - """ # noqa: E501 - self._y_tick_start = y_tick_start - - @property - def y_tick_step(self): - """Get the y_tick_step of this BandViewProperties. - - :return: The y_tick_step of this BandViewProperties. - :rtype: float - """ # noqa: E501 - return self._y_tick_step - - @y_tick_step.setter - def y_tick_step(self, y_tick_step): - """Set the y_tick_step of this BandViewProperties. - - :param y_tick_step: The y_tick_step of this BandViewProperties. - :type: float - """ # noqa: E501 - self._y_tick_step = y_tick_step - - @property - def upper_column(self): - """Get the upper_column of this BandViewProperties. - - :return: The upper_column of this BandViewProperties. - :rtype: str - """ # noqa: E501 - return self._upper_column - - @upper_column.setter - def upper_column(self, upper_column): - """Set the upper_column of this BandViewProperties. - - :param upper_column: The upper_column of this BandViewProperties. - :type: str - """ # noqa: E501 - self._upper_column = upper_column - - @property - def main_column(self): - """Get the main_column of this BandViewProperties. - - :return: The main_column of this BandViewProperties. - :rtype: str - """ # noqa: E501 - return self._main_column - - @main_column.setter - def main_column(self, main_column): - """Set the main_column of this BandViewProperties. - - :param main_column: The main_column of this BandViewProperties. - :type: str - """ # noqa: E501 - self._main_column = main_column - - @property - def lower_column(self): - """Get the lower_column of this BandViewProperties. - - :return: The lower_column of this BandViewProperties. - :rtype: str - """ # noqa: E501 - return self._lower_column - - @lower_column.setter - def lower_column(self, lower_column): - """Set the lower_column of this BandViewProperties. - - :param lower_column: The lower_column of this BandViewProperties. - :type: str - """ # noqa: E501 - self._lower_column = lower_column - - @property - def hover_dimension(self): - """Get the hover_dimension of this BandViewProperties. - - :return: The hover_dimension of this BandViewProperties. - :rtype: str - """ # noqa: E501 - return self._hover_dimension - - @hover_dimension.setter - def hover_dimension(self, hover_dimension): - """Set the hover_dimension of this BandViewProperties. - - :param hover_dimension: The hover_dimension of this BandViewProperties. - :type: str - """ # noqa: E501 - self._hover_dimension = hover_dimension - - @property - def geom(self): - """Get the geom of this BandViewProperties. - - :return: The geom of this BandViewProperties. - :rtype: XYGeom - """ # noqa: E501 - return self._geom - - @geom.setter - def geom(self, geom): - """Set the geom of this BandViewProperties. - - :param geom: The geom of this BandViewProperties. - :type: XYGeom - """ # noqa: E501 - if geom is None: - raise ValueError("Invalid value for `geom`, must not be `None`") # noqa: E501 - self._geom = geom - - @property - def legend_colorize_rows(self): - """Get the legend_colorize_rows of this BandViewProperties. - - :return: The legend_colorize_rows of this BandViewProperties. - :rtype: bool - """ # noqa: E501 - return self._legend_colorize_rows - - @legend_colorize_rows.setter - def legend_colorize_rows(self, legend_colorize_rows): - """Set the legend_colorize_rows of this BandViewProperties. - - :param legend_colorize_rows: The legend_colorize_rows of this BandViewProperties. - :type: bool - """ # noqa: E501 - self._legend_colorize_rows = legend_colorize_rows - - @property - def legend_hide(self): - """Get the legend_hide of this BandViewProperties. - - :return: The legend_hide of this BandViewProperties. - :rtype: bool - """ # noqa: E501 - return self._legend_hide - - @legend_hide.setter - def legend_hide(self, legend_hide): - """Set the legend_hide of this BandViewProperties. - - :param legend_hide: The legend_hide of this BandViewProperties. - :type: bool - """ # noqa: E501 - self._legend_hide = legend_hide - - @property - def legend_opacity(self): - """Get the legend_opacity of this BandViewProperties. - - :return: The legend_opacity of this BandViewProperties. - :rtype: float - """ # noqa: E501 - return self._legend_opacity - - @legend_opacity.setter - def legend_opacity(self, legend_opacity): - """Set the legend_opacity of this BandViewProperties. - - :param legend_opacity: The legend_opacity of this BandViewProperties. - :type: float - """ # noqa: E501 - self._legend_opacity = legend_opacity - - @property - def legend_orientation_threshold(self): - """Get the legend_orientation_threshold of this BandViewProperties. - - :return: The legend_orientation_threshold of this BandViewProperties. - :rtype: int - """ # noqa: E501 - return self._legend_orientation_threshold - - @legend_orientation_threshold.setter - def legend_orientation_threshold(self, legend_orientation_threshold): - """Set the legend_orientation_threshold of this BandViewProperties. - - :param legend_orientation_threshold: The legend_orientation_threshold of this BandViewProperties. - :type: int - """ # noqa: E501 - self._legend_orientation_threshold = legend_orientation_threshold - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, BandViewProperties): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/binary_expression.py b/frogpilot/third_party/influxdb_client/domain/binary_expression.py deleted file mode 100644 index 858d4e11..00000000 --- a/frogpilot/third_party/influxdb_client/domain/binary_expression.py +++ /dev/null @@ -1,184 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.expression import Expression - - -class BinaryExpression(Expression): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'operator': 'str', - 'left': 'Expression', - 'right': 'Expression' - } - - attribute_map = { - 'type': 'type', - 'operator': 'operator', - 'left': 'left', - 'right': 'right' - } - - def __init__(self, type=None, operator=None, left=None, right=None): # noqa: E501,D401,D403 - """BinaryExpression - a model defined in OpenAPI.""" # noqa: E501 - Expression.__init__(self) # noqa: E501 - - self._type = None - self._operator = None - self._left = None - self._right = None - self.discriminator = None - - if type is not None: - self.type = type - if operator is not None: - self.operator = operator - if left is not None: - self.left = left - if right is not None: - self.right = right - - @property - def type(self): - """Get the type of this BinaryExpression. - - Type of AST node - - :return: The type of this BinaryExpression. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this BinaryExpression. - - Type of AST node - - :param type: The type of this BinaryExpression. - :type: str - """ # noqa: E501 - self._type = type - - @property - def operator(self): - """Get the operator of this BinaryExpression. - - :return: The operator of this BinaryExpression. - :rtype: str - """ # noqa: E501 - return self._operator - - @operator.setter - def operator(self, operator): - """Set the operator of this BinaryExpression. - - :param operator: The operator of this BinaryExpression. - :type: str - """ # noqa: E501 - self._operator = operator - - @property - def left(self): - """Get the left of this BinaryExpression. - - :return: The left of this BinaryExpression. - :rtype: Expression - """ # noqa: E501 - return self._left - - @left.setter - def left(self, left): - """Set the left of this BinaryExpression. - - :param left: The left of this BinaryExpression. - :type: Expression - """ # noqa: E501 - self._left = left - - @property - def right(self): - """Get the right of this BinaryExpression. - - :return: The right of this BinaryExpression. - :rtype: Expression - """ # noqa: E501 - return self._right - - @right.setter - def right(self, right): - """Set the right of this BinaryExpression. - - :param right: The right of this BinaryExpression. - :type: Expression - """ # noqa: E501 - self._right = right - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, BinaryExpression): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/block.py b/frogpilot/third_party/influxdb_client/domain/block.py deleted file mode 100644 index b2ddc366..00000000 --- a/frogpilot/third_party/influxdb_client/domain/block.py +++ /dev/null @@ -1,142 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.node import Node - - -class Block(Node): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'body': 'list[Statement]' - } - - attribute_map = { - 'type': 'type', - 'body': 'body' - } - - def __init__(self, type=None, body=None): # noqa: E501,D401,D403 - """Block - a model defined in OpenAPI.""" # noqa: E501 - Node.__init__(self) # noqa: E501 - - self._type = None - self._body = None - self.discriminator = None - - if type is not None: - self.type = type - if body is not None: - self.body = body - - @property - def type(self): - """Get the type of this Block. - - Type of AST node - - :return: The type of this Block. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this Block. - - Type of AST node - - :param type: The type of this Block. - :type: str - """ # noqa: E501 - self._type = type - - @property - def body(self): - """Get the body of this Block. - - Block body - - :return: The body of this Block. - :rtype: list[Statement] - """ # noqa: E501 - return self._body - - @body.setter - def body(self, body): - """Set the body of this Block. - - Block body - - :param body: The body of this Block. - :type: list[Statement] - """ # noqa: E501 - self._body = body - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Block): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/boolean_literal.py b/frogpilot/third_party/influxdb_client/domain/boolean_literal.py deleted file mode 100644 index 693d7be1..00000000 --- a/frogpilot/third_party/influxdb_client/domain/boolean_literal.py +++ /dev/null @@ -1,138 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.expression import Expression - - -class BooleanLiteral(Expression): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'value': 'bool' - } - - attribute_map = { - 'type': 'type', - 'value': 'value' - } - - def __init__(self, type=None, value=None): # noqa: E501,D401,D403 - """BooleanLiteral - a model defined in OpenAPI.""" # noqa: E501 - Expression.__init__(self) # noqa: E501 - - self._type = None - self._value = None - self.discriminator = None - - if type is not None: - self.type = type - if value is not None: - self.value = value - - @property - def type(self): - """Get the type of this BooleanLiteral. - - Type of AST node - - :return: The type of this BooleanLiteral. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this BooleanLiteral. - - Type of AST node - - :param type: The type of this BooleanLiteral. - :type: str - """ # noqa: E501 - self._type = type - - @property - def value(self): - """Get the value of this BooleanLiteral. - - :return: The value of this BooleanLiteral. - :rtype: bool - """ # noqa: E501 - return self._value - - @value.setter - def value(self, value): - """Set the value of this BooleanLiteral. - - :param value: The value of this BooleanLiteral. - :type: bool - """ # noqa: E501 - self._value = value - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, BooleanLiteral): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/bucket.py b/frogpilot/third_party/influxdb_client/domain/bucket.py deleted file mode 100644 index fe7d3d6b..00000000 --- a/frogpilot/third_party/influxdb_client/domain/bucket.py +++ /dev/null @@ -1,366 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class Bucket(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'links': 'BucketLinks', - 'id': 'str', - 'type': 'str', - 'name': 'str', - 'description': 'str', - 'org_id': 'str', - 'rp': 'str', - 'schema_type': 'SchemaType', - 'created_at': 'datetime', - 'updated_at': 'datetime', - 'retention_rules': 'list[BucketRetentionRules]', - 'labels': 'list[Label]' - } - - attribute_map = { - 'links': 'links', - 'id': 'id', - 'type': 'type', - 'name': 'name', - 'description': 'description', - 'org_id': 'orgID', - 'rp': 'rp', - 'schema_type': 'schemaType', - 'created_at': 'createdAt', - 'updated_at': 'updatedAt', - 'retention_rules': 'retentionRules', - 'labels': 'labels' - } - - def __init__(self, links=None, id=None, type='user', name=None, description=None, org_id=None, rp=None, schema_type=None, created_at=None, updated_at=None, retention_rules=None, labels=None): # noqa: E501,D401,D403 - """Bucket - a model defined in OpenAPI.""" # noqa: E501 - self._links = None - self._id = None - self._type = None - self._name = None - self._description = None - self._org_id = None - self._rp = None - self._schema_type = None - self._created_at = None - self._updated_at = None - self._retention_rules = None - self._labels = None - self.discriminator = None - - if links is not None: - self.links = links - if id is not None: - self.id = id - if type is not None: - self.type = type - self.name = name - if description is not None: - self.description = description - if org_id is not None: - self.org_id = org_id - if rp is not None: - self.rp = rp - if schema_type is not None: - self.schema_type = schema_type - if created_at is not None: - self.created_at = created_at - if updated_at is not None: - self.updated_at = updated_at - self.retention_rules = retention_rules - if labels is not None: - self.labels = labels - - @property - def links(self): - """Get the links of this Bucket. - - :return: The links of this Bucket. - :rtype: BucketLinks - """ # noqa: E501 - return self._links - - @links.setter - def links(self, links): - """Set the links of this Bucket. - - :param links: The links of this Bucket. - :type: BucketLinks - """ # noqa: E501 - self._links = links - - @property - def id(self): - """Get the id of this Bucket. - - :return: The id of this Bucket. - :rtype: str - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this Bucket. - - :param id: The id of this Bucket. - :type: str - """ # noqa: E501 - self._id = id - - @property - def type(self): - """Get the type of this Bucket. - - :return: The type of this Bucket. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this Bucket. - - :param type: The type of this Bucket. - :type: str - """ # noqa: E501 - self._type = type - - @property - def name(self): - """Get the name of this Bucket. - - :return: The name of this Bucket. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this Bucket. - - :param name: The name of this Bucket. - :type: str - """ # noqa: E501 - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - self._name = name - - @property - def description(self): - """Get the description of this Bucket. - - :return: The description of this Bucket. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this Bucket. - - :param description: The description of this Bucket. - :type: str - """ # noqa: E501 - self._description = description - - @property - def org_id(self): - """Get the org_id of this Bucket. - - :return: The org_id of this Bucket. - :rtype: str - """ # noqa: E501 - return self._org_id - - @org_id.setter - def org_id(self, org_id): - """Set the org_id of this Bucket. - - :param org_id: The org_id of this Bucket. - :type: str - """ # noqa: E501 - self._org_id = org_id - - @property - def rp(self): - """Get the rp of this Bucket. - - :return: The rp of this Bucket. - :rtype: str - """ # noqa: E501 - return self._rp - - @rp.setter - def rp(self, rp): - """Set the rp of this Bucket. - - :param rp: The rp of this Bucket. - :type: str - """ # noqa: E501 - self._rp = rp - - @property - def schema_type(self): - """Get the schema_type of this Bucket. - - :return: The schema_type of this Bucket. - :rtype: SchemaType - """ # noqa: E501 - return self._schema_type - - @schema_type.setter - def schema_type(self, schema_type): - """Set the schema_type of this Bucket. - - :param schema_type: The schema_type of this Bucket. - :type: SchemaType - """ # noqa: E501 - self._schema_type = schema_type - - @property - def created_at(self): - """Get the created_at of this Bucket. - - :return: The created_at of this Bucket. - :rtype: datetime - """ # noqa: E501 - return self._created_at - - @created_at.setter - def created_at(self, created_at): - """Set the created_at of this Bucket. - - :param created_at: The created_at of this Bucket. - :type: datetime - """ # noqa: E501 - self._created_at = created_at - - @property - def updated_at(self): - """Get the updated_at of this Bucket. - - :return: The updated_at of this Bucket. - :rtype: datetime - """ # noqa: E501 - return self._updated_at - - @updated_at.setter - def updated_at(self, updated_at): - """Set the updated_at of this Bucket. - - :param updated_at: The updated_at of this Bucket. - :type: datetime - """ # noqa: E501 - self._updated_at = updated_at - - @property - def retention_rules(self): - """Get the retention_rules of this Bucket. - - Retention rules to expire or retain data. The InfluxDB `/api/v2` API uses `RetentionRules` to configure the [retention period](https://docs.influxdata.com/influxdb/latest/reference/glossary/#retention-period). #### InfluxDB Cloud - `retentionRules` is required. #### InfluxDB OSS - `retentionRules` isn't required. - - :return: The retention_rules of this Bucket. - :rtype: list[BucketRetentionRules] - """ # noqa: E501 - return self._retention_rules - - @retention_rules.setter - def retention_rules(self, retention_rules): - """Set the retention_rules of this Bucket. - - Retention rules to expire or retain data. The InfluxDB `/api/v2` API uses `RetentionRules` to configure the [retention period](https://docs.influxdata.com/influxdb/latest/reference/glossary/#retention-period). #### InfluxDB Cloud - `retentionRules` is required. #### InfluxDB OSS - `retentionRules` isn't required. - - :param retention_rules: The retention_rules of this Bucket. - :type: list[BucketRetentionRules] - """ # noqa: E501 - if retention_rules is None: - raise ValueError("Invalid value for `retention_rules`, must not be `None`") # noqa: E501 - self._retention_rules = retention_rules - - @property - def labels(self): - """Get the labels of this Bucket. - - :return: The labels of this Bucket. - :rtype: list[Label] - """ # noqa: E501 - return self._labels - - @labels.setter - def labels(self, labels): - """Set the labels of this Bucket. - - :param labels: The labels of this Bucket. - :type: list[Label] - """ # noqa: E501 - self._labels = labels - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Bucket): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/bucket_links.py b/frogpilot/third_party/influxdb_client/domain/bucket_links.py deleted file mode 100644 index a4cef1aa..00000000 --- a/frogpilot/third_party/influxdb_client/domain/bucket_links.py +++ /dev/null @@ -1,246 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class BucketLinks(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'labels': 'str', - 'members': 'str', - 'org': 'str', - 'owners': 'str', - '_self': 'str', - 'write': 'str' - } - - attribute_map = { - 'labels': 'labels', - 'members': 'members', - 'org': 'org', - 'owners': 'owners', - '_self': 'self', - 'write': 'write' - } - - def __init__(self, labels=None, members=None, org=None, owners=None, _self=None, write=None): # noqa: E501,D401,D403 - """BucketLinks - a model defined in OpenAPI.""" # noqa: E501 - self._labels = None - self._members = None - self._org = None - self._owners = None - self.__self = None - self._write = None - self.discriminator = None - - if labels is not None: - self.labels = labels - if members is not None: - self.members = members - if org is not None: - self.org = org - if owners is not None: - self.owners = owners - if _self is not None: - self._self = _self - if write is not None: - self.write = write - - @property - def labels(self): - """Get the labels of this BucketLinks. - - URI of resource. - - :return: The labels of this BucketLinks. - :rtype: str - """ # noqa: E501 - return self._labels - - @labels.setter - def labels(self, labels): - """Set the labels of this BucketLinks. - - URI of resource. - - :param labels: The labels of this BucketLinks. - :type: str - """ # noqa: E501 - self._labels = labels - - @property - def members(self): - """Get the members of this BucketLinks. - - URI of resource. - - :return: The members of this BucketLinks. - :rtype: str - """ # noqa: E501 - return self._members - - @members.setter - def members(self, members): - """Set the members of this BucketLinks. - - URI of resource. - - :param members: The members of this BucketLinks. - :type: str - """ # noqa: E501 - self._members = members - - @property - def org(self): - """Get the org of this BucketLinks. - - URI of resource. - - :return: The org of this BucketLinks. - :rtype: str - """ # noqa: E501 - return self._org - - @org.setter - def org(self, org): - """Set the org of this BucketLinks. - - URI of resource. - - :param org: The org of this BucketLinks. - :type: str - """ # noqa: E501 - self._org = org - - @property - def owners(self): - """Get the owners of this BucketLinks. - - URI of resource. - - :return: The owners of this BucketLinks. - :rtype: str - """ # noqa: E501 - return self._owners - - @owners.setter - def owners(self, owners): - """Set the owners of this BucketLinks. - - URI of resource. - - :param owners: The owners of this BucketLinks. - :type: str - """ # noqa: E501 - self._owners = owners - - @property - def _self(self): - """Get the _self of this BucketLinks. - - URI of resource. - - :return: The _self of this BucketLinks. - :rtype: str - """ # noqa: E501 - return self.__self - - @_self.setter - def _self(self, _self): - """Set the _self of this BucketLinks. - - URI of resource. - - :param _self: The _self of this BucketLinks. - :type: str - """ # noqa: E501 - self.__self = _self - - @property - def write(self): - """Get the write of this BucketLinks. - - URI of resource. - - :return: The write of this BucketLinks. - :rtype: str - """ # noqa: E501 - return self._write - - @write.setter - def write(self, write): - """Set the write of this BucketLinks. - - URI of resource. - - :param write: The write of this BucketLinks. - :type: str - """ # noqa: E501 - self._write = write - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, BucketLinks): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/bucket_metadata_manifest.py b/frogpilot/third_party/influxdb_client/domain/bucket_metadata_manifest.py deleted file mode 100644 index c87ec20e..00000000 --- a/frogpilot/third_party/influxdb_client/domain/bucket_metadata_manifest.py +++ /dev/null @@ -1,251 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class BucketMetadataManifest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'organization_id': 'str', - 'organization_name': 'str', - 'bucket_id': 'str', - 'bucket_name': 'str', - 'description': 'str', - 'default_retention_policy': 'str', - 'retention_policies': 'list[RetentionPolicyManifest]' - } - - attribute_map = { - 'organization_id': 'organizationID', - 'organization_name': 'organizationName', - 'bucket_id': 'bucketID', - 'bucket_name': 'bucketName', - 'description': 'description', - 'default_retention_policy': 'defaultRetentionPolicy', - 'retention_policies': 'retentionPolicies' - } - - def __init__(self, organization_id=None, organization_name=None, bucket_id=None, bucket_name=None, description=None, default_retention_policy=None, retention_policies=None): # noqa: E501,D401,D403 - """BucketMetadataManifest - a model defined in OpenAPI.""" # noqa: E501 - self._organization_id = None - self._organization_name = None - self._bucket_id = None - self._bucket_name = None - self._description = None - self._default_retention_policy = None - self._retention_policies = None - self.discriminator = None - - self.organization_id = organization_id - self.organization_name = organization_name - self.bucket_id = bucket_id - self.bucket_name = bucket_name - if description is not None: - self.description = description - self.default_retention_policy = default_retention_policy - self.retention_policies = retention_policies - - @property - def organization_id(self): - """Get the organization_id of this BucketMetadataManifest. - - :return: The organization_id of this BucketMetadataManifest. - :rtype: str - """ # noqa: E501 - return self._organization_id - - @organization_id.setter - def organization_id(self, organization_id): - """Set the organization_id of this BucketMetadataManifest. - - :param organization_id: The organization_id of this BucketMetadataManifest. - :type: str - """ # noqa: E501 - if organization_id is None: - raise ValueError("Invalid value for `organization_id`, must not be `None`") # noqa: E501 - self._organization_id = organization_id - - @property - def organization_name(self): - """Get the organization_name of this BucketMetadataManifest. - - :return: The organization_name of this BucketMetadataManifest. - :rtype: str - """ # noqa: E501 - return self._organization_name - - @organization_name.setter - def organization_name(self, organization_name): - """Set the organization_name of this BucketMetadataManifest. - - :param organization_name: The organization_name of this BucketMetadataManifest. - :type: str - """ # noqa: E501 - if organization_name is None: - raise ValueError("Invalid value for `organization_name`, must not be `None`") # noqa: E501 - self._organization_name = organization_name - - @property - def bucket_id(self): - """Get the bucket_id of this BucketMetadataManifest. - - :return: The bucket_id of this BucketMetadataManifest. - :rtype: str - """ # noqa: E501 - return self._bucket_id - - @bucket_id.setter - def bucket_id(self, bucket_id): - """Set the bucket_id of this BucketMetadataManifest. - - :param bucket_id: The bucket_id of this BucketMetadataManifest. - :type: str - """ # noqa: E501 - if bucket_id is None: - raise ValueError("Invalid value for `bucket_id`, must not be `None`") # noqa: E501 - self._bucket_id = bucket_id - - @property - def bucket_name(self): - """Get the bucket_name of this BucketMetadataManifest. - - :return: The bucket_name of this BucketMetadataManifest. - :rtype: str - """ # noqa: E501 - return self._bucket_name - - @bucket_name.setter - def bucket_name(self, bucket_name): - """Set the bucket_name of this BucketMetadataManifest. - - :param bucket_name: The bucket_name of this BucketMetadataManifest. - :type: str - """ # noqa: E501 - if bucket_name is None: - raise ValueError("Invalid value for `bucket_name`, must not be `None`") # noqa: E501 - self._bucket_name = bucket_name - - @property - def description(self): - """Get the description of this BucketMetadataManifest. - - :return: The description of this BucketMetadataManifest. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this BucketMetadataManifest. - - :param description: The description of this BucketMetadataManifest. - :type: str - """ # noqa: E501 - self._description = description - - @property - def default_retention_policy(self): - """Get the default_retention_policy of this BucketMetadataManifest. - - :return: The default_retention_policy of this BucketMetadataManifest. - :rtype: str - """ # noqa: E501 - return self._default_retention_policy - - @default_retention_policy.setter - def default_retention_policy(self, default_retention_policy): - """Set the default_retention_policy of this BucketMetadataManifest. - - :param default_retention_policy: The default_retention_policy of this BucketMetadataManifest. - :type: str - """ # noqa: E501 - if default_retention_policy is None: - raise ValueError("Invalid value for `default_retention_policy`, must not be `None`") # noqa: E501 - self._default_retention_policy = default_retention_policy - - @property - def retention_policies(self): - """Get the retention_policies of this BucketMetadataManifest. - - :return: The retention_policies of this BucketMetadataManifest. - :rtype: list[RetentionPolicyManifest] - """ # noqa: E501 - return self._retention_policies - - @retention_policies.setter - def retention_policies(self, retention_policies): - """Set the retention_policies of this BucketMetadataManifest. - - :param retention_policies: The retention_policies of this BucketMetadataManifest. - :type: list[RetentionPolicyManifest] - """ # noqa: E501 - if retention_policies is None: - raise ValueError("Invalid value for `retention_policies`, must not be `None`") # noqa: E501 - self._retention_policies = retention_policies - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, BucketMetadataManifest): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/bucket_retention_rules.py b/frogpilot/third_party/influxdb_client/domain/bucket_retention_rules.py deleted file mode 100644 index 2359eb73..00000000 --- a/frogpilot/third_party/influxdb_client/domain/bucket_retention_rules.py +++ /dev/null @@ -1,164 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class BucketRetentionRules(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'every_seconds': 'int', - 'shard_group_duration_seconds': 'int' - } - - attribute_map = { - 'type': 'type', - 'every_seconds': 'everySeconds', - 'shard_group_duration_seconds': 'shardGroupDurationSeconds' - } - - def __init__(self, type='expire', every_seconds=2592000, shard_group_duration_seconds=None): # noqa: E501,D401,D403 - """BucketRetentionRules - a model defined in OpenAPI.""" # noqa: E501 - self._type = None - self._every_seconds = None - self._shard_group_duration_seconds = None - self.discriminator = None - - if type is not None: - self.type = type - self.every_seconds = every_seconds - if shard_group_duration_seconds is not None: - self.shard_group_duration_seconds = shard_group_duration_seconds - - @property - def type(self): - """Get the type of this BucketRetentionRules. - - :return: The type of this BucketRetentionRules. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this BucketRetentionRules. - - :param type: The type of this BucketRetentionRules. - :type: str - """ # noqa: E501 - self._type = type - - @property - def every_seconds(self): - """Get the every_seconds of this BucketRetentionRules. - - The duration in seconds for how long data will be kept in the database. The default duration is 2592000 (30 days). 0 represents infinite retention. - - :return: The every_seconds of this BucketRetentionRules. - :rtype: int - """ # noqa: E501 - return self._every_seconds - - @every_seconds.setter - def every_seconds(self, every_seconds): - """Set the every_seconds of this BucketRetentionRules. - - The duration in seconds for how long data will be kept in the database. The default duration is 2592000 (30 days). 0 represents infinite retention. - - :param every_seconds: The every_seconds of this BucketRetentionRules. - :type: int - """ # noqa: E501 - if every_seconds is None: - raise ValueError("Invalid value for `every_seconds`, must not be `None`") # noqa: E501 - if every_seconds is not None and every_seconds < 0: # noqa: E501 - raise ValueError("Invalid value for `every_seconds`, must be a value greater than or equal to `0`") # noqa: E501 - self._every_seconds = every_seconds - - @property - def shard_group_duration_seconds(self): - """Get the shard_group_duration_seconds of this BucketRetentionRules. - - The shard group duration. The duration or interval (in seconds) that each shard group covers. #### InfluxDB Cloud - Does not use `shardGroupDurationsSeconds`. #### InfluxDB OSS - Default value depends on the [bucket retention period](https://docs.influxdata.com/influxdb/latest/reference/internals/shards/#shard-group-duration). - - :return: The shard_group_duration_seconds of this BucketRetentionRules. - :rtype: int - """ # noqa: E501 - return self._shard_group_duration_seconds - - @shard_group_duration_seconds.setter - def shard_group_duration_seconds(self, shard_group_duration_seconds): - """Set the shard_group_duration_seconds of this BucketRetentionRules. - - The shard group duration. The duration or interval (in seconds) that each shard group covers. #### InfluxDB Cloud - Does not use `shardGroupDurationsSeconds`. #### InfluxDB OSS - Default value depends on the [bucket retention period](https://docs.influxdata.com/influxdb/latest/reference/internals/shards/#shard-group-duration). - - :param shard_group_duration_seconds: The shard_group_duration_seconds of this BucketRetentionRules. - :type: int - """ # noqa: E501 - self._shard_group_duration_seconds = shard_group_duration_seconds - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, BucketRetentionRules): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/bucket_shard_mapping.py b/frogpilot/third_party/influxdb_client/domain/bucket_shard_mapping.py deleted file mode 100644 index 1bf7c277..00000000 --- a/frogpilot/third_party/influxdb_client/domain/bucket_shard_mapping.py +++ /dev/null @@ -1,132 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class BucketShardMapping(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'old_id': 'int', - 'new_id': 'int' - } - - attribute_map = { - 'old_id': 'oldId', - 'new_id': 'newId' - } - - def __init__(self, old_id=None, new_id=None): # noqa: E501,D401,D403 - """BucketShardMapping - a model defined in OpenAPI.""" # noqa: E501 - self._old_id = None - self._new_id = None - self.discriminator = None - - self.old_id = old_id - self.new_id = new_id - - @property - def old_id(self): - """Get the old_id of this BucketShardMapping. - - :return: The old_id of this BucketShardMapping. - :rtype: int - """ # noqa: E501 - return self._old_id - - @old_id.setter - def old_id(self, old_id): - """Set the old_id of this BucketShardMapping. - - :param old_id: The old_id of this BucketShardMapping. - :type: int - """ # noqa: E501 - if old_id is None: - raise ValueError("Invalid value for `old_id`, must not be `None`") # noqa: E501 - self._old_id = old_id - - @property - def new_id(self): - """Get the new_id of this BucketShardMapping. - - :return: The new_id of this BucketShardMapping. - :rtype: int - """ # noqa: E501 - return self._new_id - - @new_id.setter - def new_id(self, new_id): - """Set the new_id of this BucketShardMapping. - - :param new_id: The new_id of this BucketShardMapping. - :type: int - """ # noqa: E501 - if new_id is None: - raise ValueError("Invalid value for `new_id`, must not be `None`") # noqa: E501 - self._new_id = new_id - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, BucketShardMapping): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/buckets.py b/frogpilot/third_party/influxdb_client/domain/buckets.py deleted file mode 100644 index de3277f7..00000000 --- a/frogpilot/third_party/influxdb_client/domain/buckets.py +++ /dev/null @@ -1,130 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class Buckets(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'links': 'Links', - 'buckets': 'list[Bucket]' - } - - attribute_map = { - 'links': 'links', - 'buckets': 'buckets' - } - - def __init__(self, links=None, buckets=None): # noqa: E501,D401,D403 - """Buckets - a model defined in OpenAPI.""" # noqa: E501 - self._links = None - self._buckets = None - self.discriminator = None - - if links is not None: - self.links = links - if buckets is not None: - self.buckets = buckets - - @property - def links(self): - """Get the links of this Buckets. - - :return: The links of this Buckets. - :rtype: Links - """ # noqa: E501 - return self._links - - @links.setter - def links(self, links): - """Set the links of this Buckets. - - :param links: The links of this Buckets. - :type: Links - """ # noqa: E501 - self._links = links - - @property - def buckets(self): - """Get the buckets of this Buckets. - - :return: The buckets of this Buckets. - :rtype: list[Bucket] - """ # noqa: E501 - return self._buckets - - @buckets.setter - def buckets(self, buckets): - """Set the buckets of this Buckets. - - :param buckets: The buckets of this Buckets. - :type: list[Bucket] - """ # noqa: E501 - self._buckets = buckets - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Buckets): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/builder_aggregate_function_type.py b/frogpilot/third_party/influxdb_client/domain/builder_aggregate_function_type.py deleted file mode 100644 index 0cbf6b67..00000000 --- a/frogpilot/third_party/influxdb_client/domain/builder_aggregate_function_type.py +++ /dev/null @@ -1,88 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class BuilderAggregateFunctionType(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - allowed enum values - """ - FILTER = "filter" - GROUP = "group" - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501,D401,D403 - """BuilderAggregateFunctionType - a model defined in OpenAPI.""" # noqa: E501 self.discriminator = None - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, BuilderAggregateFunctionType): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/builder_config.py b/frogpilot/third_party/influxdb_client/domain/builder_config.py deleted file mode 100644 index e8a2d025..00000000 --- a/frogpilot/third_party/influxdb_client/domain/builder_config.py +++ /dev/null @@ -1,176 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class BuilderConfig(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'buckets': 'list[str]', - 'tags': 'list[BuilderTagsType]', - 'functions': 'list[BuilderFunctionsType]', - 'aggregate_window': 'BuilderConfigAggregateWindow' - } - - attribute_map = { - 'buckets': 'buckets', - 'tags': 'tags', - 'functions': 'functions', - 'aggregate_window': 'aggregateWindow' - } - - def __init__(self, buckets=None, tags=None, functions=None, aggregate_window=None): # noqa: E501,D401,D403 - """BuilderConfig - a model defined in OpenAPI.""" # noqa: E501 - self._buckets = None - self._tags = None - self._functions = None - self._aggregate_window = None - self.discriminator = None - - if buckets is not None: - self.buckets = buckets - if tags is not None: - self.tags = tags - if functions is not None: - self.functions = functions - if aggregate_window is not None: - self.aggregate_window = aggregate_window - - @property - def buckets(self): - """Get the buckets of this BuilderConfig. - - :return: The buckets of this BuilderConfig. - :rtype: list[str] - """ # noqa: E501 - return self._buckets - - @buckets.setter - def buckets(self, buckets): - """Set the buckets of this BuilderConfig. - - :param buckets: The buckets of this BuilderConfig. - :type: list[str] - """ # noqa: E501 - self._buckets = buckets - - @property - def tags(self): - """Get the tags of this BuilderConfig. - - :return: The tags of this BuilderConfig. - :rtype: list[BuilderTagsType] - """ # noqa: E501 - return self._tags - - @tags.setter - def tags(self, tags): - """Set the tags of this BuilderConfig. - - :param tags: The tags of this BuilderConfig. - :type: list[BuilderTagsType] - """ # noqa: E501 - self._tags = tags - - @property - def functions(self): - """Get the functions of this BuilderConfig. - - :return: The functions of this BuilderConfig. - :rtype: list[BuilderFunctionsType] - """ # noqa: E501 - return self._functions - - @functions.setter - def functions(self, functions): - """Set the functions of this BuilderConfig. - - :param functions: The functions of this BuilderConfig. - :type: list[BuilderFunctionsType] - """ # noqa: E501 - self._functions = functions - - @property - def aggregate_window(self): - """Get the aggregate_window of this BuilderConfig. - - :return: The aggregate_window of this BuilderConfig. - :rtype: BuilderConfigAggregateWindow - """ # noqa: E501 - return self._aggregate_window - - @aggregate_window.setter - def aggregate_window(self, aggregate_window): - """Set the aggregate_window of this BuilderConfig. - - :param aggregate_window: The aggregate_window of this BuilderConfig. - :type: BuilderConfigAggregateWindow - """ # noqa: E501 - self._aggregate_window = aggregate_window - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, BuilderConfig): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/builder_config_aggregate_window.py b/frogpilot/third_party/influxdb_client/domain/builder_config_aggregate_window.py deleted file mode 100644 index bcdde38d..00000000 --- a/frogpilot/third_party/influxdb_client/domain/builder_config_aggregate_window.py +++ /dev/null @@ -1,130 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class BuilderConfigAggregateWindow(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'period': 'str', - 'fill_values': 'bool' - } - - attribute_map = { - 'period': 'period', - 'fill_values': 'fillValues' - } - - def __init__(self, period=None, fill_values=None): # noqa: E501,D401,D403 - """BuilderConfigAggregateWindow - a model defined in OpenAPI.""" # noqa: E501 - self._period = None - self._fill_values = None - self.discriminator = None - - if period is not None: - self.period = period - if fill_values is not None: - self.fill_values = fill_values - - @property - def period(self): - """Get the period of this BuilderConfigAggregateWindow. - - :return: The period of this BuilderConfigAggregateWindow. - :rtype: str - """ # noqa: E501 - return self._period - - @period.setter - def period(self, period): - """Set the period of this BuilderConfigAggregateWindow. - - :param period: The period of this BuilderConfigAggregateWindow. - :type: str - """ # noqa: E501 - self._period = period - - @property - def fill_values(self): - """Get the fill_values of this BuilderConfigAggregateWindow. - - :return: The fill_values of this BuilderConfigAggregateWindow. - :rtype: bool - """ # noqa: E501 - return self._fill_values - - @fill_values.setter - def fill_values(self, fill_values): - """Set the fill_values of this BuilderConfigAggregateWindow. - - :param fill_values: The fill_values of this BuilderConfigAggregateWindow. - :type: bool - """ # noqa: E501 - self._fill_values = fill_values - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, BuilderConfigAggregateWindow): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/builder_functions_type.py b/frogpilot/third_party/influxdb_client/domain/builder_functions_type.py deleted file mode 100644 index 4ebf44ea..00000000 --- a/frogpilot/third_party/influxdb_client/domain/builder_functions_type.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class BuilderFunctionsType(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str' - } - - attribute_map = { - 'name': 'name' - } - - def __init__(self, name=None): # noqa: E501,D401,D403 - """BuilderFunctionsType - a model defined in OpenAPI.""" # noqa: E501 - self._name = None - self.discriminator = None - - if name is not None: - self.name = name - - @property - def name(self): - """Get the name of this BuilderFunctionsType. - - :return: The name of this BuilderFunctionsType. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this BuilderFunctionsType. - - :param name: The name of this BuilderFunctionsType. - :type: str - """ # noqa: E501 - self._name = name - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, BuilderFunctionsType): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/builder_tags_type.py b/frogpilot/third_party/influxdb_client/domain/builder_tags_type.py deleted file mode 100644 index fcf7e05e..00000000 --- a/frogpilot/third_party/influxdb_client/domain/builder_tags_type.py +++ /dev/null @@ -1,153 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class BuilderTagsType(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'key': 'str', - 'values': 'list[str]', - 'aggregate_function_type': 'BuilderAggregateFunctionType' - } - - attribute_map = { - 'key': 'key', - 'values': 'values', - 'aggregate_function_type': 'aggregateFunctionType' - } - - def __init__(self, key=None, values=None, aggregate_function_type=None): # noqa: E501,D401,D403 - """BuilderTagsType - a model defined in OpenAPI.""" # noqa: E501 - self._key = None - self._values = None - self._aggregate_function_type = None - self.discriminator = None - - if key is not None: - self.key = key - if values is not None: - self.values = values - if aggregate_function_type is not None: - self.aggregate_function_type = aggregate_function_type - - @property - def key(self): - """Get the key of this BuilderTagsType. - - :return: The key of this BuilderTagsType. - :rtype: str - """ # noqa: E501 - return self._key - - @key.setter - def key(self, key): - """Set the key of this BuilderTagsType. - - :param key: The key of this BuilderTagsType. - :type: str - """ # noqa: E501 - self._key = key - - @property - def values(self): - """Get the values of this BuilderTagsType. - - :return: The values of this BuilderTagsType. - :rtype: list[str] - """ # noqa: E501 - return self._values - - @values.setter - def values(self, values): - """Set the values of this BuilderTagsType. - - :param values: The values of this BuilderTagsType. - :type: list[str] - """ # noqa: E501 - self._values = values - - @property - def aggregate_function_type(self): - """Get the aggregate_function_type of this BuilderTagsType. - - :return: The aggregate_function_type of this BuilderTagsType. - :rtype: BuilderAggregateFunctionType - """ # noqa: E501 - return self._aggregate_function_type - - @aggregate_function_type.setter - def aggregate_function_type(self, aggregate_function_type): - """Set the aggregate_function_type of this BuilderTagsType. - - :param aggregate_function_type: The aggregate_function_type of this BuilderTagsType. - :type: BuilderAggregateFunctionType - """ # noqa: E501 - self._aggregate_function_type = aggregate_function_type - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, BuilderTagsType): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/builtin_statement.py b/frogpilot/third_party/influxdb_client/domain/builtin_statement.py deleted file mode 100644 index 51f24a31..00000000 --- a/frogpilot/third_party/influxdb_client/domain/builtin_statement.py +++ /dev/null @@ -1,138 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.statement import Statement - - -class BuiltinStatement(Statement): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'id': 'Identifier' - } - - attribute_map = { - 'type': 'type', - 'id': 'id' - } - - def __init__(self, type=None, id=None): # noqa: E501,D401,D403 - """BuiltinStatement - a model defined in OpenAPI.""" # noqa: E501 - Statement.__init__(self) # noqa: E501 - - self._type = None - self._id = None - self.discriminator = None - - if type is not None: - self.type = type - if id is not None: - self.id = id - - @property - def type(self): - """Get the type of this BuiltinStatement. - - Type of AST node - - :return: The type of this BuiltinStatement. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this BuiltinStatement. - - Type of AST node - - :param type: The type of this BuiltinStatement. - :type: str - """ # noqa: E501 - self._type = type - - @property - def id(self): - """Get the id of this BuiltinStatement. - - :return: The id of this BuiltinStatement. - :rtype: Identifier - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this BuiltinStatement. - - :param id: The id of this BuiltinStatement. - :type: Identifier - """ # noqa: E501 - self._id = id - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, BuiltinStatement): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/call_expression.py b/frogpilot/third_party/influxdb_client/domain/call_expression.py deleted file mode 100644 index 922b705d..00000000 --- a/frogpilot/third_party/influxdb_client/domain/call_expression.py +++ /dev/null @@ -1,165 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.expression import Expression - - -class CallExpression(Expression): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'callee': 'Expression', - 'arguments': 'list[Expression]' - } - - attribute_map = { - 'type': 'type', - 'callee': 'callee', - 'arguments': 'arguments' - } - - def __init__(self, type=None, callee=None, arguments=None): # noqa: E501,D401,D403 - """CallExpression - a model defined in OpenAPI.""" # noqa: E501 - Expression.__init__(self) # noqa: E501 - - self._type = None - self._callee = None - self._arguments = None - self.discriminator = None - - if type is not None: - self.type = type - if callee is not None: - self.callee = callee - if arguments is not None: - self.arguments = arguments - - @property - def type(self): - """Get the type of this CallExpression. - - Type of AST node - - :return: The type of this CallExpression. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this CallExpression. - - Type of AST node - - :param type: The type of this CallExpression. - :type: str - """ # noqa: E501 - self._type = type - - @property - def callee(self): - """Get the callee of this CallExpression. - - :return: The callee of this CallExpression. - :rtype: Expression - """ # noqa: E501 - return self._callee - - @callee.setter - def callee(self, callee): - """Set the callee of this CallExpression. - - :param callee: The callee of this CallExpression. - :type: Expression - """ # noqa: E501 - self._callee = callee - - @property - def arguments(self): - """Get the arguments of this CallExpression. - - Function arguments - - :return: The arguments of this CallExpression. - :rtype: list[Expression] - """ # noqa: E501 - return self._arguments - - @arguments.setter - def arguments(self, arguments): - """Set the arguments of this CallExpression. - - Function arguments - - :param arguments: The arguments of this CallExpression. - :type: list[Expression] - """ # noqa: E501 - self._arguments = arguments - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, CallExpression): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/cell.py b/frogpilot/third_party/influxdb_client/domain/cell.py deleted file mode 100644 index d52d9476..00000000 --- a/frogpilot/third_party/influxdb_client/domain/cell.py +++ /dev/null @@ -1,249 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class Cell(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'str', - 'links': 'CellLinks', - 'x': 'int', - 'y': 'int', - 'w': 'int', - 'h': 'int', - 'view_id': 'str' - } - - attribute_map = { - 'id': 'id', - 'links': 'links', - 'x': 'x', - 'y': 'y', - 'w': 'w', - 'h': 'h', - 'view_id': 'viewID' - } - - def __init__(self, id=None, links=None, x=None, y=None, w=None, h=None, view_id=None): # noqa: E501,D401,D403 - """Cell - a model defined in OpenAPI.""" # noqa: E501 - self._id = None - self._links = None - self._x = None - self._y = None - self._w = None - self._h = None - self._view_id = None - self.discriminator = None - - if id is not None: - self.id = id - if links is not None: - self.links = links - if x is not None: - self.x = x - if y is not None: - self.y = y - if w is not None: - self.w = w - if h is not None: - self.h = h - if view_id is not None: - self.view_id = view_id - - @property - def id(self): - """Get the id of this Cell. - - :return: The id of this Cell. - :rtype: str - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this Cell. - - :param id: The id of this Cell. - :type: str - """ # noqa: E501 - self._id = id - - @property - def links(self): - """Get the links of this Cell. - - :return: The links of this Cell. - :rtype: CellLinks - """ # noqa: E501 - return self._links - - @links.setter - def links(self, links): - """Set the links of this Cell. - - :param links: The links of this Cell. - :type: CellLinks - """ # noqa: E501 - self._links = links - - @property - def x(self): - """Get the x of this Cell. - - :return: The x of this Cell. - :rtype: int - """ # noqa: E501 - return self._x - - @x.setter - def x(self, x): - """Set the x of this Cell. - - :param x: The x of this Cell. - :type: int - """ # noqa: E501 - self._x = x - - @property - def y(self): - """Get the y of this Cell. - - :return: The y of this Cell. - :rtype: int - """ # noqa: E501 - return self._y - - @y.setter - def y(self, y): - """Set the y of this Cell. - - :param y: The y of this Cell. - :type: int - """ # noqa: E501 - self._y = y - - @property - def w(self): - """Get the w of this Cell. - - :return: The w of this Cell. - :rtype: int - """ # noqa: E501 - return self._w - - @w.setter - def w(self, w): - """Set the w of this Cell. - - :param w: The w of this Cell. - :type: int - """ # noqa: E501 - self._w = w - - @property - def h(self): - """Get the h of this Cell. - - :return: The h of this Cell. - :rtype: int - """ # noqa: E501 - return self._h - - @h.setter - def h(self, h): - """Set the h of this Cell. - - :param h: The h of this Cell. - :type: int - """ # noqa: E501 - self._h = h - - @property - def view_id(self): - """Get the view_id of this Cell. - - The reference to a view from the views API. - - :return: The view_id of this Cell. - :rtype: str - """ # noqa: E501 - return self._view_id - - @view_id.setter - def view_id(self, view_id): - """Set the view_id of this Cell. - - The reference to a view from the views API. - - :param view_id: The view_id of this Cell. - :type: str - """ # noqa: E501 - self._view_id = view_id - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Cell): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/cell_links.py b/frogpilot/third_party/influxdb_client/domain/cell_links.py deleted file mode 100644 index fc556c72..00000000 --- a/frogpilot/third_party/influxdb_client/domain/cell_links.py +++ /dev/null @@ -1,130 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class CellLinks(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - '_self': 'str', - 'view': 'str' - } - - attribute_map = { - '_self': 'self', - 'view': 'view' - } - - def __init__(self, _self=None, view=None): # noqa: E501,D401,D403 - """CellLinks - a model defined in OpenAPI.""" # noqa: E501 - self.__self = None - self._view = None - self.discriminator = None - - if _self is not None: - self._self = _self - if view is not None: - self.view = view - - @property - def _self(self): - """Get the _self of this CellLinks. - - :return: The _self of this CellLinks. - :rtype: str - """ # noqa: E501 - return self.__self - - @_self.setter - def _self(self, _self): - """Set the _self of this CellLinks. - - :param _self: The _self of this CellLinks. - :type: str - """ # noqa: E501 - self.__self = _self - - @property - def view(self): - """Get the view of this CellLinks. - - :return: The view of this CellLinks. - :rtype: str - """ # noqa: E501 - return self._view - - @view.setter - def view(self, view): - """Set the view of this CellLinks. - - :param view: The view of this CellLinks. - :type: str - """ # noqa: E501 - self._view = view - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, CellLinks): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/cell_update.py b/frogpilot/third_party/influxdb_client/domain/cell_update.py deleted file mode 100644 index d58c6257..00000000 --- a/frogpilot/third_party/influxdb_client/domain/cell_update.py +++ /dev/null @@ -1,176 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class CellUpdate(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'x': 'int', - 'y': 'int', - 'w': 'int', - 'h': 'int' - } - - attribute_map = { - 'x': 'x', - 'y': 'y', - 'w': 'w', - 'h': 'h' - } - - def __init__(self, x=None, y=None, w=None, h=None): # noqa: E501,D401,D403 - """CellUpdate - a model defined in OpenAPI.""" # noqa: E501 - self._x = None - self._y = None - self._w = None - self._h = None - self.discriminator = None - - if x is not None: - self.x = x - if y is not None: - self.y = y - if w is not None: - self.w = w - if h is not None: - self.h = h - - @property - def x(self): - """Get the x of this CellUpdate. - - :return: The x of this CellUpdate. - :rtype: int - """ # noqa: E501 - return self._x - - @x.setter - def x(self, x): - """Set the x of this CellUpdate. - - :param x: The x of this CellUpdate. - :type: int - """ # noqa: E501 - self._x = x - - @property - def y(self): - """Get the y of this CellUpdate. - - :return: The y of this CellUpdate. - :rtype: int - """ # noqa: E501 - return self._y - - @y.setter - def y(self, y): - """Set the y of this CellUpdate. - - :param y: The y of this CellUpdate. - :type: int - """ # noqa: E501 - self._y = y - - @property - def w(self): - """Get the w of this CellUpdate. - - :return: The w of this CellUpdate. - :rtype: int - """ # noqa: E501 - return self._w - - @w.setter - def w(self, w): - """Set the w of this CellUpdate. - - :param w: The w of this CellUpdate. - :type: int - """ # noqa: E501 - self._w = w - - @property - def h(self): - """Get the h of this CellUpdate. - - :return: The h of this CellUpdate. - :rtype: int - """ # noqa: E501 - return self._h - - @h.setter - def h(self, h): - """Set the h of this CellUpdate. - - :param h: The h of this CellUpdate. - :type: int - """ # noqa: E501 - self._h = h - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, CellUpdate): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/cell_with_view_properties.py b/frogpilot/third_party/influxdb_client/domain/cell_with_view_properties.py deleted file mode 100644 index 4379cd11..00000000 --- a/frogpilot/third_party/influxdb_client/domain/cell_with_view_properties.py +++ /dev/null @@ -1,148 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.cell import Cell - - -class CellWithViewProperties(Cell): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str', - 'properties': 'ViewProperties', - 'id': 'str', - 'links': 'CellLinks', - 'x': 'int', - 'y': 'int', - 'w': 'int', - 'h': 'int', - 'view_id': 'str' - } - - attribute_map = { - 'name': 'name', - 'properties': 'properties', - 'id': 'id', - 'links': 'links', - 'x': 'x', - 'y': 'y', - 'w': 'w', - 'h': 'h', - 'view_id': 'viewID' - } - - def __init__(self, name=None, properties=None, id=None, links=None, x=None, y=None, w=None, h=None, view_id=None): # noqa: E501,D401,D403 - """CellWithViewProperties - a model defined in OpenAPI.""" # noqa: E501 - Cell.__init__(self, id=id, links=links, x=x, y=y, w=w, h=h, view_id=view_id) # noqa: E501 - - self._name = None - self._properties = None - self.discriminator = None - - if name is not None: - self.name = name - if properties is not None: - self.properties = properties - - @property - def name(self): - """Get the name of this CellWithViewProperties. - - :return: The name of this CellWithViewProperties. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this CellWithViewProperties. - - :param name: The name of this CellWithViewProperties. - :type: str - """ # noqa: E501 - self._name = name - - @property - def properties(self): - """Get the properties of this CellWithViewProperties. - - :return: The properties of this CellWithViewProperties. - :rtype: ViewProperties - """ # noqa: E501 - return self._properties - - @properties.setter - def properties(self, properties): - """Set the properties of this CellWithViewProperties. - - :param properties: The properties of this CellWithViewProperties. - :type: ViewProperties - """ # noqa: E501 - self._properties = properties - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, CellWithViewProperties): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/check.py b/frogpilot/third_party/influxdb_client/domain/check.py deleted file mode 100644 index c85e4a55..00000000 --- a/frogpilot/third_party/influxdb_client/domain/check.py +++ /dev/null @@ -1,120 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class Check(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str' - } - - attribute_map = { - 'type': 'type' - } - - discriminator_value_class_map = { - 'deadman': 'DeadmanCheck', - 'custom': 'CustomCheck', - 'threshold': 'ThresholdCheck' - } - - def __init__(self, type=None): # noqa: E501,D401,D403 - """Check - a model defined in OpenAPI.""" # noqa: E501 - self._type = None - self.discriminator = 'type' - - self.type = type - - @property - def type(self): - """Get the type of this Check. - - :return: The type of this Check. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this Check. - - :param type: The type of this Check. - :type: str - """ # noqa: E501 - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - self._type = type - - def get_real_child_model(self, data): - """Return the real base class specified by the discriminator.""" - discriminator_key = self.attribute_map[self.discriminator] - discriminator_value = data[discriminator_key] - return self.discriminator_value_class_map.get(discriminator_value) - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Check): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/check_base.py b/frogpilot/third_party/influxdb_client/domain/check_base.py deleted file mode 100644 index b54921a1..00000000 --- a/frogpilot/third_party/influxdb_client/domain/check_base.py +++ /dev/null @@ -1,452 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class CheckBase(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'str', - 'name': 'str', - 'org_id': 'str', - 'task_id': 'str', - 'owner_id': 'str', - 'created_at': 'datetime', - 'updated_at': 'datetime', - 'query': 'DashboardQuery', - 'status': 'TaskStatusType', - 'description': 'str', - 'latest_completed': 'datetime', - 'last_run_status': 'str', - 'last_run_error': 'str', - 'labels': 'list[Label]', - 'links': 'CheckBaseLinks' - } - - attribute_map = { - 'id': 'id', - 'name': 'name', - 'org_id': 'orgID', - 'task_id': 'taskID', - 'owner_id': 'ownerID', - 'created_at': 'createdAt', - 'updated_at': 'updatedAt', - 'query': 'query', - 'status': 'status', - 'description': 'description', - 'latest_completed': 'latestCompleted', - 'last_run_status': 'lastRunStatus', - 'last_run_error': 'lastRunError', - 'labels': 'labels', - 'links': 'links' - } - - def __init__(self, id=None, name=None, org_id=None, task_id=None, owner_id=None, created_at=None, updated_at=None, query=None, status=None, description=None, latest_completed=None, last_run_status=None, last_run_error=None, labels=None, links=None): # noqa: E501,D401,D403 - """CheckBase - a model defined in OpenAPI.""" # noqa: E501 - self._id = None - self._name = None - self._org_id = None - self._task_id = None - self._owner_id = None - self._created_at = None - self._updated_at = None - self._query = None - self._status = None - self._description = None - self._latest_completed = None - self._last_run_status = None - self._last_run_error = None - self._labels = None - self._links = None - self.discriminator = None - - if id is not None: - self.id = id - self.name = name - self.org_id = org_id - if task_id is not None: - self.task_id = task_id - if owner_id is not None: - self.owner_id = owner_id - if created_at is not None: - self.created_at = created_at - if updated_at is not None: - self.updated_at = updated_at - self.query = query - if status is not None: - self.status = status - if description is not None: - self.description = description - if latest_completed is not None: - self.latest_completed = latest_completed - if last_run_status is not None: - self.last_run_status = last_run_status - if last_run_error is not None: - self.last_run_error = last_run_error - if labels is not None: - self.labels = labels - if links is not None: - self.links = links - - @property - def id(self): - """Get the id of this CheckBase. - - :return: The id of this CheckBase. - :rtype: str - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this CheckBase. - - :param id: The id of this CheckBase. - :type: str - """ # noqa: E501 - self._id = id - - @property - def name(self): - """Get the name of this CheckBase. - - :return: The name of this CheckBase. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this CheckBase. - - :param name: The name of this CheckBase. - :type: str - """ # noqa: E501 - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - self._name = name - - @property - def org_id(self): - """Get the org_id of this CheckBase. - - The ID of the organization that owns this check. - - :return: The org_id of this CheckBase. - :rtype: str - """ # noqa: E501 - return self._org_id - - @org_id.setter - def org_id(self, org_id): - """Set the org_id of this CheckBase. - - The ID of the organization that owns this check. - - :param org_id: The org_id of this CheckBase. - :type: str - """ # noqa: E501 - if org_id is None: - raise ValueError("Invalid value for `org_id`, must not be `None`") # noqa: E501 - self._org_id = org_id - - @property - def task_id(self): - """Get the task_id of this CheckBase. - - The ID of the task associated with this check. - - :return: The task_id of this CheckBase. - :rtype: str - """ # noqa: E501 - return self._task_id - - @task_id.setter - def task_id(self, task_id): - """Set the task_id of this CheckBase. - - The ID of the task associated with this check. - - :param task_id: The task_id of this CheckBase. - :type: str - """ # noqa: E501 - self._task_id = task_id - - @property - def owner_id(self): - """Get the owner_id of this CheckBase. - - The ID of creator used to create this check. - - :return: The owner_id of this CheckBase. - :rtype: str - """ # noqa: E501 - return self._owner_id - - @owner_id.setter - def owner_id(self, owner_id): - """Set the owner_id of this CheckBase. - - The ID of creator used to create this check. - - :param owner_id: The owner_id of this CheckBase. - :type: str - """ # noqa: E501 - self._owner_id = owner_id - - @property - def created_at(self): - """Get the created_at of this CheckBase. - - :return: The created_at of this CheckBase. - :rtype: datetime - """ # noqa: E501 - return self._created_at - - @created_at.setter - def created_at(self, created_at): - """Set the created_at of this CheckBase. - - :param created_at: The created_at of this CheckBase. - :type: datetime - """ # noqa: E501 - self._created_at = created_at - - @property - def updated_at(self): - """Get the updated_at of this CheckBase. - - :return: The updated_at of this CheckBase. - :rtype: datetime - """ # noqa: E501 - return self._updated_at - - @updated_at.setter - def updated_at(self, updated_at): - """Set the updated_at of this CheckBase. - - :param updated_at: The updated_at of this CheckBase. - :type: datetime - """ # noqa: E501 - self._updated_at = updated_at - - @property - def query(self): - """Get the query of this CheckBase. - - :return: The query of this CheckBase. - :rtype: DashboardQuery - """ # noqa: E501 - return self._query - - @query.setter - def query(self, query): - """Set the query of this CheckBase. - - :param query: The query of this CheckBase. - :type: DashboardQuery - """ # noqa: E501 - if query is None: - raise ValueError("Invalid value for `query`, must not be `None`") # noqa: E501 - self._query = query - - @property - def status(self): - """Get the status of this CheckBase. - - :return: The status of this CheckBase. - :rtype: TaskStatusType - """ # noqa: E501 - return self._status - - @status.setter - def status(self, status): - """Set the status of this CheckBase. - - :param status: The status of this CheckBase. - :type: TaskStatusType - """ # noqa: E501 - self._status = status - - @property - def description(self): - """Get the description of this CheckBase. - - An optional description of the check. - - :return: The description of this CheckBase. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this CheckBase. - - An optional description of the check. - - :param description: The description of this CheckBase. - :type: str - """ # noqa: E501 - self._description = description - - @property - def latest_completed(self): - """Get the latest_completed of this CheckBase. - - A timestamp ([RFC3339 date/time format](https://docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339-timestamp)) of the latest scheduled and completed run. - - :return: The latest_completed of this CheckBase. - :rtype: datetime - """ # noqa: E501 - return self._latest_completed - - @latest_completed.setter - def latest_completed(self, latest_completed): - """Set the latest_completed of this CheckBase. - - A timestamp ([RFC3339 date/time format](https://docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339-timestamp)) of the latest scheduled and completed run. - - :param latest_completed: The latest_completed of this CheckBase. - :type: datetime - """ # noqa: E501 - self._latest_completed = latest_completed - - @property - def last_run_status(self): - """Get the last_run_status of this CheckBase. - - :return: The last_run_status of this CheckBase. - :rtype: str - """ # noqa: E501 - return self._last_run_status - - @last_run_status.setter - def last_run_status(self, last_run_status): - """Set the last_run_status of this CheckBase. - - :param last_run_status: The last_run_status of this CheckBase. - :type: str - """ # noqa: E501 - self._last_run_status = last_run_status - - @property - def last_run_error(self): - """Get the last_run_error of this CheckBase. - - :return: The last_run_error of this CheckBase. - :rtype: str - """ # noqa: E501 - return self._last_run_error - - @last_run_error.setter - def last_run_error(self, last_run_error): - """Set the last_run_error of this CheckBase. - - :param last_run_error: The last_run_error of this CheckBase. - :type: str - """ # noqa: E501 - self._last_run_error = last_run_error - - @property - def labels(self): - """Get the labels of this CheckBase. - - :return: The labels of this CheckBase. - :rtype: list[Label] - """ # noqa: E501 - return self._labels - - @labels.setter - def labels(self, labels): - """Set the labels of this CheckBase. - - :param labels: The labels of this CheckBase. - :type: list[Label] - """ # noqa: E501 - self._labels = labels - - @property - def links(self): - """Get the links of this CheckBase. - - :return: The links of this CheckBase. - :rtype: CheckBaseLinks - """ # noqa: E501 - return self._links - - @links.setter - def links(self, links): - """Set the links of this CheckBase. - - :param links: The links of this CheckBase. - :type: CheckBaseLinks - """ # noqa: E501 - self._links = links - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, CheckBase): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/check_base_links.py b/frogpilot/third_party/influxdb_client/domain/check_base_links.py deleted file mode 100644 index 19c28aa4..00000000 --- a/frogpilot/third_party/influxdb_client/domain/check_base_links.py +++ /dev/null @@ -1,219 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class CheckBaseLinks(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - '_self': 'str', - 'labels': 'str', - 'members': 'str', - 'owners': 'str', - 'query': 'str' - } - - attribute_map = { - '_self': 'self', - 'labels': 'labels', - 'members': 'members', - 'owners': 'owners', - 'query': 'query' - } - - def __init__(self, _self=None, labels=None, members=None, owners=None, query=None): # noqa: E501,D401,D403 - """CheckBaseLinks - a model defined in OpenAPI.""" # noqa: E501 - self.__self = None - self._labels = None - self._members = None - self._owners = None - self._query = None - self.discriminator = None - - if _self is not None: - self._self = _self - if labels is not None: - self.labels = labels - if members is not None: - self.members = members - if owners is not None: - self.owners = owners - if query is not None: - self.query = query - - @property - def _self(self): - """Get the _self of this CheckBaseLinks. - - URI of resource. - - :return: The _self of this CheckBaseLinks. - :rtype: str - """ # noqa: E501 - return self.__self - - @_self.setter - def _self(self, _self): - """Set the _self of this CheckBaseLinks. - - URI of resource. - - :param _self: The _self of this CheckBaseLinks. - :type: str - """ # noqa: E501 - self.__self = _self - - @property - def labels(self): - """Get the labels of this CheckBaseLinks. - - URI of resource. - - :return: The labels of this CheckBaseLinks. - :rtype: str - """ # noqa: E501 - return self._labels - - @labels.setter - def labels(self, labels): - """Set the labels of this CheckBaseLinks. - - URI of resource. - - :param labels: The labels of this CheckBaseLinks. - :type: str - """ # noqa: E501 - self._labels = labels - - @property - def members(self): - """Get the members of this CheckBaseLinks. - - URI of resource. - - :return: The members of this CheckBaseLinks. - :rtype: str - """ # noqa: E501 - return self._members - - @members.setter - def members(self, members): - """Set the members of this CheckBaseLinks. - - URI of resource. - - :param members: The members of this CheckBaseLinks. - :type: str - """ # noqa: E501 - self._members = members - - @property - def owners(self): - """Get the owners of this CheckBaseLinks. - - URI of resource. - - :return: The owners of this CheckBaseLinks. - :rtype: str - """ # noqa: E501 - return self._owners - - @owners.setter - def owners(self, owners): - """Set the owners of this CheckBaseLinks. - - URI of resource. - - :param owners: The owners of this CheckBaseLinks. - :type: str - """ # noqa: E501 - self._owners = owners - - @property - def query(self): - """Get the query of this CheckBaseLinks. - - URI of resource. - - :return: The query of this CheckBaseLinks. - :rtype: str - """ # noqa: E501 - return self._query - - @query.setter - def query(self, query): - """Set the query of this CheckBaseLinks. - - URI of resource. - - :param query: The query of this CheckBaseLinks. - :type: str - """ # noqa: E501 - self._query = query - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, CheckBaseLinks): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/check_discriminator.py b/frogpilot/third_party/influxdb_client/domain/check_discriminator.py deleted file mode 100644 index c2ebfea8..00000000 --- a/frogpilot/third_party/influxdb_client/domain/check_discriminator.py +++ /dev/null @@ -1,116 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.check_base import CheckBase - - -class CheckDiscriminator(CheckBase): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'str', - 'name': 'str', - 'org_id': 'str', - 'task_id': 'str', - 'owner_id': 'str', - 'created_at': 'datetime', - 'updated_at': 'datetime', - 'query': 'DashboardQuery', - 'status': 'TaskStatusType', - 'description': 'str', - 'latest_completed': 'datetime', - 'last_run_status': 'str', - 'last_run_error': 'str', - 'labels': 'list[Label]', - 'links': 'CheckBaseLinks' - } - - attribute_map = { - 'id': 'id', - 'name': 'name', - 'org_id': 'orgID', - 'task_id': 'taskID', - 'owner_id': 'ownerID', - 'created_at': 'createdAt', - 'updated_at': 'updatedAt', - 'query': 'query', - 'status': 'status', - 'description': 'description', - 'latest_completed': 'latestCompleted', - 'last_run_status': 'lastRunStatus', - 'last_run_error': 'lastRunError', - 'labels': 'labels', - 'links': 'links' - } - - def __init__(self, id=None, name=None, org_id=None, task_id=None, owner_id=None, created_at=None, updated_at=None, query=None, status=None, description=None, latest_completed=None, last_run_status=None, last_run_error=None, labels=None, links=None): # noqa: E501,D401,D403 - """CheckDiscriminator - a model defined in OpenAPI.""" # noqa: E501 - CheckBase.__init__(self, id=id, name=name, org_id=org_id, task_id=task_id, owner_id=owner_id, created_at=created_at, updated_at=updated_at, query=query, status=status, description=description, latest_completed=latest_completed, last_run_status=last_run_status, last_run_error=last_run_error, labels=labels, links=links) # noqa: E501 - self.discriminator = None - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, CheckDiscriminator): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/check_patch.py b/frogpilot/third_party/influxdb_client/domain/check_patch.py deleted file mode 100644 index 014e910b..00000000 --- a/frogpilot/third_party/influxdb_client/domain/check_patch.py +++ /dev/null @@ -1,153 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class CheckPatch(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str', - 'description': 'str', - 'status': 'str' - } - - attribute_map = { - 'name': 'name', - 'description': 'description', - 'status': 'status' - } - - def __init__(self, name=None, description=None, status=None): # noqa: E501,D401,D403 - """CheckPatch - a model defined in OpenAPI.""" # noqa: E501 - self._name = None - self._description = None - self._status = None - self.discriminator = None - - if name is not None: - self.name = name - if description is not None: - self.description = description - if status is not None: - self.status = status - - @property - def name(self): - """Get the name of this CheckPatch. - - :return: The name of this CheckPatch. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this CheckPatch. - - :param name: The name of this CheckPatch. - :type: str - """ # noqa: E501 - self._name = name - - @property - def description(self): - """Get the description of this CheckPatch. - - :return: The description of this CheckPatch. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this CheckPatch. - - :param description: The description of this CheckPatch. - :type: str - """ # noqa: E501 - self._description = description - - @property - def status(self): - """Get the status of this CheckPatch. - - :return: The status of this CheckPatch. - :rtype: str - """ # noqa: E501 - return self._status - - @status.setter - def status(self, status): - """Set the status of this CheckPatch. - - :param status: The status of this CheckPatch. - :type: str - """ # noqa: E501 - self._status = status - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, CheckPatch): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/check_status_level.py b/frogpilot/third_party/influxdb_client/domain/check_status_level.py deleted file mode 100644 index 476f2b56..00000000 --- a/frogpilot/third_party/influxdb_client/domain/check_status_level.py +++ /dev/null @@ -1,91 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class CheckStatusLevel(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - allowed enum values - """ - UNKNOWN = "UNKNOWN" - OK = "OK" - INFO = "INFO" - CRIT = "CRIT" - WARN = "WARN" - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501,D401,D403 - """CheckStatusLevel - a model defined in OpenAPI.""" # noqa: E501 self.discriminator = None - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, CheckStatusLevel): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/check_view_properties.py b/frogpilot/third_party/influxdb_client/domain/check_view_properties.py deleted file mode 100644 index 5226c490..00000000 --- a/frogpilot/third_party/influxdb_client/domain/check_view_properties.py +++ /dev/null @@ -1,350 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.view_properties import ViewProperties - - -class CheckViewProperties(ViewProperties): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'adaptive_zoom_hide': 'bool', - 'type': 'str', - 'shape': 'str', - 'check_id': 'str', - 'check': 'Check', - 'queries': 'list[DashboardQuery]', - 'colors': 'list[DashboardColor]', - 'legend_colorize_rows': 'bool', - 'legend_hide': 'bool', - 'legend_opacity': 'float', - 'legend_orientation_threshold': 'int' - } - - attribute_map = { - 'adaptive_zoom_hide': 'adaptiveZoomHide', - 'type': 'type', - 'shape': 'shape', - 'check_id': 'checkID', - 'check': 'check', - 'queries': 'queries', - 'colors': 'colors', - 'legend_colorize_rows': 'legendColorizeRows', - 'legend_hide': 'legendHide', - 'legend_opacity': 'legendOpacity', - 'legend_orientation_threshold': 'legendOrientationThreshold' - } - - def __init__(self, adaptive_zoom_hide=None, type=None, shape=None, check_id=None, check=None, queries=None, colors=None, legend_colorize_rows=None, legend_hide=None, legend_opacity=None, legend_orientation_threshold=None): # noqa: E501,D401,D403 - """CheckViewProperties - a model defined in OpenAPI.""" # noqa: E501 - ViewProperties.__init__(self) # noqa: E501 - - self._adaptive_zoom_hide = None - self._type = None - self._shape = None - self._check_id = None - self._check = None - self._queries = None - self._colors = None - self._legend_colorize_rows = None - self._legend_hide = None - self._legend_opacity = None - self._legend_orientation_threshold = None - self.discriminator = None - - if adaptive_zoom_hide is not None: - self.adaptive_zoom_hide = adaptive_zoom_hide - self.type = type - self.shape = shape - self.check_id = check_id - if check is not None: - self.check = check - self.queries = queries - self.colors = colors - if legend_colorize_rows is not None: - self.legend_colorize_rows = legend_colorize_rows - if legend_hide is not None: - self.legend_hide = legend_hide - if legend_opacity is not None: - self.legend_opacity = legend_opacity - if legend_orientation_threshold is not None: - self.legend_orientation_threshold = legend_orientation_threshold - - @property - def adaptive_zoom_hide(self): - """Get the adaptive_zoom_hide of this CheckViewProperties. - - :return: The adaptive_zoom_hide of this CheckViewProperties. - :rtype: bool - """ # noqa: E501 - return self._adaptive_zoom_hide - - @adaptive_zoom_hide.setter - def adaptive_zoom_hide(self, adaptive_zoom_hide): - """Set the adaptive_zoom_hide of this CheckViewProperties. - - :param adaptive_zoom_hide: The adaptive_zoom_hide of this CheckViewProperties. - :type: bool - """ # noqa: E501 - self._adaptive_zoom_hide = adaptive_zoom_hide - - @property - def type(self): - """Get the type of this CheckViewProperties. - - :return: The type of this CheckViewProperties. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this CheckViewProperties. - - :param type: The type of this CheckViewProperties. - :type: str - """ # noqa: E501 - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - self._type = type - - @property - def shape(self): - """Get the shape of this CheckViewProperties. - - :return: The shape of this CheckViewProperties. - :rtype: str - """ # noqa: E501 - return self._shape - - @shape.setter - def shape(self, shape): - """Set the shape of this CheckViewProperties. - - :param shape: The shape of this CheckViewProperties. - :type: str - """ # noqa: E501 - if shape is None: - raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 - self._shape = shape - - @property - def check_id(self): - """Get the check_id of this CheckViewProperties. - - :return: The check_id of this CheckViewProperties. - :rtype: str - """ # noqa: E501 - return self._check_id - - @check_id.setter - def check_id(self, check_id): - """Set the check_id of this CheckViewProperties. - - :param check_id: The check_id of this CheckViewProperties. - :type: str - """ # noqa: E501 - if check_id is None: - raise ValueError("Invalid value for `check_id`, must not be `None`") # noqa: E501 - self._check_id = check_id - - @property - def check(self): - """Get the check of this CheckViewProperties. - - :return: The check of this CheckViewProperties. - :rtype: Check - """ # noqa: E501 - return self._check - - @check.setter - def check(self, check): - """Set the check of this CheckViewProperties. - - :param check: The check of this CheckViewProperties. - :type: Check - """ # noqa: E501 - self._check = check - - @property - def queries(self): - """Get the queries of this CheckViewProperties. - - :return: The queries of this CheckViewProperties. - :rtype: list[DashboardQuery] - """ # noqa: E501 - return self._queries - - @queries.setter - def queries(self, queries): - """Set the queries of this CheckViewProperties. - - :param queries: The queries of this CheckViewProperties. - :type: list[DashboardQuery] - """ # noqa: E501 - if queries is None: - raise ValueError("Invalid value for `queries`, must not be `None`") # noqa: E501 - self._queries = queries - - @property - def colors(self): - """Get the colors of this CheckViewProperties. - - Colors define color encoding of data into a visualization - - :return: The colors of this CheckViewProperties. - :rtype: list[DashboardColor] - """ # noqa: E501 - return self._colors - - @colors.setter - def colors(self, colors): - """Set the colors of this CheckViewProperties. - - Colors define color encoding of data into a visualization - - :param colors: The colors of this CheckViewProperties. - :type: list[DashboardColor] - """ # noqa: E501 - if colors is None: - raise ValueError("Invalid value for `colors`, must not be `None`") # noqa: E501 - self._colors = colors - - @property - def legend_colorize_rows(self): - """Get the legend_colorize_rows of this CheckViewProperties. - - :return: The legend_colorize_rows of this CheckViewProperties. - :rtype: bool - """ # noqa: E501 - return self._legend_colorize_rows - - @legend_colorize_rows.setter - def legend_colorize_rows(self, legend_colorize_rows): - """Set the legend_colorize_rows of this CheckViewProperties. - - :param legend_colorize_rows: The legend_colorize_rows of this CheckViewProperties. - :type: bool - """ # noqa: E501 - self._legend_colorize_rows = legend_colorize_rows - - @property - def legend_hide(self): - """Get the legend_hide of this CheckViewProperties. - - :return: The legend_hide of this CheckViewProperties. - :rtype: bool - """ # noqa: E501 - return self._legend_hide - - @legend_hide.setter - def legend_hide(self, legend_hide): - """Set the legend_hide of this CheckViewProperties. - - :param legend_hide: The legend_hide of this CheckViewProperties. - :type: bool - """ # noqa: E501 - self._legend_hide = legend_hide - - @property - def legend_opacity(self): - """Get the legend_opacity of this CheckViewProperties. - - :return: The legend_opacity of this CheckViewProperties. - :rtype: float - """ # noqa: E501 - return self._legend_opacity - - @legend_opacity.setter - def legend_opacity(self, legend_opacity): - """Set the legend_opacity of this CheckViewProperties. - - :param legend_opacity: The legend_opacity of this CheckViewProperties. - :type: float - """ # noqa: E501 - self._legend_opacity = legend_opacity - - @property - def legend_orientation_threshold(self): - """Get the legend_orientation_threshold of this CheckViewProperties. - - :return: The legend_orientation_threshold of this CheckViewProperties. - :rtype: int - """ # noqa: E501 - return self._legend_orientation_threshold - - @legend_orientation_threshold.setter - def legend_orientation_threshold(self, legend_orientation_threshold): - """Set the legend_orientation_threshold of this CheckViewProperties. - - :param legend_orientation_threshold: The legend_orientation_threshold of this CheckViewProperties. - :type: int - """ # noqa: E501 - self._legend_orientation_threshold = legend_orientation_threshold - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, CheckViewProperties): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/checks.py b/frogpilot/third_party/influxdb_client/domain/checks.py deleted file mode 100644 index 05083fcc..00000000 --- a/frogpilot/third_party/influxdb_client/domain/checks.py +++ /dev/null @@ -1,130 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class Checks(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'checks': 'list[Check]', - 'links': 'Links' - } - - attribute_map = { - 'checks': 'checks', - 'links': 'links' - } - - def __init__(self, checks=None, links=None): # noqa: E501,D401,D403 - """Checks - a model defined in OpenAPI.""" # noqa: E501 - self._checks = None - self._links = None - self.discriminator = None - - if checks is not None: - self.checks = checks - if links is not None: - self.links = links - - @property - def checks(self): - """Get the checks of this Checks. - - :return: The checks of this Checks. - :rtype: list[Check] - """ # noqa: E501 - return self._checks - - @checks.setter - def checks(self, checks): - """Set the checks of this Checks. - - :param checks: The checks of this Checks. - :type: list[Check] - """ # noqa: E501 - self._checks = checks - - @property - def links(self): - """Get the links of this Checks. - - :return: The links of this Checks. - :rtype: Links - """ # noqa: E501 - return self._links - - @links.setter - def links(self, links): - """Set the links of this Checks. - - :param links: The links of this Checks. - :type: Links - """ # noqa: E501 - self._links = links - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Checks): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/column_data_type.py b/frogpilot/third_party/influxdb_client/domain/column_data_type.py deleted file mode 100644 index e2a2f2c3..00000000 --- a/frogpilot/third_party/influxdb_client/domain/column_data_type.py +++ /dev/null @@ -1,91 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class ColumnDataType(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - allowed enum values - """ - INTEGER = "integer" - FLOAT = "float" - BOOLEAN = "boolean" - STRING = "string" - UNSIGNED = "unsigned" - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501,D401,D403 - """ColumnDataType - a model defined in OpenAPI.""" # noqa: E501 self.discriminator = None - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, ColumnDataType): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/column_semantic_type.py b/frogpilot/third_party/influxdb_client/domain/column_semantic_type.py deleted file mode 100644 index 3f88a133..00000000 --- a/frogpilot/third_party/influxdb_client/domain/column_semantic_type.py +++ /dev/null @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class ColumnSemanticType(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - allowed enum values - """ - TIMESTAMP = "timestamp" - TAG = "tag" - FIELD = "field" - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501,D401,D403 - """ColumnSemanticType - a model defined in OpenAPI.""" # noqa: E501 self.discriminator = None - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, ColumnSemanticType): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/conditional_expression.py b/frogpilot/third_party/influxdb_client/domain/conditional_expression.py deleted file mode 100644 index da5af433..00000000 --- a/frogpilot/third_party/influxdb_client/domain/conditional_expression.py +++ /dev/null @@ -1,184 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.expression import Expression - - -class ConditionalExpression(Expression): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'test': 'Expression', - 'alternate': 'Expression', - 'consequent': 'Expression' - } - - attribute_map = { - 'type': 'type', - 'test': 'test', - 'alternate': 'alternate', - 'consequent': 'consequent' - } - - def __init__(self, type=None, test=None, alternate=None, consequent=None): # noqa: E501,D401,D403 - """ConditionalExpression - a model defined in OpenAPI.""" # noqa: E501 - Expression.__init__(self) # noqa: E501 - - self._type = None - self._test = None - self._alternate = None - self._consequent = None - self.discriminator = None - - if type is not None: - self.type = type - if test is not None: - self.test = test - if alternate is not None: - self.alternate = alternate - if consequent is not None: - self.consequent = consequent - - @property - def type(self): - """Get the type of this ConditionalExpression. - - Type of AST node - - :return: The type of this ConditionalExpression. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this ConditionalExpression. - - Type of AST node - - :param type: The type of this ConditionalExpression. - :type: str - """ # noqa: E501 - self._type = type - - @property - def test(self): - """Get the test of this ConditionalExpression. - - :return: The test of this ConditionalExpression. - :rtype: Expression - """ # noqa: E501 - return self._test - - @test.setter - def test(self, test): - """Set the test of this ConditionalExpression. - - :param test: The test of this ConditionalExpression. - :type: Expression - """ # noqa: E501 - self._test = test - - @property - def alternate(self): - """Get the alternate of this ConditionalExpression. - - :return: The alternate of this ConditionalExpression. - :rtype: Expression - """ # noqa: E501 - return self._alternate - - @alternate.setter - def alternate(self, alternate): - """Set the alternate of this ConditionalExpression. - - :param alternate: The alternate of this ConditionalExpression. - :type: Expression - """ # noqa: E501 - self._alternate = alternate - - @property - def consequent(self): - """Get the consequent of this ConditionalExpression. - - :return: The consequent of this ConditionalExpression. - :rtype: Expression - """ # noqa: E501 - return self._consequent - - @consequent.setter - def consequent(self, consequent): - """Set the consequent of this ConditionalExpression. - - :param consequent: The consequent of this ConditionalExpression. - :type: Expression - """ # noqa: E501 - self._consequent = consequent - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, ConditionalExpression): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/config.py b/frogpilot/third_party/influxdb_client/domain/config.py deleted file mode 100644 index cc4a0338..00000000 --- a/frogpilot/third_party/influxdb_client/domain/config.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class Config(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'config': 'dict(str, object)' - } - - attribute_map = { - 'config': 'config' - } - - def __init__(self, config=None): # noqa: E501,D401,D403 - """Config - a model defined in OpenAPI.""" # noqa: E501 - self._config = None - self.discriminator = None - - if config is not None: - self.config = config - - @property - def config(self): - """Get the config of this Config. - - :return: The config of this Config. - :rtype: dict(str, object) - """ # noqa: E501 - return self._config - - @config.setter - def config(self, config): - """Set the config of this Config. - - :param config: The config of this Config. - :type: dict(str, object) - """ # noqa: E501 - self._config = config - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Config): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/constant_variable_properties.py b/frogpilot/third_party/influxdb_client/domain/constant_variable_properties.py deleted file mode 100644 index 806045e8..00000000 --- a/frogpilot/third_party/influxdb_client/domain/constant_variable_properties.py +++ /dev/null @@ -1,134 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.variable_properties import VariableProperties - - -class ConstantVariableProperties(VariableProperties): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'values': 'list[str]' - } - - attribute_map = { - 'type': 'type', - 'values': 'values' - } - - def __init__(self, type=None, values=None): # noqa: E501,D401,D403 - """ConstantVariableProperties - a model defined in OpenAPI.""" # noqa: E501 - VariableProperties.__init__(self) # noqa: E501 - - self._type = None - self._values = None - self.discriminator = None - - if type is not None: - self.type = type - if values is not None: - self.values = values - - @property - def type(self): - """Get the type of this ConstantVariableProperties. - - :return: The type of this ConstantVariableProperties. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this ConstantVariableProperties. - - :param type: The type of this ConstantVariableProperties. - :type: str - """ # noqa: E501 - self._type = type - - @property - def values(self): - """Get the values of this ConstantVariableProperties. - - :return: The values of this ConstantVariableProperties. - :rtype: list[str] - """ # noqa: E501 - return self._values - - @values.setter - def values(self, values): - """Set the values of this ConstantVariableProperties. - - :param values: The values of this ConstantVariableProperties. - :type: list[str] - """ # noqa: E501 - self._values = values - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, ConstantVariableProperties): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/create_cell.py b/frogpilot/third_party/influxdb_client/domain/create_cell.py deleted file mode 100644 index 1251c2f1..00000000 --- a/frogpilot/third_party/influxdb_client/domain/create_cell.py +++ /dev/null @@ -1,226 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class CreateCell(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str', - 'x': 'int', - 'y': 'int', - 'w': 'int', - 'h': 'int', - 'using_view': 'str' - } - - attribute_map = { - 'name': 'name', - 'x': 'x', - 'y': 'y', - 'w': 'w', - 'h': 'h', - 'using_view': 'usingView' - } - - def __init__(self, name=None, x=None, y=None, w=None, h=None, using_view=None): # noqa: E501,D401,D403 - """CreateCell - a model defined in OpenAPI.""" # noqa: E501 - self._name = None - self._x = None - self._y = None - self._w = None - self._h = None - self._using_view = None - self.discriminator = None - - if name is not None: - self.name = name - if x is not None: - self.x = x - if y is not None: - self.y = y - if w is not None: - self.w = w - if h is not None: - self.h = h - if using_view is not None: - self.using_view = using_view - - @property - def name(self): - """Get the name of this CreateCell. - - :return: The name of this CreateCell. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this CreateCell. - - :param name: The name of this CreateCell. - :type: str - """ # noqa: E501 - self._name = name - - @property - def x(self): - """Get the x of this CreateCell. - - :return: The x of this CreateCell. - :rtype: int - """ # noqa: E501 - return self._x - - @x.setter - def x(self, x): - """Set the x of this CreateCell. - - :param x: The x of this CreateCell. - :type: int - """ # noqa: E501 - self._x = x - - @property - def y(self): - """Get the y of this CreateCell. - - :return: The y of this CreateCell. - :rtype: int - """ # noqa: E501 - return self._y - - @y.setter - def y(self, y): - """Set the y of this CreateCell. - - :param y: The y of this CreateCell. - :type: int - """ # noqa: E501 - self._y = y - - @property - def w(self): - """Get the w of this CreateCell. - - :return: The w of this CreateCell. - :rtype: int - """ # noqa: E501 - return self._w - - @w.setter - def w(self, w): - """Set the w of this CreateCell. - - :param w: The w of this CreateCell. - :type: int - """ # noqa: E501 - self._w = w - - @property - def h(self): - """Get the h of this CreateCell. - - :return: The h of this CreateCell. - :rtype: int - """ # noqa: E501 - return self._h - - @h.setter - def h(self, h): - """Set the h of this CreateCell. - - :param h: The h of this CreateCell. - :type: int - """ # noqa: E501 - self._h = h - - @property - def using_view(self): - """Get the using_view of this CreateCell. - - Makes a copy of the provided view. - - :return: The using_view of this CreateCell. - :rtype: str - """ # noqa: E501 - return self._using_view - - @using_view.setter - def using_view(self, using_view): - """Set the using_view of this CreateCell. - - Makes a copy of the provided view. - - :param using_view: The using_view of this CreateCell. - :type: str - """ # noqa: E501 - self._using_view = using_view - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, CreateCell): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/create_dashboard_request.py b/frogpilot/third_party/influxdb_client/domain/create_dashboard_request.py deleted file mode 100644 index e5de81ee..00000000 --- a/frogpilot/third_party/influxdb_client/domain/create_dashboard_request.py +++ /dev/null @@ -1,167 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class CreateDashboardRequest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'org_id': 'str', - 'name': 'str', - 'description': 'str' - } - - attribute_map = { - 'org_id': 'orgID', - 'name': 'name', - 'description': 'description' - } - - def __init__(self, org_id=None, name=None, description=None): # noqa: E501,D401,D403 - """CreateDashboardRequest - a model defined in OpenAPI.""" # noqa: E501 - self._org_id = None - self._name = None - self._description = None - self.discriminator = None - - self.org_id = org_id - self.name = name - if description is not None: - self.description = description - - @property - def org_id(self): - """Get the org_id of this CreateDashboardRequest. - - The ID of the organization that owns the dashboard. - - :return: The org_id of this CreateDashboardRequest. - :rtype: str - """ # noqa: E501 - return self._org_id - - @org_id.setter - def org_id(self, org_id): - """Set the org_id of this CreateDashboardRequest. - - The ID of the organization that owns the dashboard. - - :param org_id: The org_id of this CreateDashboardRequest. - :type: str - """ # noqa: E501 - if org_id is None: - raise ValueError("Invalid value for `org_id`, must not be `None`") # noqa: E501 - self._org_id = org_id - - @property - def name(self): - """Get the name of this CreateDashboardRequest. - - The user-facing name of the dashboard. - - :return: The name of this CreateDashboardRequest. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this CreateDashboardRequest. - - The user-facing name of the dashboard. - - :param name: The name of this CreateDashboardRequest. - :type: str - """ # noqa: E501 - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - self._name = name - - @property - def description(self): - """Get the description of this CreateDashboardRequest. - - The user-facing description of the dashboard. - - :return: The description of this CreateDashboardRequest. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this CreateDashboardRequest. - - The user-facing description of the dashboard. - - :param description: The description of this CreateDashboardRequest. - :type: str - """ # noqa: E501 - self._description = description - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, CreateDashboardRequest): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/custom_check.py b/frogpilot/third_party/influxdb_client/domain/custom_check.py deleted file mode 100644 index 88c0180d..00000000 --- a/frogpilot/third_party/influxdb_client/domain/custom_check.py +++ /dev/null @@ -1,142 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.check_discriminator import CheckDiscriminator - - -class CustomCheck(CheckDiscriminator): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'id': 'str', - 'name': 'str', - 'org_id': 'str', - 'task_id': 'str', - 'owner_id': 'str', - 'created_at': 'datetime', - 'updated_at': 'datetime', - 'query': 'DashboardQuery', - 'status': 'TaskStatusType', - 'description': 'str', - 'latest_completed': 'datetime', - 'last_run_status': 'str', - 'last_run_error': 'str', - 'labels': 'list[Label]', - 'links': 'CheckBaseLinks' - } - - attribute_map = { - 'type': 'type', - 'id': 'id', - 'name': 'name', - 'org_id': 'orgID', - 'task_id': 'taskID', - 'owner_id': 'ownerID', - 'created_at': 'createdAt', - 'updated_at': 'updatedAt', - 'query': 'query', - 'status': 'status', - 'description': 'description', - 'latest_completed': 'latestCompleted', - 'last_run_status': 'lastRunStatus', - 'last_run_error': 'lastRunError', - 'labels': 'labels', - 'links': 'links' - } - - def __init__(self, type="custom", id=None, name=None, org_id=None, task_id=None, owner_id=None, created_at=None, updated_at=None, query=None, status=None, description=None, latest_completed=None, last_run_status=None, last_run_error=None, labels=None, links=None): # noqa: E501,D401,D403 - """CustomCheck - a model defined in OpenAPI.""" # noqa: E501 - CheckDiscriminator.__init__(self, id=id, name=name, org_id=org_id, task_id=task_id, owner_id=owner_id, created_at=created_at, updated_at=updated_at, query=query, status=status, description=description, latest_completed=latest_completed, last_run_status=last_run_status, last_run_error=last_run_error, labels=labels, links=links) # noqa: E501 - - self._type = None - self.discriminator = None - - self.type = type - - @property - def type(self): - """Get the type of this CustomCheck. - - :return: The type of this CustomCheck. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this CustomCheck. - - :param type: The type of this CustomCheck. - :type: str - """ # noqa: E501 - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - self._type = type - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, CustomCheck): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/dashboard.py b/frogpilot/third_party/influxdb_client/domain/dashboard.py deleted file mode 100644 index 4b4e47e9..00000000 --- a/frogpilot/third_party/influxdb_client/domain/dashboard.py +++ /dev/null @@ -1,209 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.create_dashboard_request import CreateDashboardRequest - - -class Dashboard(CreateDashboardRequest): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'links': 'object', - 'id': 'str', - 'meta': 'object', - 'cells': 'list[Cell]', - 'labels': 'list[Label]', - 'org_id': 'str', - 'name': 'str', - 'description': 'str' - } - - attribute_map = { - 'links': 'links', - 'id': 'id', - 'meta': 'meta', - 'cells': 'cells', - 'labels': 'labels', - 'org_id': 'orgID', - 'name': 'name', - 'description': 'description' - } - - def __init__(self, links=None, id=None, meta=None, cells=None, labels=None, org_id=None, name=None, description=None): # noqa: E501,D401,D403 - """Dashboard - a model defined in OpenAPI.""" # noqa: E501 - CreateDashboardRequest.__init__(self, org_id=org_id, name=name, description=description) # noqa: E501 - - self._links = None - self._id = None - self._meta = None - self._cells = None - self._labels = None - self.discriminator = None - - if links is not None: - self.links = links - if id is not None: - self.id = id - if meta is not None: - self.meta = meta - if cells is not None: - self.cells = cells - if labels is not None: - self.labels = labels - - @property - def links(self): - """Get the links of this Dashboard. - - :return: The links of this Dashboard. - :rtype: object - """ # noqa: E501 - return self._links - - @links.setter - def links(self, links): - """Set the links of this Dashboard. - - :param links: The links of this Dashboard. - :type: object - """ # noqa: E501 - self._links = links - - @property - def id(self): - """Get the id of this Dashboard. - - :return: The id of this Dashboard. - :rtype: str - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this Dashboard. - - :param id: The id of this Dashboard. - :type: str - """ # noqa: E501 - self._id = id - - @property - def meta(self): - """Get the meta of this Dashboard. - - :return: The meta of this Dashboard. - :rtype: object - """ # noqa: E501 - return self._meta - - @meta.setter - def meta(self, meta): - """Set the meta of this Dashboard. - - :param meta: The meta of this Dashboard. - :type: object - """ # noqa: E501 - self._meta = meta - - @property - def cells(self): - """Get the cells of this Dashboard. - - :return: The cells of this Dashboard. - :rtype: list[Cell] - """ # noqa: E501 - return self._cells - - @cells.setter - def cells(self, cells): - """Set the cells of this Dashboard. - - :param cells: The cells of this Dashboard. - :type: list[Cell] - """ # noqa: E501 - self._cells = cells - - @property - def labels(self): - """Get the labels of this Dashboard. - - :return: The labels of this Dashboard. - :rtype: list[Label] - """ # noqa: E501 - return self._labels - - @labels.setter - def labels(self, labels): - """Set the labels of this Dashboard. - - :param labels: The labels of this Dashboard. - :type: list[Label] - """ # noqa: E501 - self._labels = labels - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Dashboard): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/dashboard_color.py b/frogpilot/third_party/influxdb_client/domain/dashboard_color.py deleted file mode 100644 index b03a4e2f..00000000 --- a/frogpilot/third_party/influxdb_client/domain/dashboard_color.py +++ /dev/null @@ -1,228 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class DashboardColor(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'str', - 'type': 'str', - 'hex': 'str', - 'name': 'str', - 'value': 'float' - } - - attribute_map = { - 'id': 'id', - 'type': 'type', - 'hex': 'hex', - 'name': 'name', - 'value': 'value' - } - - def __init__(self, id=None, type=None, hex=None, name=None, value=None): # noqa: E501,D401,D403 - """DashboardColor - a model defined in OpenAPI.""" # noqa: E501 - self._id = None - self._type = None - self._hex = None - self._name = None - self._value = None - self.discriminator = None - - self.id = id - self.type = type - self.hex = hex - self.name = name - self.value = value - - @property - def id(self): - """Get the id of this DashboardColor. - - The unique ID of the view color. - - :return: The id of this DashboardColor. - :rtype: str - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this DashboardColor. - - The unique ID of the view color. - - :param id: The id of this DashboardColor. - :type: str - """ # noqa: E501 - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 - self._id = id - - @property - def type(self): - """Get the type of this DashboardColor. - - Type is how the color is used. - - :return: The type of this DashboardColor. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this DashboardColor. - - Type is how the color is used. - - :param type: The type of this DashboardColor. - :type: str - """ # noqa: E501 - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - self._type = type - - @property - def hex(self): - """Get the hex of this DashboardColor. - - The hex number of the color - - :return: The hex of this DashboardColor. - :rtype: str - """ # noqa: E501 - return self._hex - - @hex.setter - def hex(self, hex): - """Set the hex of this DashboardColor. - - The hex number of the color - - :param hex: The hex of this DashboardColor. - :type: str - """ # noqa: E501 - if hex is None: - raise ValueError("Invalid value for `hex`, must not be `None`") # noqa: E501 - if hex is not None and len(hex) > 7: - raise ValueError("Invalid value for `hex`, length must be less than or equal to `7`") # noqa: E501 - if hex is not None and len(hex) < 7: - raise ValueError("Invalid value for `hex`, length must be greater than or equal to `7`") # noqa: E501 - self._hex = hex - - @property - def name(self): - """Get the name of this DashboardColor. - - The user-facing name of the hex color. - - :return: The name of this DashboardColor. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this DashboardColor. - - The user-facing name of the hex color. - - :param name: The name of this DashboardColor. - :type: str - """ # noqa: E501 - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - self._name = name - - @property - def value(self): - """Get the value of this DashboardColor. - - The data value mapped to this color. - - :return: The value of this DashboardColor. - :rtype: float - """ # noqa: E501 - return self._value - - @value.setter - def value(self, value): - """Set the value of this DashboardColor. - - The data value mapped to this color. - - :param value: The value of this DashboardColor. - :type: float - """ # noqa: E501 - if value is None: - raise ValueError("Invalid value for `value`, must not be `None`") # noqa: E501 - self._value = value - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, DashboardColor): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/dashboard_query.py b/frogpilot/third_party/influxdb_client/domain/dashboard_query.py deleted file mode 100644 index e23c61f7..00000000 --- a/frogpilot/third_party/influxdb_client/domain/dashboard_query.py +++ /dev/null @@ -1,180 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class DashboardQuery(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'text': 'str', - 'edit_mode': 'QueryEditMode', - 'name': 'str', - 'builder_config': 'BuilderConfig' - } - - attribute_map = { - 'text': 'text', - 'edit_mode': 'editMode', - 'name': 'name', - 'builder_config': 'builderConfig' - } - - def __init__(self, text=None, edit_mode=None, name=None, builder_config=None): # noqa: E501,D401,D403 - """DashboardQuery - a model defined in OpenAPI.""" # noqa: E501 - self._text = None - self._edit_mode = None - self._name = None - self._builder_config = None - self.discriminator = None - - if text is not None: - self.text = text - if edit_mode is not None: - self.edit_mode = edit_mode - if name is not None: - self.name = name - if builder_config is not None: - self.builder_config = builder_config - - @property - def text(self): - """Get the text of this DashboardQuery. - - The text of the Flux query. - - :return: The text of this DashboardQuery. - :rtype: str - """ # noqa: E501 - return self._text - - @text.setter - def text(self, text): - """Set the text of this DashboardQuery. - - The text of the Flux query. - - :param text: The text of this DashboardQuery. - :type: str - """ # noqa: E501 - self._text = text - - @property - def edit_mode(self): - """Get the edit_mode of this DashboardQuery. - - :return: The edit_mode of this DashboardQuery. - :rtype: QueryEditMode - """ # noqa: E501 - return self._edit_mode - - @edit_mode.setter - def edit_mode(self, edit_mode): - """Set the edit_mode of this DashboardQuery. - - :param edit_mode: The edit_mode of this DashboardQuery. - :type: QueryEditMode - """ # noqa: E501 - self._edit_mode = edit_mode - - @property - def name(self): - """Get the name of this DashboardQuery. - - :return: The name of this DashboardQuery. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this DashboardQuery. - - :param name: The name of this DashboardQuery. - :type: str - """ # noqa: E501 - self._name = name - - @property - def builder_config(self): - """Get the builder_config of this DashboardQuery. - - :return: The builder_config of this DashboardQuery. - :rtype: BuilderConfig - """ # noqa: E501 - return self._builder_config - - @builder_config.setter - def builder_config(self, builder_config): - """Set the builder_config of this DashboardQuery. - - :param builder_config: The builder_config of this DashboardQuery. - :type: BuilderConfig - """ # noqa: E501 - self._builder_config = builder_config - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, DashboardQuery): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/dashboard_with_view_properties.py b/frogpilot/third_party/influxdb_client/domain/dashboard_with_view_properties.py deleted file mode 100644 index 08a78d2c..00000000 --- a/frogpilot/third_party/influxdb_client/domain/dashboard_with_view_properties.py +++ /dev/null @@ -1,209 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.create_dashboard_request import CreateDashboardRequest - - -class DashboardWithViewProperties(CreateDashboardRequest): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'links': 'object', - 'id': 'str', - 'meta': 'object', - 'cells': 'list[CellWithViewProperties]', - 'labels': 'list[Label]', - 'org_id': 'str', - 'name': 'str', - 'description': 'str' - } - - attribute_map = { - 'links': 'links', - 'id': 'id', - 'meta': 'meta', - 'cells': 'cells', - 'labels': 'labels', - 'org_id': 'orgID', - 'name': 'name', - 'description': 'description' - } - - def __init__(self, links=None, id=None, meta=None, cells=None, labels=None, org_id=None, name=None, description=None): # noqa: E501,D401,D403 - """DashboardWithViewProperties - a model defined in OpenAPI.""" # noqa: E501 - CreateDashboardRequest.__init__(self, org_id=org_id, name=name, description=description) # noqa: E501 - - self._links = None - self._id = None - self._meta = None - self._cells = None - self._labels = None - self.discriminator = None - - if links is not None: - self.links = links - if id is not None: - self.id = id - if meta is not None: - self.meta = meta - if cells is not None: - self.cells = cells - if labels is not None: - self.labels = labels - - @property - def links(self): - """Get the links of this DashboardWithViewProperties. - - :return: The links of this DashboardWithViewProperties. - :rtype: object - """ # noqa: E501 - return self._links - - @links.setter - def links(self, links): - """Set the links of this DashboardWithViewProperties. - - :param links: The links of this DashboardWithViewProperties. - :type: object - """ # noqa: E501 - self._links = links - - @property - def id(self): - """Get the id of this DashboardWithViewProperties. - - :return: The id of this DashboardWithViewProperties. - :rtype: str - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this DashboardWithViewProperties. - - :param id: The id of this DashboardWithViewProperties. - :type: str - """ # noqa: E501 - self._id = id - - @property - def meta(self): - """Get the meta of this DashboardWithViewProperties. - - :return: The meta of this DashboardWithViewProperties. - :rtype: object - """ # noqa: E501 - return self._meta - - @meta.setter - def meta(self, meta): - """Set the meta of this DashboardWithViewProperties. - - :param meta: The meta of this DashboardWithViewProperties. - :type: object - """ # noqa: E501 - self._meta = meta - - @property - def cells(self): - """Get the cells of this DashboardWithViewProperties. - - :return: The cells of this DashboardWithViewProperties. - :rtype: list[CellWithViewProperties] - """ # noqa: E501 - return self._cells - - @cells.setter - def cells(self, cells): - """Set the cells of this DashboardWithViewProperties. - - :param cells: The cells of this DashboardWithViewProperties. - :type: list[CellWithViewProperties] - """ # noqa: E501 - self._cells = cells - - @property - def labels(self): - """Get the labels of this DashboardWithViewProperties. - - :return: The labels of this DashboardWithViewProperties. - :rtype: list[Label] - """ # noqa: E501 - return self._labels - - @labels.setter - def labels(self, labels): - """Set the labels of this DashboardWithViewProperties. - - :param labels: The labels of this DashboardWithViewProperties. - :type: list[Label] - """ # noqa: E501 - self._labels = labels - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, DashboardWithViewProperties): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/dashboards.py b/frogpilot/third_party/influxdb_client/domain/dashboards.py deleted file mode 100644 index e15de928..00000000 --- a/frogpilot/third_party/influxdb_client/domain/dashboards.py +++ /dev/null @@ -1,130 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class Dashboards(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'links': 'Links', - 'dashboards': 'list[Dashboard]' - } - - attribute_map = { - 'links': 'links', - 'dashboards': 'dashboards' - } - - def __init__(self, links=None, dashboards=None): # noqa: E501,D401,D403 - """Dashboards - a model defined in OpenAPI.""" # noqa: E501 - self._links = None - self._dashboards = None - self.discriminator = None - - if links is not None: - self.links = links - if dashboards is not None: - self.dashboards = dashboards - - @property - def links(self): - """Get the links of this Dashboards. - - :return: The links of this Dashboards. - :rtype: Links - """ # noqa: E501 - return self._links - - @links.setter - def links(self, links): - """Set the links of this Dashboards. - - :param links: The links of this Dashboards. - :type: Links - """ # noqa: E501 - self._links = links - - @property - def dashboards(self): - """Get the dashboards of this Dashboards. - - :return: The dashboards of this Dashboards. - :rtype: list[Dashboard] - """ # noqa: E501 - return self._dashboards - - @dashboards.setter - def dashboards(self, dashboards): - """Set the dashboards of this Dashboards. - - :param dashboards: The dashboards of this Dashboards. - :type: list[Dashboard] - """ # noqa: E501 - self._dashboards = dashboards - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Dashboards): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/date_time_literal.py b/frogpilot/third_party/influxdb_client/domain/date_time_literal.py deleted file mode 100644 index ce2280f3..00000000 --- a/frogpilot/third_party/influxdb_client/domain/date_time_literal.py +++ /dev/null @@ -1,138 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.expression import Expression - - -class DateTimeLiteral(Expression): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'value': 'datetime' - } - - attribute_map = { - 'type': 'type', - 'value': 'value' - } - - def __init__(self, type=None, value=None): # noqa: E501,D401,D403 - """DateTimeLiteral - a model defined in OpenAPI.""" # noqa: E501 - Expression.__init__(self) # noqa: E501 - - self._type = None - self._value = None - self.discriminator = None - - if type is not None: - self.type = type - if value is not None: - self.value = value - - @property - def type(self): - """Get the type of this DateTimeLiteral. - - Type of AST node - - :return: The type of this DateTimeLiteral. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this DateTimeLiteral. - - Type of AST node - - :param type: The type of this DateTimeLiteral. - :type: str - """ # noqa: E501 - self._type = type - - @property - def value(self): - """Get the value of this DateTimeLiteral. - - :return: The value of this DateTimeLiteral. - :rtype: datetime - """ # noqa: E501 - return self._value - - @value.setter - def value(self, value): - """Set the value of this DateTimeLiteral. - - :param value: The value of this DateTimeLiteral. - :type: datetime - """ # noqa: E501 - self._value = value - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, DateTimeLiteral): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/dbr_ps.py b/frogpilot/third_party/influxdb_client/domain/dbr_ps.py deleted file mode 100644 index 27617a99..00000000 --- a/frogpilot/third_party/influxdb_client/domain/dbr_ps.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class DBRPs(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'content': 'list[DBRP]' - } - - attribute_map = { - 'content': 'content' - } - - def __init__(self, content=None): # noqa: E501,D401,D403 - """DBRPs - a model defined in OpenAPI.""" # noqa: E501 - self._content = None - self.discriminator = None - - if content is not None: - self.content = content - - @property - def content(self): - """Get the content of this DBRPs. - - :return: The content of this DBRPs. - :rtype: list[DBRP] - """ # noqa: E501 - return self._content - - @content.setter - def content(self, content): - """Set the content of this DBRPs. - - :param content: The content of this DBRPs. - :type: list[DBRP] - """ # noqa: E501 - self._content = content - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, DBRPs): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/dbrp.py b/frogpilot/third_party/influxdb_client/domain/dbrp.py deleted file mode 100644 index 1bb74ecf..00000000 --- a/frogpilot/third_party/influxdb_client/domain/dbrp.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class DBRP(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'str', - 'org_id': 'str', - 'bucket_id': 'str', - 'database': 'str', - 'retention_policy': 'str', - 'default': 'bool', - 'virtual': 'bool', - 'links': 'Links' - } - - attribute_map = { - 'id': 'id', - 'org_id': 'orgID', - 'bucket_id': 'bucketID', - 'database': 'database', - 'retention_policy': 'retention_policy', - 'default': 'default', - 'virtual': 'virtual', - 'links': 'links' - } - - def __init__(self, id=None, org_id=None, bucket_id=None, database=None, retention_policy=None, default=None, virtual=None, links=None): # noqa: E501,D401,D403 - """DBRP - a model defined in OpenAPI.""" # noqa: E501 - self._id = None - self._org_id = None - self._bucket_id = None - self._database = None - self._retention_policy = None - self._default = None - self._virtual = None - self._links = None - self.discriminator = None - - self.id = id - self.org_id = org_id - self.bucket_id = bucket_id - self.database = database - self.retention_policy = retention_policy - self.default = default - if virtual is not None: - self.virtual = virtual - if links is not None: - self.links = links - - @property - def id(self): - """Get the id of this DBRP. - - The resource ID that InfluxDB uses to uniquely identify the database retention policy (DBRP) mapping. - - :return: The id of this DBRP. - :rtype: str - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this DBRP. - - The resource ID that InfluxDB uses to uniquely identify the database retention policy (DBRP) mapping. - - :param id: The id of this DBRP. - :type: str - """ # noqa: E501 - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 - self._id = id - - @property - def org_id(self): - """Get the org_id of this DBRP. - - An organization ID. Identifies the [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization) that owns the mapping. - - :return: The org_id of this DBRP. - :rtype: str - """ # noqa: E501 - return self._org_id - - @org_id.setter - def org_id(self, org_id): - """Set the org_id of this DBRP. - - An organization ID. Identifies the [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization) that owns the mapping. - - :param org_id: The org_id of this DBRP. - :type: str - """ # noqa: E501 - if org_id is None: - raise ValueError("Invalid value for `org_id`, must not be `None`") # noqa: E501 - self._org_id = org_id - - @property - def bucket_id(self): - """Get the bucket_id of this DBRP. - - A bucket ID. Identifies the bucket used as the target for the translation. - - :return: The bucket_id of this DBRP. - :rtype: str - """ # noqa: E501 - return self._bucket_id - - @bucket_id.setter - def bucket_id(self, bucket_id): - """Set the bucket_id of this DBRP. - - A bucket ID. Identifies the bucket used as the target for the translation. - - :param bucket_id: The bucket_id of this DBRP. - :type: str - """ # noqa: E501 - if bucket_id is None: - raise ValueError("Invalid value for `bucket_id`, must not be `None`") # noqa: E501 - self._bucket_id = bucket_id - - @property - def database(self): - """Get the database of this DBRP. - - A database name. Identifies the InfluxDB v1 database. - - :return: The database of this DBRP. - :rtype: str - """ # noqa: E501 - return self._database - - @database.setter - def database(self, database): - """Set the database of this DBRP. - - A database name. Identifies the InfluxDB v1 database. - - :param database: The database of this DBRP. - :type: str - """ # noqa: E501 - if database is None: - raise ValueError("Invalid value for `database`, must not be `None`") # noqa: E501 - self._database = database - - @property - def retention_policy(self): - """Get the retention_policy of this DBRP. - - A [retention policy](https://docs.influxdata.com/influxdb/v1.8/concepts/glossary/#retention-policy-rp) name. Identifies the InfluxDB v1 retention policy mapping. - - :return: The retention_policy of this DBRP. - :rtype: str - """ # noqa: E501 - return self._retention_policy - - @retention_policy.setter - def retention_policy(self, retention_policy): - """Set the retention_policy of this DBRP. - - A [retention policy](https://docs.influxdata.com/influxdb/v1.8/concepts/glossary/#retention-policy-rp) name. Identifies the InfluxDB v1 retention policy mapping. - - :param retention_policy: The retention_policy of this DBRP. - :type: str - """ # noqa: E501 - if retention_policy is None: - raise ValueError("Invalid value for `retention_policy`, must not be `None`") # noqa: E501 - self._retention_policy = retention_policy - - @property - def default(self): - """Get the default of this DBRP. - - If set to `true`, this DBRP mapping is the default retention policy for the database (specified by the `database` property's value). - - :return: The default of this DBRP. - :rtype: bool - """ # noqa: E501 - return self._default - - @default.setter - def default(self, default): - """Set the default of this DBRP. - - If set to `true`, this DBRP mapping is the default retention policy for the database (specified by the `database` property's value). - - :param default: The default of this DBRP. - :type: bool - """ # noqa: E501 - if default is None: - raise ValueError("Invalid value for `default`, must not be `None`") # noqa: E501 - self._default = default - - @property - def virtual(self): - """Get the virtual of this DBRP. - - Indicates an autogenerated, virtual mapping based on the bucket name. Currently only available in OSS. - - :return: The virtual of this DBRP. - :rtype: bool - """ # noqa: E501 - return self._virtual - - @virtual.setter - def virtual(self, virtual): - """Set the virtual of this DBRP. - - Indicates an autogenerated, virtual mapping based on the bucket name. Currently only available in OSS. - - :param virtual: The virtual of this DBRP. - :type: bool - """ # noqa: E501 - self._virtual = virtual - - @property - def links(self): - """Get the links of this DBRP. - - :return: The links of this DBRP. - :rtype: Links - """ # noqa: E501 - return self._links - - @links.setter - def links(self, links): - """Set the links of this DBRP. - - :param links: The links of this DBRP. - :type: Links - """ # noqa: E501 - self._links = links - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, DBRP): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/dbrp_create.py b/frogpilot/third_party/influxdb_client/domain/dbrp_create.py deleted file mode 100644 index e69183ff..00000000 --- a/frogpilot/third_party/influxdb_client/domain/dbrp_create.py +++ /dev/null @@ -1,249 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class DBRPCreate(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'org': 'str', - 'org_id': 'str', - 'bucket_id': 'str', - 'database': 'str', - 'retention_policy': 'str', - 'default': 'bool' - } - - attribute_map = { - 'org': 'org', - 'org_id': 'orgID', - 'bucket_id': 'bucketID', - 'database': 'database', - 'retention_policy': 'retention_policy', - 'default': 'default' - } - - def __init__(self, org=None, org_id=None, bucket_id=None, database=None, retention_policy=None, default=None): # noqa: E501,D401,D403 - """DBRPCreate - a model defined in OpenAPI.""" # noqa: E501 - self._org = None - self._org_id = None - self._bucket_id = None - self._database = None - self._retention_policy = None - self._default = None - self.discriminator = None - - if org is not None: - self.org = org - if org_id is not None: - self.org_id = org_id - self.bucket_id = bucket_id - self.database = database - self.retention_policy = retention_policy - if default is not None: - self.default = default - - @property - def org(self): - """Get the org of this DBRPCreate. - - An organization name. Identifies the [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization) that owns the mapping. - - :return: The org of this DBRPCreate. - :rtype: str - """ # noqa: E501 - return self._org - - @org.setter - def org(self, org): - """Set the org of this DBRPCreate. - - An organization name. Identifies the [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization) that owns the mapping. - - :param org: The org of this DBRPCreate. - :type: str - """ # noqa: E501 - self._org = org - - @property - def org_id(self): - """Get the org_id of this DBRPCreate. - - An organization ID. Identifies the [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization) that owns the mapping. - - :return: The org_id of this DBRPCreate. - :rtype: str - """ # noqa: E501 - return self._org_id - - @org_id.setter - def org_id(self, org_id): - """Set the org_id of this DBRPCreate. - - An organization ID. Identifies the [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization) that owns the mapping. - - :param org_id: The org_id of this DBRPCreate. - :type: str - """ # noqa: E501 - self._org_id = org_id - - @property - def bucket_id(self): - """Get the bucket_id of this DBRPCreate. - - A bucket ID. Identifies the bucket used as the target for the translation. - - :return: The bucket_id of this DBRPCreate. - :rtype: str - """ # noqa: E501 - return self._bucket_id - - @bucket_id.setter - def bucket_id(self, bucket_id): - """Set the bucket_id of this DBRPCreate. - - A bucket ID. Identifies the bucket used as the target for the translation. - - :param bucket_id: The bucket_id of this DBRPCreate. - :type: str - """ # noqa: E501 - if bucket_id is None: - raise ValueError("Invalid value for `bucket_id`, must not be `None`") # noqa: E501 - self._bucket_id = bucket_id - - @property - def database(self): - """Get the database of this DBRPCreate. - - A database name. Identifies the InfluxDB v1 database. - - :return: The database of this DBRPCreate. - :rtype: str - """ # noqa: E501 - return self._database - - @database.setter - def database(self, database): - """Set the database of this DBRPCreate. - - A database name. Identifies the InfluxDB v1 database. - - :param database: The database of this DBRPCreate. - :type: str - """ # noqa: E501 - if database is None: - raise ValueError("Invalid value for `database`, must not be `None`") # noqa: E501 - self._database = database - - @property - def retention_policy(self): - """Get the retention_policy of this DBRPCreate. - - A [retention policy](https://docs.influxdata.com/influxdb/v1.8/concepts/glossary/#retention-policy-rp) name. Identifies the InfluxDB v1 retention policy mapping. - - :return: The retention_policy of this DBRPCreate. - :rtype: str - """ # noqa: E501 - return self._retention_policy - - @retention_policy.setter - def retention_policy(self, retention_policy): - """Set the retention_policy of this DBRPCreate. - - A [retention policy](https://docs.influxdata.com/influxdb/v1.8/concepts/glossary/#retention-policy-rp) name. Identifies the InfluxDB v1 retention policy mapping. - - :param retention_policy: The retention_policy of this DBRPCreate. - :type: str - """ # noqa: E501 - if retention_policy is None: - raise ValueError("Invalid value for `retention_policy`, must not be `None`") # noqa: E501 - self._retention_policy = retention_policy - - @property - def default(self): - """Get the default of this DBRPCreate. - - Set to `true` to use this DBRP mapping as the default retention policy for the database (specified by the `database` property's value). - - :return: The default of this DBRPCreate. - :rtype: bool - """ # noqa: E501 - return self._default - - @default.setter - def default(self, default): - """Set the default of this DBRPCreate. - - Set to `true` to use this DBRP mapping as the default retention policy for the database (specified by the `database` property's value). - - :param default: The default of this DBRPCreate. - :type: bool - """ # noqa: E501 - self._default = default - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, DBRPCreate): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/dbrp_get.py b/frogpilot/third_party/influxdb_client/domain/dbrp_get.py deleted file mode 100644 index 375f0a55..00000000 --- a/frogpilot/third_party/influxdb_client/domain/dbrp_get.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class DBRPGet(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'content': 'DBRP' - } - - attribute_map = { - 'content': 'content' - } - - def __init__(self, content=None): # noqa: E501,D401,D403 - """DBRPGet - a model defined in OpenAPI.""" # noqa: E501 - self._content = None - self.discriminator = None - - if content is not None: - self.content = content - - @property - def content(self): - """Get the content of this DBRPGet. - - :return: The content of this DBRPGet. - :rtype: DBRP - """ # noqa: E501 - return self._content - - @content.setter - def content(self, content): - """Set the content of this DBRPGet. - - :param content: The content of this DBRPGet. - :type: DBRP - """ # noqa: E501 - self._content = content - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, DBRPGet): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/dbrp_update.py b/frogpilot/third_party/influxdb_client/domain/dbrp_update.py deleted file mode 100644 index 4b0c5bae..00000000 --- a/frogpilot/third_party/influxdb_client/domain/dbrp_update.py +++ /dev/null @@ -1,138 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class DBRPUpdate(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'retention_policy': 'str', - 'default': 'bool' - } - - attribute_map = { - 'retention_policy': 'retention_policy', - 'default': 'default' - } - - def __init__(self, retention_policy=None, default=None): # noqa: E501,D401,D403 - """DBRPUpdate - a model defined in OpenAPI.""" # noqa: E501 - self._retention_policy = None - self._default = None - self.discriminator = None - - if retention_policy is not None: - self.retention_policy = retention_policy - if default is not None: - self.default = default - - @property - def retention_policy(self): - """Get the retention_policy of this DBRPUpdate. - - A [retention policy](https://docs.influxdata.com/influxdb/v1.8/concepts/glossary/#retention-policy-rp) name. Identifies the InfluxDB v1 retention policy mapping. - - :return: The retention_policy of this DBRPUpdate. - :rtype: str - """ # noqa: E501 - return self._retention_policy - - @retention_policy.setter - def retention_policy(self, retention_policy): - """Set the retention_policy of this DBRPUpdate. - - A [retention policy](https://docs.influxdata.com/influxdb/v1.8/concepts/glossary/#retention-policy-rp) name. Identifies the InfluxDB v1 retention policy mapping. - - :param retention_policy: The retention_policy of this DBRPUpdate. - :type: str - """ # noqa: E501 - self._retention_policy = retention_policy - - @property - def default(self): - """Get the default of this DBRPUpdate. - - Set to `true` to use this DBRP mapping as the default retention policy for the database (specified by the `database` property's value). To remove the default mapping, set to `false`. - - :return: The default of this DBRPUpdate. - :rtype: bool - """ # noqa: E501 - return self._default - - @default.setter - def default(self, default): - """Set the default of this DBRPUpdate. - - Set to `true` to use this DBRP mapping as the default retention policy for the database (specified by the `database` property's value). To remove the default mapping, set to `false`. - - :param default: The default of this DBRPUpdate. - :type: bool - """ # noqa: E501 - self._default = default - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, DBRPUpdate): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/deadman_check.py b/frogpilot/third_party/influxdb_client/domain/deadman_check.py deleted file mode 100644 index 81e368fa..00000000 --- a/frogpilot/third_party/influxdb_client/domain/deadman_check.py +++ /dev/null @@ -1,354 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.check_discriminator import CheckDiscriminator - - -class DeadmanCheck(CheckDiscriminator): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'time_since': 'str', - 'stale_time': 'str', - 'report_zero': 'bool', - 'level': 'CheckStatusLevel', - 'every': 'str', - 'offset': 'str', - 'tags': 'list[object]', - 'status_message_template': 'str', - 'id': 'str', - 'name': 'str', - 'org_id': 'str', - 'task_id': 'str', - 'owner_id': 'str', - 'created_at': 'datetime', - 'updated_at': 'datetime', - 'query': 'DashboardQuery', - 'status': 'TaskStatusType', - 'description': 'str', - 'latest_completed': 'datetime', - 'last_run_status': 'str', - 'last_run_error': 'str', - 'labels': 'list[Label]', - 'links': 'CheckBaseLinks' - } - - attribute_map = { - 'type': 'type', - 'time_since': 'timeSince', - 'stale_time': 'staleTime', - 'report_zero': 'reportZero', - 'level': 'level', - 'every': 'every', - 'offset': 'offset', - 'tags': 'tags', - 'status_message_template': 'statusMessageTemplate', - 'id': 'id', - 'name': 'name', - 'org_id': 'orgID', - 'task_id': 'taskID', - 'owner_id': 'ownerID', - 'created_at': 'createdAt', - 'updated_at': 'updatedAt', - 'query': 'query', - 'status': 'status', - 'description': 'description', - 'latest_completed': 'latestCompleted', - 'last_run_status': 'lastRunStatus', - 'last_run_error': 'lastRunError', - 'labels': 'labels', - 'links': 'links' - } - - def __init__(self, type="deadman", time_since=None, stale_time=None, report_zero=None, level=None, every=None, offset=None, tags=None, status_message_template=None, id=None, name=None, org_id=None, task_id=None, owner_id=None, created_at=None, updated_at=None, query=None, status=None, description=None, latest_completed=None, last_run_status=None, last_run_error=None, labels=None, links=None): # noqa: E501,D401,D403 - """DeadmanCheck - a model defined in OpenAPI.""" # noqa: E501 - CheckDiscriminator.__init__(self, id=id, name=name, org_id=org_id, task_id=task_id, owner_id=owner_id, created_at=created_at, updated_at=updated_at, query=query, status=status, description=description, latest_completed=latest_completed, last_run_status=last_run_status, last_run_error=last_run_error, labels=labels, links=links) # noqa: E501 - - self._type = None - self._time_since = None - self._stale_time = None - self._report_zero = None - self._level = None - self._every = None - self._offset = None - self._tags = None - self._status_message_template = None - self.discriminator = None - - self.type = type - if time_since is not None: - self.time_since = time_since - if stale_time is not None: - self.stale_time = stale_time - if report_zero is not None: - self.report_zero = report_zero - if level is not None: - self.level = level - if every is not None: - self.every = every - if offset is not None: - self.offset = offset - if tags is not None: - self.tags = tags - if status_message_template is not None: - self.status_message_template = status_message_template - - @property - def type(self): - """Get the type of this DeadmanCheck. - - :return: The type of this DeadmanCheck. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this DeadmanCheck. - - :param type: The type of this DeadmanCheck. - :type: str - """ # noqa: E501 - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - self._type = type - - @property - def time_since(self): - """Get the time_since of this DeadmanCheck. - - String duration before deadman triggers. - - :return: The time_since of this DeadmanCheck. - :rtype: str - """ # noqa: E501 - return self._time_since - - @time_since.setter - def time_since(self, time_since): - """Set the time_since of this DeadmanCheck. - - String duration before deadman triggers. - - :param time_since: The time_since of this DeadmanCheck. - :type: str - """ # noqa: E501 - self._time_since = time_since - - @property - def stale_time(self): - """Get the stale_time of this DeadmanCheck. - - String duration for time that a series is considered stale and should not trigger deadman. - - :return: The stale_time of this DeadmanCheck. - :rtype: str - """ # noqa: E501 - return self._stale_time - - @stale_time.setter - def stale_time(self, stale_time): - """Set the stale_time of this DeadmanCheck. - - String duration for time that a series is considered stale and should not trigger deadman. - - :param stale_time: The stale_time of this DeadmanCheck. - :type: str - """ # noqa: E501 - self._stale_time = stale_time - - @property - def report_zero(self): - """Get the report_zero of this DeadmanCheck. - - If only zero values reported since time, trigger an alert - - :return: The report_zero of this DeadmanCheck. - :rtype: bool - """ # noqa: E501 - return self._report_zero - - @report_zero.setter - def report_zero(self, report_zero): - """Set the report_zero of this DeadmanCheck. - - If only zero values reported since time, trigger an alert - - :param report_zero: The report_zero of this DeadmanCheck. - :type: bool - """ # noqa: E501 - self._report_zero = report_zero - - @property - def level(self): - """Get the level of this DeadmanCheck. - - :return: The level of this DeadmanCheck. - :rtype: CheckStatusLevel - """ # noqa: E501 - return self._level - - @level.setter - def level(self, level): - """Set the level of this DeadmanCheck. - - :param level: The level of this DeadmanCheck. - :type: CheckStatusLevel - """ # noqa: E501 - self._level = level - - @property - def every(self): - """Get the every of this DeadmanCheck. - - Check repetition interval. - - :return: The every of this DeadmanCheck. - :rtype: str - """ # noqa: E501 - return self._every - - @every.setter - def every(self, every): - """Set the every of this DeadmanCheck. - - Check repetition interval. - - :param every: The every of this DeadmanCheck. - :type: str - """ # noqa: E501 - self._every = every - - @property - def offset(self): - """Get the offset of this DeadmanCheck. - - Duration to delay after the schedule, before executing check. - - :return: The offset of this DeadmanCheck. - :rtype: str - """ # noqa: E501 - return self._offset - - @offset.setter - def offset(self, offset): - """Set the offset of this DeadmanCheck. - - Duration to delay after the schedule, before executing check. - - :param offset: The offset of this DeadmanCheck. - :type: str - """ # noqa: E501 - self._offset = offset - - @property - def tags(self): - """Get the tags of this DeadmanCheck. - - List of tags to write to each status. - - :return: The tags of this DeadmanCheck. - :rtype: list[object] - """ # noqa: E501 - return self._tags - - @tags.setter - def tags(self, tags): - """Set the tags of this DeadmanCheck. - - List of tags to write to each status. - - :param tags: The tags of this DeadmanCheck. - :type: list[object] - """ # noqa: E501 - self._tags = tags - - @property - def status_message_template(self): - """Get the status_message_template of this DeadmanCheck. - - The template used to generate and write a status message. - - :return: The status_message_template of this DeadmanCheck. - :rtype: str - """ # noqa: E501 - return self._status_message_template - - @status_message_template.setter - def status_message_template(self, status_message_template): - """Set the status_message_template of this DeadmanCheck. - - The template used to generate and write a status message. - - :param status_message_template: The status_message_template of this DeadmanCheck. - :type: str - """ # noqa: E501 - self._status_message_template = status_message_template - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, DeadmanCheck): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/decimal_places.py b/frogpilot/third_party/influxdb_client/domain/decimal_places.py deleted file mode 100644 index 7a855a6d..00000000 --- a/frogpilot/third_party/influxdb_client/domain/decimal_places.py +++ /dev/null @@ -1,138 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class DecimalPlaces(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'is_enforced': 'bool', - 'digits': 'int' - } - - attribute_map = { - 'is_enforced': 'isEnforced', - 'digits': 'digits' - } - - def __init__(self, is_enforced=None, digits=None): # noqa: E501,D401,D403 - """DecimalPlaces - a model defined in OpenAPI.""" # noqa: E501 - self._is_enforced = None - self._digits = None - self.discriminator = None - - if is_enforced is not None: - self.is_enforced = is_enforced - if digits is not None: - self.digits = digits - - @property - def is_enforced(self): - """Get the is_enforced of this DecimalPlaces. - - Indicates whether decimal point setting should be enforced - - :return: The is_enforced of this DecimalPlaces. - :rtype: bool - """ # noqa: E501 - return self._is_enforced - - @is_enforced.setter - def is_enforced(self, is_enforced): - """Set the is_enforced of this DecimalPlaces. - - Indicates whether decimal point setting should be enforced - - :param is_enforced: The is_enforced of this DecimalPlaces. - :type: bool - """ # noqa: E501 - self._is_enforced = is_enforced - - @property - def digits(self): - """Get the digits of this DecimalPlaces. - - The number of digits after decimal to display - - :return: The digits of this DecimalPlaces. - :rtype: int - """ # noqa: E501 - return self._digits - - @digits.setter - def digits(self, digits): - """Set the digits of this DecimalPlaces. - - The number of digits after decimal to display - - :param digits: The digits of this DecimalPlaces. - :type: int - """ # noqa: E501 - self._digits = digits - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, DecimalPlaces): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/delete_predicate_request.py b/frogpilot/third_party/influxdb_client/domain/delete_predicate_request.py deleted file mode 100644 index 13202910..00000000 --- a/frogpilot/third_party/influxdb_client/domain/delete_predicate_request.py +++ /dev/null @@ -1,167 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class DeletePredicateRequest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'start': 'datetime', - 'stop': 'datetime', - 'predicate': 'str' - } - - attribute_map = { - 'start': 'start', - 'stop': 'stop', - 'predicate': 'predicate' - } - - def __init__(self, start=None, stop=None, predicate=None): # noqa: E501,D401,D403 - """DeletePredicateRequest - a model defined in OpenAPI.""" # noqa: E501 - self._start = None - self._stop = None - self._predicate = None - self.discriminator = None - - self.start = start - self.stop = stop - if predicate is not None: - self.predicate = predicate - - @property - def start(self): - """Get the start of this DeletePredicateRequest. - - A timestamp ([RFC3339 date/time format](https://docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339-timestamp)). The earliest time to delete from. - - :return: The start of this DeletePredicateRequest. - :rtype: datetime - """ # noqa: E501 - return self._start - - @start.setter - def start(self, start): - """Set the start of this DeletePredicateRequest. - - A timestamp ([RFC3339 date/time format](https://docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339-timestamp)). The earliest time to delete from. - - :param start: The start of this DeletePredicateRequest. - :type: datetime - """ # noqa: E501 - if start is None: - raise ValueError("Invalid value for `start`, must not be `None`") # noqa: E501 - self._start = start - - @property - def stop(self): - """Get the stop of this DeletePredicateRequest. - - A timestamp ([RFC3339 date/time format](https://docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339-timestamp)). The latest time to delete from. - - :return: The stop of this DeletePredicateRequest. - :rtype: datetime - """ # noqa: E501 - return self._stop - - @stop.setter - def stop(self, stop): - """Set the stop of this DeletePredicateRequest. - - A timestamp ([RFC3339 date/time format](https://docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339-timestamp)). The latest time to delete from. - - :param stop: The stop of this DeletePredicateRequest. - :type: datetime - """ # noqa: E501 - if stop is None: - raise ValueError("Invalid value for `stop`, must not be `None`") # noqa: E501 - self._stop = stop - - @property - def predicate(self): - """Get the predicate of this DeletePredicateRequest. - - An expression in [delete predicate syntax](https://docs.influxdata.com/influxdb/latest/reference/syntax/delete-predicate/). - - :return: The predicate of this DeletePredicateRequest. - :rtype: str - """ # noqa: E501 - return self._predicate - - @predicate.setter - def predicate(self, predicate): - """Set the predicate of this DeletePredicateRequest. - - An expression in [delete predicate syntax](https://docs.influxdata.com/influxdb/latest/reference/syntax/delete-predicate/). - - :param predicate: The predicate of this DeletePredicateRequest. - :type: str - """ # noqa: E501 - self._predicate = predicate - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, DeletePredicateRequest): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/dialect.py b/frogpilot/third_party/influxdb_client/domain/dialect.py deleted file mode 100644 index 18bc7532..00000000 --- a/frogpilot/third_party/influxdb_client/domain/dialect.py +++ /dev/null @@ -1,234 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class Dialect(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'header': 'bool', - 'delimiter': 'str', - 'annotations': 'list[str]', - 'comment_prefix': 'str', - 'date_time_format': 'str' - } - - attribute_map = { - 'header': 'header', - 'delimiter': 'delimiter', - 'annotations': 'annotations', - 'comment_prefix': 'commentPrefix', - 'date_time_format': 'dateTimeFormat' - } - - def __init__(self, header=True, delimiter=',', annotations=None, comment_prefix='#', date_time_format='RFC3339'): # noqa: E501,D401,D403 - """Dialect - a model defined in OpenAPI.""" # noqa: E501 - self._header = None - self._delimiter = None - self._annotations = None - self._comment_prefix = None - self._date_time_format = None - self.discriminator = None - - if header is not None: - self.header = header - if delimiter is not None: - self.delimiter = delimiter - if annotations is not None: - self.annotations = annotations - if comment_prefix is not None: - self.comment_prefix = comment_prefix - if date_time_format is not None: - self.date_time_format = date_time_format - - @property - def header(self): - """Get the header of this Dialect. - - If true, the results contain a header row. - - :return: The header of this Dialect. - :rtype: bool - """ # noqa: E501 - return self._header - - @header.setter - def header(self, header): - """Set the header of this Dialect. - - If true, the results contain a header row. - - :param header: The header of this Dialect. - :type: bool - """ # noqa: E501 - self._header = header - - @property - def delimiter(self): - """Get the delimiter of this Dialect. - - The separator used between cells. Default is a comma (`,`). - - :return: The delimiter of this Dialect. - :rtype: str - """ # noqa: E501 - return self._delimiter - - @delimiter.setter - def delimiter(self, delimiter): - """Set the delimiter of this Dialect. - - The separator used between cells. Default is a comma (`,`). - - :param delimiter: The delimiter of this Dialect. - :type: str - """ # noqa: E501 - if delimiter is not None and len(delimiter) > 1: - raise ValueError("Invalid value for `delimiter`, length must be less than or equal to `1`") # noqa: E501 - if delimiter is not None and len(delimiter) < 1: - raise ValueError("Invalid value for `delimiter`, length must be greater than or equal to `1`") # noqa: E501 - self._delimiter = delimiter - - @property - def annotations(self): - """Get the annotations of this Dialect. - - Annotation rows to include in the results. An _annotation_ is metadata associated with an object (column) in the data model. #### Related guides - See [Annotated CSV annotations](https://docs.influxdata.com/influxdb/latest/reference/syntax/annotated-csv/#annotations) for examples and more information. For more information about **annotations** in tabular data, see [W3 metadata vocabulary for tabular data](https://www.w3.org/TR/2015/REC-tabular-data-model-20151217/#columns). - - :return: The annotations of this Dialect. - :rtype: list[str] - """ # noqa: E501 - return self._annotations - - @annotations.setter - def annotations(self, annotations): - """Set the annotations of this Dialect. - - Annotation rows to include in the results. An _annotation_ is metadata associated with an object (column) in the data model. #### Related guides - See [Annotated CSV annotations](https://docs.influxdata.com/influxdb/latest/reference/syntax/annotated-csv/#annotations) for examples and more information. For more information about **annotations** in tabular data, see [W3 metadata vocabulary for tabular data](https://www.w3.org/TR/2015/REC-tabular-data-model-20151217/#columns). - - :param annotations: The annotations of this Dialect. - :type: list[str] - """ # noqa: E501 - allowed_values = ["group", "datatype", "default"] # noqa: E501 - if not set(annotations).issubset(set(allowed_values)): - raise ValueError( - "Invalid values for `annotations` [{0}], must be a subset of [{1}]" # noqa: E501 - .format(", ".join(map(str, set(annotations) - set(allowed_values))), # noqa: E501 - ", ".join(map(str, allowed_values))) - ) - self._annotations = annotations - - @property - def comment_prefix(self): - """Get the comment_prefix of this Dialect. - - The character prefixed to comment strings. Default is a number sign (`#`). - - :return: The comment_prefix of this Dialect. - :rtype: str - """ # noqa: E501 - return self._comment_prefix - - @comment_prefix.setter - def comment_prefix(self, comment_prefix): - """Set the comment_prefix of this Dialect. - - The character prefixed to comment strings. Default is a number sign (`#`). - - :param comment_prefix: The comment_prefix of this Dialect. - :type: str - """ # noqa: E501 - if comment_prefix is not None and len(comment_prefix) > 1: - raise ValueError("Invalid value for `comment_prefix`, length must be less than or equal to `1`") # noqa: E501 - if comment_prefix is not None and len(comment_prefix) < 0: - raise ValueError("Invalid value for `comment_prefix`, length must be greater than or equal to `0`") # noqa: E501 - self._comment_prefix = comment_prefix - - @property - def date_time_format(self): - """Get the date_time_format of this Dialect. - - The format for timestamps in results. Default is [`RFC3339` date/time format](https://docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339-timestamp). To include nanoseconds in timestamps, use `RFC3339Nano`. #### Example formatted date/time values | Format | Value | |:------------|:----------------------------| | `RFC3339` | `"2006-01-02T15:04:05Z07:00"` | | `RFC3339Nano` | `"2006-01-02T15:04:05.999999999Z07:00"` | - - :return: The date_time_format of this Dialect. - :rtype: str - """ # noqa: E501 - return self._date_time_format - - @date_time_format.setter - def date_time_format(self, date_time_format): - """Set the date_time_format of this Dialect. - - The format for timestamps in results. Default is [`RFC3339` date/time format](https://docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339-timestamp). To include nanoseconds in timestamps, use `RFC3339Nano`. #### Example formatted date/time values | Format | Value | |:------------|:----------------------------| | `RFC3339` | `"2006-01-02T15:04:05Z07:00"` | | `RFC3339Nano` | `"2006-01-02T15:04:05.999999999Z07:00"` | - - :param date_time_format: The date_time_format of this Dialect. - :type: str - """ # noqa: E501 - self._date_time_format = date_time_format - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Dialect): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/dict_expression.py b/frogpilot/third_party/influxdb_client/domain/dict_expression.py deleted file mode 100644 index f6c0242c..00000000 --- a/frogpilot/third_party/influxdb_client/domain/dict_expression.py +++ /dev/null @@ -1,142 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.expression import Expression - - -class DictExpression(Expression): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'elements': 'list[DictItem]' - } - - attribute_map = { - 'type': 'type', - 'elements': 'elements' - } - - def __init__(self, type=None, elements=None): # noqa: E501,D401,D403 - """DictExpression - a model defined in OpenAPI.""" # noqa: E501 - Expression.__init__(self) # noqa: E501 - - self._type = None - self._elements = None - self.discriminator = None - - if type is not None: - self.type = type - if elements is not None: - self.elements = elements - - @property - def type(self): - """Get the type of this DictExpression. - - Type of AST node - - :return: The type of this DictExpression. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this DictExpression. - - Type of AST node - - :param type: The type of this DictExpression. - :type: str - """ # noqa: E501 - self._type = type - - @property - def elements(self): - """Get the elements of this DictExpression. - - Elements of the dictionary - - :return: The elements of this DictExpression. - :rtype: list[DictItem] - """ # noqa: E501 - return self._elements - - @elements.setter - def elements(self, elements): - """Set the elements of this DictExpression. - - Elements of the dictionary - - :param elements: The elements of this DictExpression. - :type: list[DictItem] - """ # noqa: E501 - self._elements = elements - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, DictExpression): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/dict_item.py b/frogpilot/third_party/influxdb_client/domain/dict_item.py deleted file mode 100644 index 77beac92..00000000 --- a/frogpilot/third_party/influxdb_client/domain/dict_item.py +++ /dev/null @@ -1,157 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class DictItem(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'key': 'Expression', - 'val': 'Expression' - } - - attribute_map = { - 'type': 'type', - 'key': 'key', - 'val': 'val' - } - - def __init__(self, type=None, key=None, val=None): # noqa: E501,D401,D403 - """DictItem - a model defined in OpenAPI.""" # noqa: E501 - self._type = None - self._key = None - self._val = None - self.discriminator = None - - if type is not None: - self.type = type - if key is not None: - self.key = key - if val is not None: - self.val = val - - @property - def type(self): - """Get the type of this DictItem. - - Type of AST node - - :return: The type of this DictItem. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this DictItem. - - Type of AST node - - :param type: The type of this DictItem. - :type: str - """ # noqa: E501 - self._type = type - - @property - def key(self): - """Get the key of this DictItem. - - :return: The key of this DictItem. - :rtype: Expression - """ # noqa: E501 - return self._key - - @key.setter - def key(self, key): - """Set the key of this DictItem. - - :param key: The key of this DictItem. - :type: Expression - """ # noqa: E501 - self._key = key - - @property - def val(self): - """Get the val of this DictItem. - - :return: The val of this DictItem. - :rtype: Expression - """ # noqa: E501 - return self._val - - @val.setter - def val(self, val): - """Set the val of this DictItem. - - :param val: The val of this DictItem. - :type: Expression - """ # noqa: E501 - self._val = val - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, DictItem): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/duration.py b/frogpilot/third_party/influxdb_client/domain/duration.py deleted file mode 100644 index 51044444..00000000 --- a/frogpilot/third_party/influxdb_client/domain/duration.py +++ /dev/null @@ -1,157 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class Duration(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'magnitude': 'int', - 'unit': 'str' - } - - attribute_map = { - 'type': 'type', - 'magnitude': 'magnitude', - 'unit': 'unit' - } - - def __init__(self, type=None, magnitude=None, unit=None): # noqa: E501,D401,D403 - """Duration - a model defined in OpenAPI.""" # noqa: E501 - self._type = None - self._magnitude = None - self._unit = None - self.discriminator = None - - if type is not None: - self.type = type - if magnitude is not None: - self.magnitude = magnitude - if unit is not None: - self.unit = unit - - @property - def type(self): - """Get the type of this Duration. - - Type of AST node - - :return: The type of this Duration. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this Duration. - - Type of AST node - - :param type: The type of this Duration. - :type: str - """ # noqa: E501 - self._type = type - - @property - def magnitude(self): - """Get the magnitude of this Duration. - - :return: The magnitude of this Duration. - :rtype: int - """ # noqa: E501 - return self._magnitude - - @magnitude.setter - def magnitude(self, magnitude): - """Set the magnitude of this Duration. - - :param magnitude: The magnitude of this Duration. - :type: int - """ # noqa: E501 - self._magnitude = magnitude - - @property - def unit(self): - """Get the unit of this Duration. - - :return: The unit of this Duration. - :rtype: str - """ # noqa: E501 - return self._unit - - @unit.setter - def unit(self, unit): - """Set the unit of this Duration. - - :param unit: The unit of this Duration. - :type: str - """ # noqa: E501 - self._unit = unit - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Duration): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/duration_literal.py b/frogpilot/third_party/influxdb_client/domain/duration_literal.py deleted file mode 100644 index f6d63965..00000000 --- a/frogpilot/third_party/influxdb_client/domain/duration_literal.py +++ /dev/null @@ -1,142 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.expression import Expression - - -class DurationLiteral(Expression): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'values': 'list[Duration]' - } - - attribute_map = { - 'type': 'type', - 'values': 'values' - } - - def __init__(self, type=None, values=None): # noqa: E501,D401,D403 - """DurationLiteral - a model defined in OpenAPI.""" # noqa: E501 - Expression.__init__(self) # noqa: E501 - - self._type = None - self._values = None - self.discriminator = None - - if type is not None: - self.type = type - if values is not None: - self.values = values - - @property - def type(self): - """Get the type of this DurationLiteral. - - Type of AST node - - :return: The type of this DurationLiteral. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this DurationLiteral. - - Type of AST node - - :param type: The type of this DurationLiteral. - :type: str - """ # noqa: E501 - self._type = type - - @property - def values(self): - """Get the values of this DurationLiteral. - - Duration values - - :return: The values of this DurationLiteral. - :rtype: list[Duration] - """ # noqa: E501 - return self._values - - @values.setter - def values(self, values): - """Set the values of this DurationLiteral. - - Duration values - - :param values: The values of this DurationLiteral. - :type: list[Duration] - """ # noqa: E501 - self._values = values - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, DurationLiteral): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/error.py b/frogpilot/third_party/influxdb_client/domain/error.py deleted file mode 100644 index 2a3655bb..00000000 --- a/frogpilot/third_party/influxdb_client/domain/error.py +++ /dev/null @@ -1,193 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class Error(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'code': 'str', - 'message': 'str', - 'op': 'str', - 'err': 'str' - } - - attribute_map = { - 'code': 'code', - 'message': 'message', - 'op': 'op', - 'err': 'err' - } - - def __init__(self, code=None, message=None, op=None, err=None): # noqa: E501,D401,D403 - """Error - a model defined in OpenAPI.""" # noqa: E501 - self._code = None - self._message = None - self._op = None - self._err = None - self.discriminator = None - - self.code = code - if message is not None: - self.message = message - if op is not None: - self.op = op - if err is not None: - self.err = err - - @property - def code(self): - """Get the code of this Error. - - code is the machine-readable error code. - - :return: The code of this Error. - :rtype: str - """ # noqa: E501 - return self._code - - @code.setter - def code(self, code): - """Set the code of this Error. - - code is the machine-readable error code. - - :param code: The code of this Error. - :type: str - """ # noqa: E501 - if code is None: - raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 - self._code = code - - @property - def message(self): - """Get the message of this Error. - - Human-readable message. - - :return: The message of this Error. - :rtype: str - """ # noqa: E501 - return self._message - - @message.setter - def message(self, message): - """Set the message of this Error. - - Human-readable message. - - :param message: The message of this Error. - :type: str - """ # noqa: E501 - self._message = message - - @property - def op(self): - """Get the op of this Error. - - Describes the logical code operation when the error occurred. Useful for debugging. - - :return: The op of this Error. - :rtype: str - """ # noqa: E501 - return self._op - - @op.setter - def op(self, op): - """Set the op of this Error. - - Describes the logical code operation when the error occurred. Useful for debugging. - - :param op: The op of this Error. - :type: str - """ # noqa: E501 - self._op = op - - @property - def err(self): - """Get the err of this Error. - - Stack of errors that occurred during processing of the request. Useful for debugging. - - :return: The err of this Error. - :rtype: str - """ # noqa: E501 - return self._err - - @err.setter - def err(self, err): - """Set the err of this Error. - - Stack of errors that occurred during processing of the request. Useful for debugging. - - :param err: The err of this Error. - :type: str - """ # noqa: E501 - self._err = err - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Error): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/expression.py b/frogpilot/third_party/influxdb_client/domain/expression.py deleted file mode 100644 index 9d449fd4..00000000 --- a/frogpilot/third_party/influxdb_client/domain/expression.py +++ /dev/null @@ -1,86 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.node import Node - - -class Expression(Node): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501,D401,D403 - """Expression - a model defined in OpenAPI.""" # noqa: E501 - Node.__init__(self) # noqa: E501 - self.discriminator = None - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Expression): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/expression_statement.py b/frogpilot/third_party/influxdb_client/domain/expression_statement.py deleted file mode 100644 index 04dd216d..00000000 --- a/frogpilot/third_party/influxdb_client/domain/expression_statement.py +++ /dev/null @@ -1,138 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.statement import Statement - - -class ExpressionStatement(Statement): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'expression': 'Expression' - } - - attribute_map = { - 'type': 'type', - 'expression': 'expression' - } - - def __init__(self, type=None, expression=None): # noqa: E501,D401,D403 - """ExpressionStatement - a model defined in OpenAPI.""" # noqa: E501 - Statement.__init__(self) # noqa: E501 - - self._type = None - self._expression = None - self.discriminator = None - - if type is not None: - self.type = type - if expression is not None: - self.expression = expression - - @property - def type(self): - """Get the type of this ExpressionStatement. - - Type of AST node - - :return: The type of this ExpressionStatement. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this ExpressionStatement. - - Type of AST node - - :param type: The type of this ExpressionStatement. - :type: str - """ # noqa: E501 - self._type = type - - @property - def expression(self): - """Get the expression of this ExpressionStatement. - - :return: The expression of this ExpressionStatement. - :rtype: Expression - """ # noqa: E501 - return self._expression - - @expression.setter - def expression(self, expression): - """Set the expression of this ExpressionStatement. - - :param expression: The expression of this ExpressionStatement. - :type: Expression - """ # noqa: E501 - self._expression = expression - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, ExpressionStatement): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/field.py b/frogpilot/third_party/influxdb_client/domain/field.py deleted file mode 100644 index 62bc3d13..00000000 --- a/frogpilot/third_party/influxdb_client/domain/field.py +++ /dev/null @@ -1,192 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class Field(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'value': 'str', - 'type': 'str', - 'alias': 'str', - 'args': 'list[Field]' - } - - attribute_map = { - 'value': 'value', - 'type': 'type', - 'alias': 'alias', - 'args': 'args' - } - - def __init__(self, value=None, type=None, alias=None, args=None): # noqa: E501,D401,D403 - """Field - a model defined in OpenAPI.""" # noqa: E501 - self._value = None - self._type = None - self._alias = None - self._args = None - self.discriminator = None - - if value is not None: - self.value = value - if type is not None: - self.type = type - if alias is not None: - self.alias = alias - if args is not None: - self.args = args - - @property - def value(self): - """Get the value of this Field. - - value is the value of the field. Meaning of the value is implied by the `type` key - - :return: The value of this Field. - :rtype: str - """ # noqa: E501 - return self._value - - @value.setter - def value(self, value): - """Set the value of this Field. - - value is the value of the field. Meaning of the value is implied by the `type` key - - :param value: The value of this Field. - :type: str - """ # noqa: E501 - self._value = value - - @property - def type(self): - """Get the type of this Field. - - `type` describes the field type. `func` is a function. `field` is a field reference. - - :return: The type of this Field. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this Field. - - `type` describes the field type. `func` is a function. `field` is a field reference. - - :param type: The type of this Field. - :type: str - """ # noqa: E501 - self._type = type - - @property - def alias(self): - """Get the alias of this Field. - - Alias overrides the field name in the returned response. Applies only if type is `func` - - :return: The alias of this Field. - :rtype: str - """ # noqa: E501 - return self._alias - - @alias.setter - def alias(self, alias): - """Set the alias of this Field. - - Alias overrides the field name in the returned response. Applies only if type is `func` - - :param alias: The alias of this Field. - :type: str - """ # noqa: E501 - self._alias = alias - - @property - def args(self): - """Get the args of this Field. - - Args are the arguments to the function - - :return: The args of this Field. - :rtype: list[Field] - """ # noqa: E501 - return self._args - - @args.setter - def args(self, args): - """Set the args of this Field. - - Args are the arguments to the function - - :param args: The args of this Field. - :type: list[Field] - """ # noqa: E501 - self._args = args - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Field): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/file.py b/frogpilot/third_party/influxdb_client/domain/file.py deleted file mode 100644 index 6d3ac812..00000000 --- a/frogpilot/third_party/influxdb_client/domain/file.py +++ /dev/null @@ -1,215 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class File(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'name': 'str', - 'package': 'PackageClause', - 'imports': 'list[ImportDeclaration]', - 'body': 'list[Statement]' - } - - attribute_map = { - 'type': 'type', - 'name': 'name', - 'package': 'package', - 'imports': 'imports', - 'body': 'body' - } - - def __init__(self, type=None, name=None, package=None, imports=None, body=None): # noqa: E501,D401,D403 - """File - a model defined in OpenAPI.""" # noqa: E501 - self._type = None - self._name = None - self._package = None - self._imports = None - self._body = None - self.discriminator = None - - if type is not None: - self.type = type - if name is not None: - self.name = name - if package is not None: - self.package = package - if imports is not None: - self.imports = imports - if body is not None: - self.body = body - - @property - def type(self): - """Get the type of this File. - - Type of AST node - - :return: The type of this File. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this File. - - Type of AST node - - :param type: The type of this File. - :type: str - """ # noqa: E501 - self._type = type - - @property - def name(self): - """Get the name of this File. - - The name of the file. - - :return: The name of this File. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this File. - - The name of the file. - - :param name: The name of this File. - :type: str - """ # noqa: E501 - self._name = name - - @property - def package(self): - """Get the package of this File. - - :return: The package of this File. - :rtype: PackageClause - """ # noqa: E501 - return self._package - - @package.setter - def package(self, package): - """Set the package of this File. - - :param package: The package of this File. - :type: PackageClause - """ # noqa: E501 - self._package = package - - @property - def imports(self): - """Get the imports of this File. - - A list of package imports - - :return: The imports of this File. - :rtype: list[ImportDeclaration] - """ # noqa: E501 - return self._imports - - @imports.setter - def imports(self, imports): - """Set the imports of this File. - - A list of package imports - - :param imports: The imports of this File. - :type: list[ImportDeclaration] - """ # noqa: E501 - self._imports = imports - - @property - def body(self): - """Get the body of this File. - - List of Flux statements - - :return: The body of this File. - :rtype: list[Statement] - """ # noqa: E501 - return self._body - - @body.setter - def body(self, body): - """Set the body of this File. - - List of Flux statements - - :param body: The body of this File. - :type: list[Statement] - """ # noqa: E501 - self._body = body - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, File): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/float_literal.py b/frogpilot/third_party/influxdb_client/domain/float_literal.py deleted file mode 100644 index 41e8ec35..00000000 --- a/frogpilot/third_party/influxdb_client/domain/float_literal.py +++ /dev/null @@ -1,138 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.expression import Expression - - -class FloatLiteral(Expression): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'value': 'float' - } - - attribute_map = { - 'type': 'type', - 'value': 'value' - } - - def __init__(self, type=None, value=None): # noqa: E501,D401,D403 - """FloatLiteral - a model defined in OpenAPI.""" # noqa: E501 - Expression.__init__(self) # noqa: E501 - - self._type = None - self._value = None - self.discriminator = None - - if type is not None: - self.type = type - if value is not None: - self.value = value - - @property - def type(self): - """Get the type of this FloatLiteral. - - Type of AST node - - :return: The type of this FloatLiteral. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this FloatLiteral. - - Type of AST node - - :param type: The type of this FloatLiteral. - :type: str - """ # noqa: E501 - self._type = type - - @property - def value(self): - """Get the value of this FloatLiteral. - - :return: The value of this FloatLiteral. - :rtype: float - """ # noqa: E501 - return self._value - - @value.setter - def value(self, value): - """Set the value of this FloatLiteral. - - :param value: The value of this FloatLiteral. - :type: float - """ # noqa: E501 - self._value = value - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, FloatLiteral): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/flux_response.py b/frogpilot/third_party/influxdb_client/domain/flux_response.py deleted file mode 100644 index 94608114..00000000 --- a/frogpilot/third_party/influxdb_client/domain/flux_response.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class FluxResponse(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'flux': 'str' - } - - attribute_map = { - 'flux': 'flux' - } - - def __init__(self, flux=None): # noqa: E501,D401,D403 - """FluxResponse - a model defined in OpenAPI.""" # noqa: E501 - self._flux = None - self.discriminator = None - - if flux is not None: - self.flux = flux - - @property - def flux(self): - """Get the flux of this FluxResponse. - - :return: The flux of this FluxResponse. - :rtype: str - """ # noqa: E501 - return self._flux - - @flux.setter - def flux(self, flux): - """Set the flux of this FluxResponse. - - :param flux: The flux of this FluxResponse. - :type: str - """ # noqa: E501 - self._flux = flux - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, FluxResponse): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/flux_suggestion.py b/frogpilot/third_party/influxdb_client/domain/flux_suggestion.py deleted file mode 100644 index 46c692fb..00000000 --- a/frogpilot/third_party/influxdb_client/domain/flux_suggestion.py +++ /dev/null @@ -1,130 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class FluxSuggestion(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str', - 'params': 'dict(str, str)' - } - - attribute_map = { - 'name': 'name', - 'params': 'params' - } - - def __init__(self, name=None, params=None): # noqa: E501,D401,D403 - """FluxSuggestion - a model defined in OpenAPI.""" # noqa: E501 - self._name = None - self._params = None - self.discriminator = None - - if name is not None: - self.name = name - if params is not None: - self.params = params - - @property - def name(self): - """Get the name of this FluxSuggestion. - - :return: The name of this FluxSuggestion. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this FluxSuggestion. - - :param name: The name of this FluxSuggestion. - :type: str - """ # noqa: E501 - self._name = name - - @property - def params(self): - """Get the params of this FluxSuggestion. - - :return: The params of this FluxSuggestion. - :rtype: dict(str, str) - """ # noqa: E501 - return self._params - - @params.setter - def params(self, params): - """Set the params of this FluxSuggestion. - - :param params: The params of this FluxSuggestion. - :type: dict(str, str) - """ # noqa: E501 - self._params = params - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, FluxSuggestion): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/flux_suggestions.py b/frogpilot/third_party/influxdb_client/domain/flux_suggestions.py deleted file mode 100644 index 38c3ccf8..00000000 --- a/frogpilot/third_party/influxdb_client/domain/flux_suggestions.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class FluxSuggestions(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'funcs': 'list[FluxSuggestion]' - } - - attribute_map = { - 'funcs': 'funcs' - } - - def __init__(self, funcs=None): # noqa: E501,D401,D403 - """FluxSuggestions - a model defined in OpenAPI.""" # noqa: E501 - self._funcs = None - self.discriminator = None - - if funcs is not None: - self.funcs = funcs - - @property - def funcs(self): - """Get the funcs of this FluxSuggestions. - - :return: The funcs of this FluxSuggestions. - :rtype: list[FluxSuggestion] - """ # noqa: E501 - return self._funcs - - @funcs.setter - def funcs(self, funcs): - """Set the funcs of this FluxSuggestions. - - :param funcs: The funcs of this FluxSuggestions. - :type: list[FluxSuggestion] - """ # noqa: E501 - self._funcs = funcs - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, FluxSuggestions): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/function_expression.py b/frogpilot/third_party/influxdb_client/domain/function_expression.py deleted file mode 100644 index b06c7387..00000000 --- a/frogpilot/third_party/influxdb_client/domain/function_expression.py +++ /dev/null @@ -1,165 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.expression import Expression - - -class FunctionExpression(Expression): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'params': 'list[ModelProperty]', - 'body': 'Node' - } - - attribute_map = { - 'type': 'type', - 'params': 'params', - 'body': 'body' - } - - def __init__(self, type=None, params=None, body=None): # noqa: E501,D401,D403 - """FunctionExpression - a model defined in OpenAPI.""" # noqa: E501 - Expression.__init__(self) # noqa: E501 - - self._type = None - self._params = None - self._body = None - self.discriminator = None - - if type is not None: - self.type = type - if params is not None: - self.params = params - if body is not None: - self.body = body - - @property - def type(self): - """Get the type of this FunctionExpression. - - Type of AST node - - :return: The type of this FunctionExpression. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this FunctionExpression. - - Type of AST node - - :param type: The type of this FunctionExpression. - :type: str - """ # noqa: E501 - self._type = type - - @property - def params(self): - """Get the params of this FunctionExpression. - - Function parameters - - :return: The params of this FunctionExpression. - :rtype: list[ModelProperty] - """ # noqa: E501 - return self._params - - @params.setter - def params(self, params): - """Set the params of this FunctionExpression. - - Function parameters - - :param params: The params of this FunctionExpression. - :type: list[ModelProperty] - """ # noqa: E501 - self._params = params - - @property - def body(self): - """Get the body of this FunctionExpression. - - :return: The body of this FunctionExpression. - :rtype: Node - """ # noqa: E501 - return self._body - - @body.setter - def body(self, body): - """Set the body of this FunctionExpression. - - :param body: The body of this FunctionExpression. - :type: Node - """ # noqa: E501 - self._body = body - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, FunctionExpression): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/gauge_view_properties.py b/frogpilot/third_party/influxdb_client/domain/gauge_view_properties.py deleted file mode 100644 index 23785987..00000000 --- a/frogpilot/third_party/influxdb_client/domain/gauge_view_properties.py +++ /dev/null @@ -1,360 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.view_properties import ViewProperties - - -class GaugeViewProperties(ViewProperties): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'queries': 'list[DashboardQuery]', - 'colors': 'list[DashboardColor]', - 'shape': 'str', - 'note': 'str', - 'show_note_when_empty': 'bool', - 'prefix': 'str', - 'tick_prefix': 'str', - 'suffix': 'str', - 'tick_suffix': 'str', - 'decimal_places': 'DecimalPlaces' - } - - attribute_map = { - 'type': 'type', - 'queries': 'queries', - 'colors': 'colors', - 'shape': 'shape', - 'note': 'note', - 'show_note_when_empty': 'showNoteWhenEmpty', - 'prefix': 'prefix', - 'tick_prefix': 'tickPrefix', - 'suffix': 'suffix', - 'tick_suffix': 'tickSuffix', - 'decimal_places': 'decimalPlaces' - } - - def __init__(self, type=None, queries=None, colors=None, shape=None, note=None, show_note_when_empty=None, prefix=None, tick_prefix=None, suffix=None, tick_suffix=None, decimal_places=None): # noqa: E501,D401,D403 - """GaugeViewProperties - a model defined in OpenAPI.""" # noqa: E501 - ViewProperties.__init__(self) # noqa: E501 - - self._type = None - self._queries = None - self._colors = None - self._shape = None - self._note = None - self._show_note_when_empty = None - self._prefix = None - self._tick_prefix = None - self._suffix = None - self._tick_suffix = None - self._decimal_places = None - self.discriminator = None - - self.type = type - self.queries = queries - self.colors = colors - self.shape = shape - self.note = note - self.show_note_when_empty = show_note_when_empty - self.prefix = prefix - self.tick_prefix = tick_prefix - self.suffix = suffix - self.tick_suffix = tick_suffix - self.decimal_places = decimal_places - - @property - def type(self): - """Get the type of this GaugeViewProperties. - - :return: The type of this GaugeViewProperties. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this GaugeViewProperties. - - :param type: The type of this GaugeViewProperties. - :type: str - """ # noqa: E501 - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - self._type = type - - @property - def queries(self): - """Get the queries of this GaugeViewProperties. - - :return: The queries of this GaugeViewProperties. - :rtype: list[DashboardQuery] - """ # noqa: E501 - return self._queries - - @queries.setter - def queries(self, queries): - """Set the queries of this GaugeViewProperties. - - :param queries: The queries of this GaugeViewProperties. - :type: list[DashboardQuery] - """ # noqa: E501 - if queries is None: - raise ValueError("Invalid value for `queries`, must not be `None`") # noqa: E501 - self._queries = queries - - @property - def colors(self): - """Get the colors of this GaugeViewProperties. - - Colors define color encoding of data into a visualization - - :return: The colors of this GaugeViewProperties. - :rtype: list[DashboardColor] - """ # noqa: E501 - return self._colors - - @colors.setter - def colors(self, colors): - """Set the colors of this GaugeViewProperties. - - Colors define color encoding of data into a visualization - - :param colors: The colors of this GaugeViewProperties. - :type: list[DashboardColor] - """ # noqa: E501 - if colors is None: - raise ValueError("Invalid value for `colors`, must not be `None`") # noqa: E501 - self._colors = colors - - @property - def shape(self): - """Get the shape of this GaugeViewProperties. - - :return: The shape of this GaugeViewProperties. - :rtype: str - """ # noqa: E501 - return self._shape - - @shape.setter - def shape(self, shape): - """Set the shape of this GaugeViewProperties. - - :param shape: The shape of this GaugeViewProperties. - :type: str - """ # noqa: E501 - if shape is None: - raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 - self._shape = shape - - @property - def note(self): - """Get the note of this GaugeViewProperties. - - :return: The note of this GaugeViewProperties. - :rtype: str - """ # noqa: E501 - return self._note - - @note.setter - def note(self, note): - """Set the note of this GaugeViewProperties. - - :param note: The note of this GaugeViewProperties. - :type: str - """ # noqa: E501 - if note is None: - raise ValueError("Invalid value for `note`, must not be `None`") # noqa: E501 - self._note = note - - @property - def show_note_when_empty(self): - """Get the show_note_when_empty of this GaugeViewProperties. - - If true, will display note when empty - - :return: The show_note_when_empty of this GaugeViewProperties. - :rtype: bool - """ # noqa: E501 - return self._show_note_when_empty - - @show_note_when_empty.setter - def show_note_when_empty(self, show_note_when_empty): - """Set the show_note_when_empty of this GaugeViewProperties. - - If true, will display note when empty - - :param show_note_when_empty: The show_note_when_empty of this GaugeViewProperties. - :type: bool - """ # noqa: E501 - if show_note_when_empty is None: - raise ValueError("Invalid value for `show_note_when_empty`, must not be `None`") # noqa: E501 - self._show_note_when_empty = show_note_when_empty - - @property - def prefix(self): - """Get the prefix of this GaugeViewProperties. - - :return: The prefix of this GaugeViewProperties. - :rtype: str - """ # noqa: E501 - return self._prefix - - @prefix.setter - def prefix(self, prefix): - """Set the prefix of this GaugeViewProperties. - - :param prefix: The prefix of this GaugeViewProperties. - :type: str - """ # noqa: E501 - if prefix is None: - raise ValueError("Invalid value for `prefix`, must not be `None`") # noqa: E501 - self._prefix = prefix - - @property - def tick_prefix(self): - """Get the tick_prefix of this GaugeViewProperties. - - :return: The tick_prefix of this GaugeViewProperties. - :rtype: str - """ # noqa: E501 - return self._tick_prefix - - @tick_prefix.setter - def tick_prefix(self, tick_prefix): - """Set the tick_prefix of this GaugeViewProperties. - - :param tick_prefix: The tick_prefix of this GaugeViewProperties. - :type: str - """ # noqa: E501 - if tick_prefix is None: - raise ValueError("Invalid value for `tick_prefix`, must not be `None`") # noqa: E501 - self._tick_prefix = tick_prefix - - @property - def suffix(self): - """Get the suffix of this GaugeViewProperties. - - :return: The suffix of this GaugeViewProperties. - :rtype: str - """ # noqa: E501 - return self._suffix - - @suffix.setter - def suffix(self, suffix): - """Set the suffix of this GaugeViewProperties. - - :param suffix: The suffix of this GaugeViewProperties. - :type: str - """ # noqa: E501 - if suffix is None: - raise ValueError("Invalid value for `suffix`, must not be `None`") # noqa: E501 - self._suffix = suffix - - @property - def tick_suffix(self): - """Get the tick_suffix of this GaugeViewProperties. - - :return: The tick_suffix of this GaugeViewProperties. - :rtype: str - """ # noqa: E501 - return self._tick_suffix - - @tick_suffix.setter - def tick_suffix(self, tick_suffix): - """Set the tick_suffix of this GaugeViewProperties. - - :param tick_suffix: The tick_suffix of this GaugeViewProperties. - :type: str - """ # noqa: E501 - if tick_suffix is None: - raise ValueError("Invalid value for `tick_suffix`, must not be `None`") # noqa: E501 - self._tick_suffix = tick_suffix - - @property - def decimal_places(self): - """Get the decimal_places of this GaugeViewProperties. - - :return: The decimal_places of this GaugeViewProperties. - :rtype: DecimalPlaces - """ # noqa: E501 - return self._decimal_places - - @decimal_places.setter - def decimal_places(self, decimal_places): - """Set the decimal_places of this GaugeViewProperties. - - :param decimal_places: The decimal_places of this GaugeViewProperties. - :type: DecimalPlaces - """ # noqa: E501 - if decimal_places is None: - raise ValueError("Invalid value for `decimal_places`, must not be `None`") # noqa: E501 - self._decimal_places = decimal_places - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, GaugeViewProperties): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/greater_threshold.py b/frogpilot/third_party/influxdb_client/domain/greater_threshold.py deleted file mode 100644 index b857f132..00000000 --- a/frogpilot/third_party/influxdb_client/domain/greater_threshold.py +++ /dev/null @@ -1,140 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.threshold_base import ThresholdBase - - -class GreaterThreshold(ThresholdBase): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'value': 'float', - 'level': 'CheckStatusLevel', - 'all_values': 'bool' - } - - attribute_map = { - 'type': 'type', - 'value': 'value', - 'level': 'level', - 'all_values': 'allValues' - } - - def __init__(self, type="greater", value=None, level=None, all_values=None): # noqa: E501,D401,D403 - """GreaterThreshold - a model defined in OpenAPI.""" # noqa: E501 - ThresholdBase.__init__(self, level=level, all_values=all_values) # noqa: E501 - - self._type = None - self._value = None - self.discriminator = None - - self.type = type - self.value = value - - @property - def type(self): - """Get the type of this GreaterThreshold. - - :return: The type of this GreaterThreshold. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this GreaterThreshold. - - :param type: The type of this GreaterThreshold. - :type: str - """ # noqa: E501 - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - self._type = type - - @property - def value(self): - """Get the value of this GreaterThreshold. - - :return: The value of this GreaterThreshold. - :rtype: float - """ # noqa: E501 - return self._value - - @value.setter - def value(self, value): - """Set the value of this GreaterThreshold. - - :param value: The value of this GreaterThreshold. - :type: float - """ # noqa: E501 - if value is None: - raise ValueError("Invalid value for `value`, must not be `None`") # noqa: E501 - self._value = value - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, GreaterThreshold): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/health_check.py b/frogpilot/third_party/influxdb_client/domain/health_check.py deleted file mode 100644 index b3552437..00000000 --- a/frogpilot/third_party/influxdb_client/domain/health_check.py +++ /dev/null @@ -1,224 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class HealthCheck(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str', - 'message': 'str', - 'checks': 'list[HealthCheck]', - 'status': 'str', - 'version': 'str', - 'commit': 'str' - } - - attribute_map = { - 'name': 'name', - 'message': 'message', - 'checks': 'checks', - 'status': 'status', - 'version': 'version', - 'commit': 'commit' - } - - def __init__(self, name=None, message=None, checks=None, status=None, version=None, commit=None): # noqa: E501,D401,D403 - """HealthCheck - a model defined in OpenAPI.""" # noqa: E501 - self._name = None - self._message = None - self._checks = None - self._status = None - self._version = None - self._commit = None - self.discriminator = None - - self.name = name - if message is not None: - self.message = message - if checks is not None: - self.checks = checks - self.status = status - if version is not None: - self.version = version - if commit is not None: - self.commit = commit - - @property - def name(self): - """Get the name of this HealthCheck. - - :return: The name of this HealthCheck. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this HealthCheck. - - :param name: The name of this HealthCheck. - :type: str - """ # noqa: E501 - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - self._name = name - - @property - def message(self): - """Get the message of this HealthCheck. - - :return: The message of this HealthCheck. - :rtype: str - """ # noqa: E501 - return self._message - - @message.setter - def message(self, message): - """Set the message of this HealthCheck. - - :param message: The message of this HealthCheck. - :type: str - """ # noqa: E501 - self._message = message - - @property - def checks(self): - """Get the checks of this HealthCheck. - - :return: The checks of this HealthCheck. - :rtype: list[HealthCheck] - """ # noqa: E501 - return self._checks - - @checks.setter - def checks(self, checks): - """Set the checks of this HealthCheck. - - :param checks: The checks of this HealthCheck. - :type: list[HealthCheck] - """ # noqa: E501 - self._checks = checks - - @property - def status(self): - """Get the status of this HealthCheck. - - :return: The status of this HealthCheck. - :rtype: str - """ # noqa: E501 - return self._status - - @status.setter - def status(self, status): - """Set the status of this HealthCheck. - - :param status: The status of this HealthCheck. - :type: str - """ # noqa: E501 - if status is None: - raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 - self._status = status - - @property - def version(self): - """Get the version of this HealthCheck. - - :return: The version of this HealthCheck. - :rtype: str - """ # noqa: E501 - return self._version - - @version.setter - def version(self, version): - """Set the version of this HealthCheck. - - :param version: The version of this HealthCheck. - :type: str - """ # noqa: E501 - self._version = version - - @property - def commit(self): - """Get the commit of this HealthCheck. - - :return: The commit of this HealthCheck. - :rtype: str - """ # noqa: E501 - return self._commit - - @commit.setter - def commit(self, commit): - """Set the commit of this HealthCheck. - - :param commit: The commit of this HealthCheck. - :type: str - """ # noqa: E501 - self._commit = commit - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, HealthCheck): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/heatmap_view_properties.py b/frogpilot/third_party/influxdb_client/domain/heatmap_view_properties.py deleted file mode 100644 index c4061b18..00000000 --- a/frogpilot/third_party/influxdb_client/domain/heatmap_view_properties.py +++ /dev/null @@ -1,826 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.view_properties import ViewProperties - - -class HeatmapViewProperties(ViewProperties): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'adaptive_zoom_hide': 'bool', - 'time_format': 'str', - 'type': 'str', - 'queries': 'list[DashboardQuery]', - 'colors': 'list[str]', - 'shape': 'str', - 'note': 'str', - 'show_note_when_empty': 'bool', - 'x_column': 'str', - 'generate_x_axis_ticks': 'list[str]', - 'x_total_ticks': 'int', - 'x_tick_start': 'float', - 'x_tick_step': 'float', - 'y_column': 'str', - 'generate_y_axis_ticks': 'list[str]', - 'y_total_ticks': 'int', - 'y_tick_start': 'float', - 'y_tick_step': 'float', - 'x_domain': 'list[float]', - 'y_domain': 'list[float]', - 'x_axis_label': 'str', - 'y_axis_label': 'str', - 'x_prefix': 'str', - 'x_suffix': 'str', - 'y_prefix': 'str', - 'y_suffix': 'str', - 'bin_size': 'float', - 'legend_colorize_rows': 'bool', - 'legend_hide': 'bool', - 'legend_opacity': 'float', - 'legend_orientation_threshold': 'int' - } - - attribute_map = { - 'adaptive_zoom_hide': 'adaptiveZoomHide', - 'time_format': 'timeFormat', - 'type': 'type', - 'queries': 'queries', - 'colors': 'colors', - 'shape': 'shape', - 'note': 'note', - 'show_note_when_empty': 'showNoteWhenEmpty', - 'x_column': 'xColumn', - 'generate_x_axis_ticks': 'generateXAxisTicks', - 'x_total_ticks': 'xTotalTicks', - 'x_tick_start': 'xTickStart', - 'x_tick_step': 'xTickStep', - 'y_column': 'yColumn', - 'generate_y_axis_ticks': 'generateYAxisTicks', - 'y_total_ticks': 'yTotalTicks', - 'y_tick_start': 'yTickStart', - 'y_tick_step': 'yTickStep', - 'x_domain': 'xDomain', - 'y_domain': 'yDomain', - 'x_axis_label': 'xAxisLabel', - 'y_axis_label': 'yAxisLabel', - 'x_prefix': 'xPrefix', - 'x_suffix': 'xSuffix', - 'y_prefix': 'yPrefix', - 'y_suffix': 'ySuffix', - 'bin_size': 'binSize', - 'legend_colorize_rows': 'legendColorizeRows', - 'legend_hide': 'legendHide', - 'legend_opacity': 'legendOpacity', - 'legend_orientation_threshold': 'legendOrientationThreshold' - } - - def __init__(self, adaptive_zoom_hide=None, time_format=None, type=None, queries=None, colors=None, shape=None, note=None, show_note_when_empty=None, x_column=None, generate_x_axis_ticks=None, x_total_ticks=None, x_tick_start=None, x_tick_step=None, y_column=None, generate_y_axis_ticks=None, y_total_ticks=None, y_tick_start=None, y_tick_step=None, x_domain=None, y_domain=None, x_axis_label=None, y_axis_label=None, x_prefix=None, x_suffix=None, y_prefix=None, y_suffix=None, bin_size=None, legend_colorize_rows=None, legend_hide=None, legend_opacity=None, legend_orientation_threshold=None): # noqa: E501,D401,D403 - """HeatmapViewProperties - a model defined in OpenAPI.""" # noqa: E501 - ViewProperties.__init__(self) # noqa: E501 - - self._adaptive_zoom_hide = None - self._time_format = None - self._type = None - self._queries = None - self._colors = None - self._shape = None - self._note = None - self._show_note_when_empty = None - self._x_column = None - self._generate_x_axis_ticks = None - self._x_total_ticks = None - self._x_tick_start = None - self._x_tick_step = None - self._y_column = None - self._generate_y_axis_ticks = None - self._y_total_ticks = None - self._y_tick_start = None - self._y_tick_step = None - self._x_domain = None - self._y_domain = None - self._x_axis_label = None - self._y_axis_label = None - self._x_prefix = None - self._x_suffix = None - self._y_prefix = None - self._y_suffix = None - self._bin_size = None - self._legend_colorize_rows = None - self._legend_hide = None - self._legend_opacity = None - self._legend_orientation_threshold = None - self.discriminator = None - - if adaptive_zoom_hide is not None: - self.adaptive_zoom_hide = adaptive_zoom_hide - if time_format is not None: - self.time_format = time_format - self.type = type - self.queries = queries - self.colors = colors - self.shape = shape - self.note = note - self.show_note_when_empty = show_note_when_empty - self.x_column = x_column - if generate_x_axis_ticks is not None: - self.generate_x_axis_ticks = generate_x_axis_ticks - if x_total_ticks is not None: - self.x_total_ticks = x_total_ticks - if x_tick_start is not None: - self.x_tick_start = x_tick_start - if x_tick_step is not None: - self.x_tick_step = x_tick_step - self.y_column = y_column - if generate_y_axis_ticks is not None: - self.generate_y_axis_ticks = generate_y_axis_ticks - if y_total_ticks is not None: - self.y_total_ticks = y_total_ticks - if y_tick_start is not None: - self.y_tick_start = y_tick_start - if y_tick_step is not None: - self.y_tick_step = y_tick_step - self.x_domain = x_domain - self.y_domain = y_domain - self.x_axis_label = x_axis_label - self.y_axis_label = y_axis_label - self.x_prefix = x_prefix - self.x_suffix = x_suffix - self.y_prefix = y_prefix - self.y_suffix = y_suffix - self.bin_size = bin_size - if legend_colorize_rows is not None: - self.legend_colorize_rows = legend_colorize_rows - if legend_hide is not None: - self.legend_hide = legend_hide - if legend_opacity is not None: - self.legend_opacity = legend_opacity - if legend_orientation_threshold is not None: - self.legend_orientation_threshold = legend_orientation_threshold - - @property - def adaptive_zoom_hide(self): - """Get the adaptive_zoom_hide of this HeatmapViewProperties. - - :return: The adaptive_zoom_hide of this HeatmapViewProperties. - :rtype: bool - """ # noqa: E501 - return self._adaptive_zoom_hide - - @adaptive_zoom_hide.setter - def adaptive_zoom_hide(self, adaptive_zoom_hide): - """Set the adaptive_zoom_hide of this HeatmapViewProperties. - - :param adaptive_zoom_hide: The adaptive_zoom_hide of this HeatmapViewProperties. - :type: bool - """ # noqa: E501 - self._adaptive_zoom_hide = adaptive_zoom_hide - - @property - def time_format(self): - """Get the time_format of this HeatmapViewProperties. - - :return: The time_format of this HeatmapViewProperties. - :rtype: str - """ # noqa: E501 - return self._time_format - - @time_format.setter - def time_format(self, time_format): - """Set the time_format of this HeatmapViewProperties. - - :param time_format: The time_format of this HeatmapViewProperties. - :type: str - """ # noqa: E501 - self._time_format = time_format - - @property - def type(self): - """Get the type of this HeatmapViewProperties. - - :return: The type of this HeatmapViewProperties. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this HeatmapViewProperties. - - :param type: The type of this HeatmapViewProperties. - :type: str - """ # noqa: E501 - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - self._type = type - - @property - def queries(self): - """Get the queries of this HeatmapViewProperties. - - :return: The queries of this HeatmapViewProperties. - :rtype: list[DashboardQuery] - """ # noqa: E501 - return self._queries - - @queries.setter - def queries(self, queries): - """Set the queries of this HeatmapViewProperties. - - :param queries: The queries of this HeatmapViewProperties. - :type: list[DashboardQuery] - """ # noqa: E501 - if queries is None: - raise ValueError("Invalid value for `queries`, must not be `None`") # noqa: E501 - self._queries = queries - - @property - def colors(self): - """Get the colors of this HeatmapViewProperties. - - Colors define color encoding of data into a visualization - - :return: The colors of this HeatmapViewProperties. - :rtype: list[str] - """ # noqa: E501 - return self._colors - - @colors.setter - def colors(self, colors): - """Set the colors of this HeatmapViewProperties. - - Colors define color encoding of data into a visualization - - :param colors: The colors of this HeatmapViewProperties. - :type: list[str] - """ # noqa: E501 - if colors is None: - raise ValueError("Invalid value for `colors`, must not be `None`") # noqa: E501 - self._colors = colors - - @property - def shape(self): - """Get the shape of this HeatmapViewProperties. - - :return: The shape of this HeatmapViewProperties. - :rtype: str - """ # noqa: E501 - return self._shape - - @shape.setter - def shape(self, shape): - """Set the shape of this HeatmapViewProperties. - - :param shape: The shape of this HeatmapViewProperties. - :type: str - """ # noqa: E501 - if shape is None: - raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 - self._shape = shape - - @property - def note(self): - """Get the note of this HeatmapViewProperties. - - :return: The note of this HeatmapViewProperties. - :rtype: str - """ # noqa: E501 - return self._note - - @note.setter - def note(self, note): - """Set the note of this HeatmapViewProperties. - - :param note: The note of this HeatmapViewProperties. - :type: str - """ # noqa: E501 - if note is None: - raise ValueError("Invalid value for `note`, must not be `None`") # noqa: E501 - self._note = note - - @property - def show_note_when_empty(self): - """Get the show_note_when_empty of this HeatmapViewProperties. - - If true, will display note when empty - - :return: The show_note_when_empty of this HeatmapViewProperties. - :rtype: bool - """ # noqa: E501 - return self._show_note_when_empty - - @show_note_when_empty.setter - def show_note_when_empty(self, show_note_when_empty): - """Set the show_note_when_empty of this HeatmapViewProperties. - - If true, will display note when empty - - :param show_note_when_empty: The show_note_when_empty of this HeatmapViewProperties. - :type: bool - """ # noqa: E501 - if show_note_when_empty is None: - raise ValueError("Invalid value for `show_note_when_empty`, must not be `None`") # noqa: E501 - self._show_note_when_empty = show_note_when_empty - - @property - def x_column(self): - """Get the x_column of this HeatmapViewProperties. - - :return: The x_column of this HeatmapViewProperties. - :rtype: str - """ # noqa: E501 - return self._x_column - - @x_column.setter - def x_column(self, x_column): - """Set the x_column of this HeatmapViewProperties. - - :param x_column: The x_column of this HeatmapViewProperties. - :type: str - """ # noqa: E501 - if x_column is None: - raise ValueError("Invalid value for `x_column`, must not be `None`") # noqa: E501 - self._x_column = x_column - - @property - def generate_x_axis_ticks(self): - """Get the generate_x_axis_ticks of this HeatmapViewProperties. - - :return: The generate_x_axis_ticks of this HeatmapViewProperties. - :rtype: list[str] - """ # noqa: E501 - return self._generate_x_axis_ticks - - @generate_x_axis_ticks.setter - def generate_x_axis_ticks(self, generate_x_axis_ticks): - """Set the generate_x_axis_ticks of this HeatmapViewProperties. - - :param generate_x_axis_ticks: The generate_x_axis_ticks of this HeatmapViewProperties. - :type: list[str] - """ # noqa: E501 - self._generate_x_axis_ticks = generate_x_axis_ticks - - @property - def x_total_ticks(self): - """Get the x_total_ticks of this HeatmapViewProperties. - - :return: The x_total_ticks of this HeatmapViewProperties. - :rtype: int - """ # noqa: E501 - return self._x_total_ticks - - @x_total_ticks.setter - def x_total_ticks(self, x_total_ticks): - """Set the x_total_ticks of this HeatmapViewProperties. - - :param x_total_ticks: The x_total_ticks of this HeatmapViewProperties. - :type: int - """ # noqa: E501 - self._x_total_ticks = x_total_ticks - - @property - def x_tick_start(self): - """Get the x_tick_start of this HeatmapViewProperties. - - :return: The x_tick_start of this HeatmapViewProperties. - :rtype: float - """ # noqa: E501 - return self._x_tick_start - - @x_tick_start.setter - def x_tick_start(self, x_tick_start): - """Set the x_tick_start of this HeatmapViewProperties. - - :param x_tick_start: The x_tick_start of this HeatmapViewProperties. - :type: float - """ # noqa: E501 - self._x_tick_start = x_tick_start - - @property - def x_tick_step(self): - """Get the x_tick_step of this HeatmapViewProperties. - - :return: The x_tick_step of this HeatmapViewProperties. - :rtype: float - """ # noqa: E501 - return self._x_tick_step - - @x_tick_step.setter - def x_tick_step(self, x_tick_step): - """Set the x_tick_step of this HeatmapViewProperties. - - :param x_tick_step: The x_tick_step of this HeatmapViewProperties. - :type: float - """ # noqa: E501 - self._x_tick_step = x_tick_step - - @property - def y_column(self): - """Get the y_column of this HeatmapViewProperties. - - :return: The y_column of this HeatmapViewProperties. - :rtype: str - """ # noqa: E501 - return self._y_column - - @y_column.setter - def y_column(self, y_column): - """Set the y_column of this HeatmapViewProperties. - - :param y_column: The y_column of this HeatmapViewProperties. - :type: str - """ # noqa: E501 - if y_column is None: - raise ValueError("Invalid value for `y_column`, must not be `None`") # noqa: E501 - self._y_column = y_column - - @property - def generate_y_axis_ticks(self): - """Get the generate_y_axis_ticks of this HeatmapViewProperties. - - :return: The generate_y_axis_ticks of this HeatmapViewProperties. - :rtype: list[str] - """ # noqa: E501 - return self._generate_y_axis_ticks - - @generate_y_axis_ticks.setter - def generate_y_axis_ticks(self, generate_y_axis_ticks): - """Set the generate_y_axis_ticks of this HeatmapViewProperties. - - :param generate_y_axis_ticks: The generate_y_axis_ticks of this HeatmapViewProperties. - :type: list[str] - """ # noqa: E501 - self._generate_y_axis_ticks = generate_y_axis_ticks - - @property - def y_total_ticks(self): - """Get the y_total_ticks of this HeatmapViewProperties. - - :return: The y_total_ticks of this HeatmapViewProperties. - :rtype: int - """ # noqa: E501 - return self._y_total_ticks - - @y_total_ticks.setter - def y_total_ticks(self, y_total_ticks): - """Set the y_total_ticks of this HeatmapViewProperties. - - :param y_total_ticks: The y_total_ticks of this HeatmapViewProperties. - :type: int - """ # noqa: E501 - self._y_total_ticks = y_total_ticks - - @property - def y_tick_start(self): - """Get the y_tick_start of this HeatmapViewProperties. - - :return: The y_tick_start of this HeatmapViewProperties. - :rtype: float - """ # noqa: E501 - return self._y_tick_start - - @y_tick_start.setter - def y_tick_start(self, y_tick_start): - """Set the y_tick_start of this HeatmapViewProperties. - - :param y_tick_start: The y_tick_start of this HeatmapViewProperties. - :type: float - """ # noqa: E501 - self._y_tick_start = y_tick_start - - @property - def y_tick_step(self): - """Get the y_tick_step of this HeatmapViewProperties. - - :return: The y_tick_step of this HeatmapViewProperties. - :rtype: float - """ # noqa: E501 - return self._y_tick_step - - @y_tick_step.setter - def y_tick_step(self, y_tick_step): - """Set the y_tick_step of this HeatmapViewProperties. - - :param y_tick_step: The y_tick_step of this HeatmapViewProperties. - :type: float - """ # noqa: E501 - self._y_tick_step = y_tick_step - - @property - def x_domain(self): - """Get the x_domain of this HeatmapViewProperties. - - :return: The x_domain of this HeatmapViewProperties. - :rtype: list[float] - """ # noqa: E501 - return self._x_domain - - @x_domain.setter - def x_domain(self, x_domain): - """Set the x_domain of this HeatmapViewProperties. - - :param x_domain: The x_domain of this HeatmapViewProperties. - :type: list[float] - """ # noqa: E501 - if x_domain is None: - raise ValueError("Invalid value for `x_domain`, must not be `None`") # noqa: E501 - self._x_domain = x_domain - - @property - def y_domain(self): - """Get the y_domain of this HeatmapViewProperties. - - :return: The y_domain of this HeatmapViewProperties. - :rtype: list[float] - """ # noqa: E501 - return self._y_domain - - @y_domain.setter - def y_domain(self, y_domain): - """Set the y_domain of this HeatmapViewProperties. - - :param y_domain: The y_domain of this HeatmapViewProperties. - :type: list[float] - """ # noqa: E501 - if y_domain is None: - raise ValueError("Invalid value for `y_domain`, must not be `None`") # noqa: E501 - self._y_domain = y_domain - - @property - def x_axis_label(self): - """Get the x_axis_label of this HeatmapViewProperties. - - :return: The x_axis_label of this HeatmapViewProperties. - :rtype: str - """ # noqa: E501 - return self._x_axis_label - - @x_axis_label.setter - def x_axis_label(self, x_axis_label): - """Set the x_axis_label of this HeatmapViewProperties. - - :param x_axis_label: The x_axis_label of this HeatmapViewProperties. - :type: str - """ # noqa: E501 - if x_axis_label is None: - raise ValueError("Invalid value for `x_axis_label`, must not be `None`") # noqa: E501 - self._x_axis_label = x_axis_label - - @property - def y_axis_label(self): - """Get the y_axis_label of this HeatmapViewProperties. - - :return: The y_axis_label of this HeatmapViewProperties. - :rtype: str - """ # noqa: E501 - return self._y_axis_label - - @y_axis_label.setter - def y_axis_label(self, y_axis_label): - """Set the y_axis_label of this HeatmapViewProperties. - - :param y_axis_label: The y_axis_label of this HeatmapViewProperties. - :type: str - """ # noqa: E501 - if y_axis_label is None: - raise ValueError("Invalid value for `y_axis_label`, must not be `None`") # noqa: E501 - self._y_axis_label = y_axis_label - - @property - def x_prefix(self): - """Get the x_prefix of this HeatmapViewProperties. - - :return: The x_prefix of this HeatmapViewProperties. - :rtype: str - """ # noqa: E501 - return self._x_prefix - - @x_prefix.setter - def x_prefix(self, x_prefix): - """Set the x_prefix of this HeatmapViewProperties. - - :param x_prefix: The x_prefix of this HeatmapViewProperties. - :type: str - """ # noqa: E501 - if x_prefix is None: - raise ValueError("Invalid value for `x_prefix`, must not be `None`") # noqa: E501 - self._x_prefix = x_prefix - - @property - def x_suffix(self): - """Get the x_suffix of this HeatmapViewProperties. - - :return: The x_suffix of this HeatmapViewProperties. - :rtype: str - """ # noqa: E501 - return self._x_suffix - - @x_suffix.setter - def x_suffix(self, x_suffix): - """Set the x_suffix of this HeatmapViewProperties. - - :param x_suffix: The x_suffix of this HeatmapViewProperties. - :type: str - """ # noqa: E501 - if x_suffix is None: - raise ValueError("Invalid value for `x_suffix`, must not be `None`") # noqa: E501 - self._x_suffix = x_suffix - - @property - def y_prefix(self): - """Get the y_prefix of this HeatmapViewProperties. - - :return: The y_prefix of this HeatmapViewProperties. - :rtype: str - """ # noqa: E501 - return self._y_prefix - - @y_prefix.setter - def y_prefix(self, y_prefix): - """Set the y_prefix of this HeatmapViewProperties. - - :param y_prefix: The y_prefix of this HeatmapViewProperties. - :type: str - """ # noqa: E501 - if y_prefix is None: - raise ValueError("Invalid value for `y_prefix`, must not be `None`") # noqa: E501 - self._y_prefix = y_prefix - - @property - def y_suffix(self): - """Get the y_suffix of this HeatmapViewProperties. - - :return: The y_suffix of this HeatmapViewProperties. - :rtype: str - """ # noqa: E501 - return self._y_suffix - - @y_suffix.setter - def y_suffix(self, y_suffix): - """Set the y_suffix of this HeatmapViewProperties. - - :param y_suffix: The y_suffix of this HeatmapViewProperties. - :type: str - """ # noqa: E501 - if y_suffix is None: - raise ValueError("Invalid value for `y_suffix`, must not be `None`") # noqa: E501 - self._y_suffix = y_suffix - - @property - def bin_size(self): - """Get the bin_size of this HeatmapViewProperties. - - :return: The bin_size of this HeatmapViewProperties. - :rtype: float - """ # noqa: E501 - return self._bin_size - - @bin_size.setter - def bin_size(self, bin_size): - """Set the bin_size of this HeatmapViewProperties. - - :param bin_size: The bin_size of this HeatmapViewProperties. - :type: float - """ # noqa: E501 - if bin_size is None: - raise ValueError("Invalid value for `bin_size`, must not be `None`") # noqa: E501 - self._bin_size = bin_size - - @property - def legend_colorize_rows(self): - """Get the legend_colorize_rows of this HeatmapViewProperties. - - :return: The legend_colorize_rows of this HeatmapViewProperties. - :rtype: bool - """ # noqa: E501 - return self._legend_colorize_rows - - @legend_colorize_rows.setter - def legend_colorize_rows(self, legend_colorize_rows): - """Set the legend_colorize_rows of this HeatmapViewProperties. - - :param legend_colorize_rows: The legend_colorize_rows of this HeatmapViewProperties. - :type: bool - """ # noqa: E501 - self._legend_colorize_rows = legend_colorize_rows - - @property - def legend_hide(self): - """Get the legend_hide of this HeatmapViewProperties. - - :return: The legend_hide of this HeatmapViewProperties. - :rtype: bool - """ # noqa: E501 - return self._legend_hide - - @legend_hide.setter - def legend_hide(self, legend_hide): - """Set the legend_hide of this HeatmapViewProperties. - - :param legend_hide: The legend_hide of this HeatmapViewProperties. - :type: bool - """ # noqa: E501 - self._legend_hide = legend_hide - - @property - def legend_opacity(self): - """Get the legend_opacity of this HeatmapViewProperties. - - :return: The legend_opacity of this HeatmapViewProperties. - :rtype: float - """ # noqa: E501 - return self._legend_opacity - - @legend_opacity.setter - def legend_opacity(self, legend_opacity): - """Set the legend_opacity of this HeatmapViewProperties. - - :param legend_opacity: The legend_opacity of this HeatmapViewProperties. - :type: float - """ # noqa: E501 - self._legend_opacity = legend_opacity - - @property - def legend_orientation_threshold(self): - """Get the legend_orientation_threshold of this HeatmapViewProperties. - - :return: The legend_orientation_threshold of this HeatmapViewProperties. - :rtype: int - """ # noqa: E501 - return self._legend_orientation_threshold - - @legend_orientation_threshold.setter - def legend_orientation_threshold(self, legend_orientation_threshold): - """Set the legend_orientation_threshold of this HeatmapViewProperties. - - :param legend_orientation_threshold: The legend_orientation_threshold of this HeatmapViewProperties. - :type: int - """ # noqa: E501 - self._legend_orientation_threshold = legend_orientation_threshold - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, HeatmapViewProperties): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/histogram_view_properties.py b/frogpilot/third_party/influxdb_client/domain/histogram_view_properties.py deleted file mode 100644 index 75057430..00000000 --- a/frogpilot/third_party/influxdb_client/domain/histogram_view_properties.py +++ /dev/null @@ -1,476 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.view_properties import ViewProperties - - -class HistogramViewProperties(ViewProperties): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'queries': 'list[DashboardQuery]', - 'colors': 'list[DashboardColor]', - 'shape': 'str', - 'note': 'str', - 'show_note_when_empty': 'bool', - 'x_column': 'str', - 'fill_columns': 'list[str]', - 'x_domain': 'list[float]', - 'x_axis_label': 'str', - 'position': 'str', - 'bin_count': 'int', - 'legend_colorize_rows': 'bool', - 'legend_hide': 'bool', - 'legend_opacity': 'float', - 'legend_orientation_threshold': 'int' - } - - attribute_map = { - 'type': 'type', - 'queries': 'queries', - 'colors': 'colors', - 'shape': 'shape', - 'note': 'note', - 'show_note_when_empty': 'showNoteWhenEmpty', - 'x_column': 'xColumn', - 'fill_columns': 'fillColumns', - 'x_domain': 'xDomain', - 'x_axis_label': 'xAxisLabel', - 'position': 'position', - 'bin_count': 'binCount', - 'legend_colorize_rows': 'legendColorizeRows', - 'legend_hide': 'legendHide', - 'legend_opacity': 'legendOpacity', - 'legend_orientation_threshold': 'legendOrientationThreshold' - } - - def __init__(self, type=None, queries=None, colors=None, shape=None, note=None, show_note_when_empty=None, x_column=None, fill_columns=None, x_domain=None, x_axis_label=None, position=None, bin_count=None, legend_colorize_rows=None, legend_hide=None, legend_opacity=None, legend_orientation_threshold=None): # noqa: E501,D401,D403 - """HistogramViewProperties - a model defined in OpenAPI.""" # noqa: E501 - ViewProperties.__init__(self) # noqa: E501 - - self._type = None - self._queries = None - self._colors = None - self._shape = None - self._note = None - self._show_note_when_empty = None - self._x_column = None - self._fill_columns = None - self._x_domain = None - self._x_axis_label = None - self._position = None - self._bin_count = None - self._legend_colorize_rows = None - self._legend_hide = None - self._legend_opacity = None - self._legend_orientation_threshold = None - self.discriminator = None - - self.type = type - self.queries = queries - self.colors = colors - self.shape = shape - self.note = note - self.show_note_when_empty = show_note_when_empty - self.x_column = x_column - self.fill_columns = fill_columns - self.x_domain = x_domain - self.x_axis_label = x_axis_label - self.position = position - self.bin_count = bin_count - if legend_colorize_rows is not None: - self.legend_colorize_rows = legend_colorize_rows - if legend_hide is not None: - self.legend_hide = legend_hide - if legend_opacity is not None: - self.legend_opacity = legend_opacity - if legend_orientation_threshold is not None: - self.legend_orientation_threshold = legend_orientation_threshold - - @property - def type(self): - """Get the type of this HistogramViewProperties. - - :return: The type of this HistogramViewProperties. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this HistogramViewProperties. - - :param type: The type of this HistogramViewProperties. - :type: str - """ # noqa: E501 - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - self._type = type - - @property - def queries(self): - """Get the queries of this HistogramViewProperties. - - :return: The queries of this HistogramViewProperties. - :rtype: list[DashboardQuery] - """ # noqa: E501 - return self._queries - - @queries.setter - def queries(self, queries): - """Set the queries of this HistogramViewProperties. - - :param queries: The queries of this HistogramViewProperties. - :type: list[DashboardQuery] - """ # noqa: E501 - if queries is None: - raise ValueError("Invalid value for `queries`, must not be `None`") # noqa: E501 - self._queries = queries - - @property - def colors(self): - """Get the colors of this HistogramViewProperties. - - Colors define color encoding of data into a visualization - - :return: The colors of this HistogramViewProperties. - :rtype: list[DashboardColor] - """ # noqa: E501 - return self._colors - - @colors.setter - def colors(self, colors): - """Set the colors of this HistogramViewProperties. - - Colors define color encoding of data into a visualization - - :param colors: The colors of this HistogramViewProperties. - :type: list[DashboardColor] - """ # noqa: E501 - if colors is None: - raise ValueError("Invalid value for `colors`, must not be `None`") # noqa: E501 - self._colors = colors - - @property - def shape(self): - """Get the shape of this HistogramViewProperties. - - :return: The shape of this HistogramViewProperties. - :rtype: str - """ # noqa: E501 - return self._shape - - @shape.setter - def shape(self, shape): - """Set the shape of this HistogramViewProperties. - - :param shape: The shape of this HistogramViewProperties. - :type: str - """ # noqa: E501 - if shape is None: - raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 - self._shape = shape - - @property - def note(self): - """Get the note of this HistogramViewProperties. - - :return: The note of this HistogramViewProperties. - :rtype: str - """ # noqa: E501 - return self._note - - @note.setter - def note(self, note): - """Set the note of this HistogramViewProperties. - - :param note: The note of this HistogramViewProperties. - :type: str - """ # noqa: E501 - if note is None: - raise ValueError("Invalid value for `note`, must not be `None`") # noqa: E501 - self._note = note - - @property - def show_note_when_empty(self): - """Get the show_note_when_empty of this HistogramViewProperties. - - If true, will display note when empty - - :return: The show_note_when_empty of this HistogramViewProperties. - :rtype: bool - """ # noqa: E501 - return self._show_note_when_empty - - @show_note_when_empty.setter - def show_note_when_empty(self, show_note_when_empty): - """Set the show_note_when_empty of this HistogramViewProperties. - - If true, will display note when empty - - :param show_note_when_empty: The show_note_when_empty of this HistogramViewProperties. - :type: bool - """ # noqa: E501 - if show_note_when_empty is None: - raise ValueError("Invalid value for `show_note_when_empty`, must not be `None`") # noqa: E501 - self._show_note_when_empty = show_note_when_empty - - @property - def x_column(self): - """Get the x_column of this HistogramViewProperties. - - :return: The x_column of this HistogramViewProperties. - :rtype: str - """ # noqa: E501 - return self._x_column - - @x_column.setter - def x_column(self, x_column): - """Set the x_column of this HistogramViewProperties. - - :param x_column: The x_column of this HistogramViewProperties. - :type: str - """ # noqa: E501 - if x_column is None: - raise ValueError("Invalid value for `x_column`, must not be `None`") # noqa: E501 - self._x_column = x_column - - @property - def fill_columns(self): - """Get the fill_columns of this HistogramViewProperties. - - :return: The fill_columns of this HistogramViewProperties. - :rtype: list[str] - """ # noqa: E501 - return self._fill_columns - - @fill_columns.setter - def fill_columns(self, fill_columns): - """Set the fill_columns of this HistogramViewProperties. - - :param fill_columns: The fill_columns of this HistogramViewProperties. - :type: list[str] - """ # noqa: E501 - if fill_columns is None: - raise ValueError("Invalid value for `fill_columns`, must not be `None`") # noqa: E501 - self._fill_columns = fill_columns - - @property - def x_domain(self): - """Get the x_domain of this HistogramViewProperties. - - :return: The x_domain of this HistogramViewProperties. - :rtype: list[float] - """ # noqa: E501 - return self._x_domain - - @x_domain.setter - def x_domain(self, x_domain): - """Set the x_domain of this HistogramViewProperties. - - :param x_domain: The x_domain of this HistogramViewProperties. - :type: list[float] - """ # noqa: E501 - if x_domain is None: - raise ValueError("Invalid value for `x_domain`, must not be `None`") # noqa: E501 - self._x_domain = x_domain - - @property - def x_axis_label(self): - """Get the x_axis_label of this HistogramViewProperties. - - :return: The x_axis_label of this HistogramViewProperties. - :rtype: str - """ # noqa: E501 - return self._x_axis_label - - @x_axis_label.setter - def x_axis_label(self, x_axis_label): - """Set the x_axis_label of this HistogramViewProperties. - - :param x_axis_label: The x_axis_label of this HistogramViewProperties. - :type: str - """ # noqa: E501 - if x_axis_label is None: - raise ValueError("Invalid value for `x_axis_label`, must not be `None`") # noqa: E501 - self._x_axis_label = x_axis_label - - @property - def position(self): - """Get the position of this HistogramViewProperties. - - :return: The position of this HistogramViewProperties. - :rtype: str - """ # noqa: E501 - return self._position - - @position.setter - def position(self, position): - """Set the position of this HistogramViewProperties. - - :param position: The position of this HistogramViewProperties. - :type: str - """ # noqa: E501 - if position is None: - raise ValueError("Invalid value for `position`, must not be `None`") # noqa: E501 - self._position = position - - @property - def bin_count(self): - """Get the bin_count of this HistogramViewProperties. - - :return: The bin_count of this HistogramViewProperties. - :rtype: int - """ # noqa: E501 - return self._bin_count - - @bin_count.setter - def bin_count(self, bin_count): - """Set the bin_count of this HistogramViewProperties. - - :param bin_count: The bin_count of this HistogramViewProperties. - :type: int - """ # noqa: E501 - if bin_count is None: - raise ValueError("Invalid value for `bin_count`, must not be `None`") # noqa: E501 - self._bin_count = bin_count - - @property - def legend_colorize_rows(self): - """Get the legend_colorize_rows of this HistogramViewProperties. - - :return: The legend_colorize_rows of this HistogramViewProperties. - :rtype: bool - """ # noqa: E501 - return self._legend_colorize_rows - - @legend_colorize_rows.setter - def legend_colorize_rows(self, legend_colorize_rows): - """Set the legend_colorize_rows of this HistogramViewProperties. - - :param legend_colorize_rows: The legend_colorize_rows of this HistogramViewProperties. - :type: bool - """ # noqa: E501 - self._legend_colorize_rows = legend_colorize_rows - - @property - def legend_hide(self): - """Get the legend_hide of this HistogramViewProperties. - - :return: The legend_hide of this HistogramViewProperties. - :rtype: bool - """ # noqa: E501 - return self._legend_hide - - @legend_hide.setter - def legend_hide(self, legend_hide): - """Set the legend_hide of this HistogramViewProperties. - - :param legend_hide: The legend_hide of this HistogramViewProperties. - :type: bool - """ # noqa: E501 - self._legend_hide = legend_hide - - @property - def legend_opacity(self): - """Get the legend_opacity of this HistogramViewProperties. - - :return: The legend_opacity of this HistogramViewProperties. - :rtype: float - """ # noqa: E501 - return self._legend_opacity - - @legend_opacity.setter - def legend_opacity(self, legend_opacity): - """Set the legend_opacity of this HistogramViewProperties. - - :param legend_opacity: The legend_opacity of this HistogramViewProperties. - :type: float - """ # noqa: E501 - self._legend_opacity = legend_opacity - - @property - def legend_orientation_threshold(self): - """Get the legend_orientation_threshold of this HistogramViewProperties. - - :return: The legend_orientation_threshold of this HistogramViewProperties. - :rtype: int - """ # noqa: E501 - return self._legend_orientation_threshold - - @legend_orientation_threshold.setter - def legend_orientation_threshold(self, legend_orientation_threshold): - """Set the legend_orientation_threshold of this HistogramViewProperties. - - :param legend_orientation_threshold: The legend_orientation_threshold of this HistogramViewProperties. - :type: int - """ # noqa: E501 - self._legend_orientation_threshold = legend_orientation_threshold - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, HistogramViewProperties): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/http_notification_endpoint.py b/frogpilot/third_party/influxdb_client/domain/http_notification_endpoint.py deleted file mode 100644 index d8a48851..00000000 --- a/frogpilot/third_party/influxdb_client/domain/http_notification_endpoint.py +++ /dev/null @@ -1,301 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.notification_endpoint_discriminator import NotificationEndpointDiscriminator - - -class HTTPNotificationEndpoint(NotificationEndpointDiscriminator): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'url': 'str', - 'username': 'str', - 'password': 'str', - 'token': 'str', - 'method': 'str', - 'auth_method': 'str', - 'content_template': 'str', - 'headers': 'dict(str, str)', - 'id': 'str', - 'org_id': 'str', - 'user_id': 'str', - 'created_at': 'datetime', - 'updated_at': 'datetime', - 'description': 'str', - 'name': 'str', - 'status': 'str', - 'labels': 'list[Label]', - 'links': 'NotificationEndpointBaseLinks', - 'type': 'NotificationEndpointType' - } - - attribute_map = { - 'url': 'url', - 'username': 'username', - 'password': 'password', - 'token': 'token', - 'method': 'method', - 'auth_method': 'authMethod', - 'content_template': 'contentTemplate', - 'headers': 'headers', - 'id': 'id', - 'org_id': 'orgID', - 'user_id': 'userID', - 'created_at': 'createdAt', - 'updated_at': 'updatedAt', - 'description': 'description', - 'name': 'name', - 'status': 'status', - 'labels': 'labels', - 'links': 'links', - 'type': 'type' - } - - def __init__(self, url=None, username=None, password=None, token=None, method=None, auth_method=None, content_template=None, headers=None, id=None, org_id=None, user_id=None, created_at=None, updated_at=None, description=None, name=None, status='active', labels=None, links=None, type="http"): # noqa: E501,D401,D403 - """HTTPNotificationEndpoint - a model defined in OpenAPI.""" # noqa: E501 - NotificationEndpointDiscriminator.__init__(self, id=id, org_id=org_id, user_id=user_id, created_at=created_at, updated_at=updated_at, description=description, name=name, status=status, labels=labels, links=links, type=type) # noqa: E501 - - self._url = None - self._username = None - self._password = None - self._token = None - self._method = None - self._auth_method = None - self._content_template = None - self._headers = None - self.discriminator = None - - self.url = url - if username is not None: - self.username = username - if password is not None: - self.password = password - if token is not None: - self.token = token - self.method = method - self.auth_method = auth_method - if content_template is not None: - self.content_template = content_template - if headers is not None: - self.headers = headers - - @property - def url(self): - """Get the url of this HTTPNotificationEndpoint. - - :return: The url of this HTTPNotificationEndpoint. - :rtype: str - """ # noqa: E501 - return self._url - - @url.setter - def url(self, url): - """Set the url of this HTTPNotificationEndpoint. - - :param url: The url of this HTTPNotificationEndpoint. - :type: str - """ # noqa: E501 - if url is None: - raise ValueError("Invalid value for `url`, must not be `None`") # noqa: E501 - self._url = url - - @property - def username(self): - """Get the username of this HTTPNotificationEndpoint. - - :return: The username of this HTTPNotificationEndpoint. - :rtype: str - """ # noqa: E501 - return self._username - - @username.setter - def username(self, username): - """Set the username of this HTTPNotificationEndpoint. - - :param username: The username of this HTTPNotificationEndpoint. - :type: str - """ # noqa: E501 - self._username = username - - @property - def password(self): - """Get the password of this HTTPNotificationEndpoint. - - :return: The password of this HTTPNotificationEndpoint. - :rtype: str - """ # noqa: E501 - return self._password - - @password.setter - def password(self, password): - """Set the password of this HTTPNotificationEndpoint. - - :param password: The password of this HTTPNotificationEndpoint. - :type: str - """ # noqa: E501 - self._password = password - - @property - def token(self): - """Get the token of this HTTPNotificationEndpoint. - - :return: The token of this HTTPNotificationEndpoint. - :rtype: str - """ # noqa: E501 - return self._token - - @token.setter - def token(self, token): - """Set the token of this HTTPNotificationEndpoint. - - :param token: The token of this HTTPNotificationEndpoint. - :type: str - """ # noqa: E501 - self._token = token - - @property - def method(self): - """Get the method of this HTTPNotificationEndpoint. - - :return: The method of this HTTPNotificationEndpoint. - :rtype: str - """ # noqa: E501 - return self._method - - @method.setter - def method(self, method): - """Set the method of this HTTPNotificationEndpoint. - - :param method: The method of this HTTPNotificationEndpoint. - :type: str - """ # noqa: E501 - if method is None: - raise ValueError("Invalid value for `method`, must not be `None`") # noqa: E501 - self._method = method - - @property - def auth_method(self): - """Get the auth_method of this HTTPNotificationEndpoint. - - :return: The auth_method of this HTTPNotificationEndpoint. - :rtype: str - """ # noqa: E501 - return self._auth_method - - @auth_method.setter - def auth_method(self, auth_method): - """Set the auth_method of this HTTPNotificationEndpoint. - - :param auth_method: The auth_method of this HTTPNotificationEndpoint. - :type: str - """ # noqa: E501 - if auth_method is None: - raise ValueError("Invalid value for `auth_method`, must not be `None`") # noqa: E501 - self._auth_method = auth_method - - @property - def content_template(self): - """Get the content_template of this HTTPNotificationEndpoint. - - :return: The content_template of this HTTPNotificationEndpoint. - :rtype: str - """ # noqa: E501 - return self._content_template - - @content_template.setter - def content_template(self, content_template): - """Set the content_template of this HTTPNotificationEndpoint. - - :param content_template: The content_template of this HTTPNotificationEndpoint. - :type: str - """ # noqa: E501 - self._content_template = content_template - - @property - def headers(self): - """Get the headers of this HTTPNotificationEndpoint. - - Customized headers. - - :return: The headers of this HTTPNotificationEndpoint. - :rtype: dict(str, str) - """ # noqa: E501 - return self._headers - - @headers.setter - def headers(self, headers): - """Set the headers of this HTTPNotificationEndpoint. - - Customized headers. - - :param headers: The headers of this HTTPNotificationEndpoint. - :type: dict(str, str) - """ # noqa: E501 - self._headers = headers - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, HTTPNotificationEndpoint): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/http_notification_rule.py b/frogpilot/third_party/influxdb_client/domain/http_notification_rule.py deleted file mode 100644 index 050b3fcc..00000000 --- a/frogpilot/third_party/influxdb_client/domain/http_notification_rule.py +++ /dev/null @@ -1,136 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.http_notification_rule_base import HTTPNotificationRuleBase - - -class HTTPNotificationRule(HTTPNotificationRuleBase): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'url': 'str', - 'latest_completed': 'datetime', - 'last_run_status': 'str', - 'last_run_error': 'str', - 'id': 'str', - 'endpoint_id': 'str', - 'org_id': 'str', - 'task_id': 'str', - 'owner_id': 'str', - 'created_at': 'datetime', - 'updated_at': 'datetime', - 'status': 'TaskStatusType', - 'name': 'str', - 'sleep_until': 'str', - 'every': 'str', - 'offset': 'str', - 'runbook_link': 'str', - 'limit_every': 'int', - 'limit': 'int', - 'tag_rules': 'list[TagRule]', - 'description': 'str', - 'status_rules': 'list[StatusRule]', - 'labels': 'list[Label]', - 'links': 'NotificationRuleBaseLinks' - } - - attribute_map = { - 'type': 'type', - 'url': 'url', - 'latest_completed': 'latestCompleted', - 'last_run_status': 'lastRunStatus', - 'last_run_error': 'lastRunError', - 'id': 'id', - 'endpoint_id': 'endpointID', - 'org_id': 'orgID', - 'task_id': 'taskID', - 'owner_id': 'ownerID', - 'created_at': 'createdAt', - 'updated_at': 'updatedAt', - 'status': 'status', - 'name': 'name', - 'sleep_until': 'sleepUntil', - 'every': 'every', - 'offset': 'offset', - 'runbook_link': 'runbookLink', - 'limit_every': 'limitEvery', - 'limit': 'limit', - 'tag_rules': 'tagRules', - 'description': 'description', - 'status_rules': 'statusRules', - 'labels': 'labels', - 'links': 'links' - } - - def __init__(self, type="http", url=None, latest_completed=None, last_run_status=None, last_run_error=None, id=None, endpoint_id=None, org_id=None, task_id=None, owner_id=None, created_at=None, updated_at=None, status=None, name=None, sleep_until=None, every=None, offset=None, runbook_link=None, limit_every=None, limit=None, tag_rules=None, description=None, status_rules=None, labels=None, links=None): # noqa: E501,D401,D403 - """HTTPNotificationRule - a model defined in OpenAPI.""" # noqa: E501 - HTTPNotificationRuleBase.__init__(self, type=type, url=url, latest_completed=latest_completed, last_run_status=last_run_status, last_run_error=last_run_error, id=id, endpoint_id=endpoint_id, org_id=org_id, task_id=task_id, owner_id=owner_id, created_at=created_at, updated_at=updated_at, status=status, name=name, sleep_until=sleep_until, every=every, offset=offset, runbook_link=runbook_link, limit_every=limit_every, limit=limit, tag_rules=tag_rules, description=description, status_rules=status_rules, labels=labels, links=links) # noqa: E501 - self.discriminator = None - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, HTTPNotificationRule): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/http_notification_rule_base.py b/frogpilot/third_party/influxdb_client/domain/http_notification_rule_base.py deleted file mode 100644 index 521f9084..00000000 --- a/frogpilot/third_party/influxdb_client/domain/http_notification_rule_base.py +++ /dev/null @@ -1,181 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.notification_rule_discriminator import NotificationRuleDiscriminator - - -class HTTPNotificationRuleBase(NotificationRuleDiscriminator): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'url': 'str', - 'latest_completed': 'datetime', - 'last_run_status': 'str', - 'last_run_error': 'str', - 'id': 'str', - 'endpoint_id': 'str', - 'org_id': 'str', - 'task_id': 'str', - 'owner_id': 'str', - 'created_at': 'datetime', - 'updated_at': 'datetime', - 'status': 'TaskStatusType', - 'name': 'str', - 'sleep_until': 'str', - 'every': 'str', - 'offset': 'str', - 'runbook_link': 'str', - 'limit_every': 'int', - 'limit': 'int', - 'tag_rules': 'list[TagRule]', - 'description': 'str', - 'status_rules': 'list[StatusRule]', - 'labels': 'list[Label]', - 'links': 'NotificationRuleBaseLinks' - } - - attribute_map = { - 'type': 'type', - 'url': 'url', - 'latest_completed': 'latestCompleted', - 'last_run_status': 'lastRunStatus', - 'last_run_error': 'lastRunError', - 'id': 'id', - 'endpoint_id': 'endpointID', - 'org_id': 'orgID', - 'task_id': 'taskID', - 'owner_id': 'ownerID', - 'created_at': 'createdAt', - 'updated_at': 'updatedAt', - 'status': 'status', - 'name': 'name', - 'sleep_until': 'sleepUntil', - 'every': 'every', - 'offset': 'offset', - 'runbook_link': 'runbookLink', - 'limit_every': 'limitEvery', - 'limit': 'limit', - 'tag_rules': 'tagRules', - 'description': 'description', - 'status_rules': 'statusRules', - 'labels': 'labels', - 'links': 'links' - } - - def __init__(self, type=None, url=None, latest_completed=None, last_run_status=None, last_run_error=None, id=None, endpoint_id=None, org_id=None, task_id=None, owner_id=None, created_at=None, updated_at=None, status=None, name=None, sleep_until=None, every=None, offset=None, runbook_link=None, limit_every=None, limit=None, tag_rules=None, description=None, status_rules=None, labels=None, links=None): # noqa: E501,D401,D403 - """HTTPNotificationRuleBase - a model defined in OpenAPI.""" # noqa: E501 - NotificationRuleDiscriminator.__init__(self, latest_completed=latest_completed, last_run_status=last_run_status, last_run_error=last_run_error, id=id, endpoint_id=endpoint_id, org_id=org_id, task_id=task_id, owner_id=owner_id, created_at=created_at, updated_at=updated_at, status=status, name=name, sleep_until=sleep_until, every=every, offset=offset, runbook_link=runbook_link, limit_every=limit_every, limit=limit, tag_rules=tag_rules, description=description, status_rules=status_rules, labels=labels, links=links) # noqa: E501 - - self._type = None - self._url = None - self.discriminator = None - - self.type = type - if url is not None: - self.url = url - - @property - def type(self): - """Get the type of this HTTPNotificationRuleBase. - - :return: The type of this HTTPNotificationRuleBase. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this HTTPNotificationRuleBase. - - :param type: The type of this HTTPNotificationRuleBase. - :type: str - """ # noqa: E501 - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - self._type = type - - @property - def url(self): - """Get the url of this HTTPNotificationRuleBase. - - :return: The url of this HTTPNotificationRuleBase. - :rtype: str - """ # noqa: E501 - return self._url - - @url.setter - def url(self, url): - """Set the url of this HTTPNotificationRuleBase. - - :param url: The url of this HTTPNotificationRuleBase. - :type: str - """ # noqa: E501 - self._url = url - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, HTTPNotificationRuleBase): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/identifier.py b/frogpilot/third_party/influxdb_client/domain/identifier.py deleted file mode 100644 index aa9a3fb2..00000000 --- a/frogpilot/third_party/influxdb_client/domain/identifier.py +++ /dev/null @@ -1,138 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.property_key import PropertyKey - - -class Identifier(PropertyKey): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'name': 'str' - } - - attribute_map = { - 'type': 'type', - 'name': 'name' - } - - def __init__(self, type=None, name=None): # noqa: E501,D401,D403 - """Identifier - a model defined in OpenAPI.""" # noqa: E501 - PropertyKey.__init__(self) # noqa: E501 - - self._type = None - self._name = None - self.discriminator = None - - if type is not None: - self.type = type - if name is not None: - self.name = name - - @property - def type(self): - """Get the type of this Identifier. - - Type of AST node - - :return: The type of this Identifier. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this Identifier. - - Type of AST node - - :param type: The type of this Identifier. - :type: str - """ # noqa: E501 - self._type = type - - @property - def name(self): - """Get the name of this Identifier. - - :return: The name of this Identifier. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this Identifier. - - :param name: The name of this Identifier. - :type: str - """ # noqa: E501 - self._name = name - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Identifier): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/import_declaration.py b/frogpilot/third_party/influxdb_client/domain/import_declaration.py deleted file mode 100644 index 435380cf..00000000 --- a/frogpilot/third_party/influxdb_client/domain/import_declaration.py +++ /dev/null @@ -1,157 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class ImportDeclaration(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - '_as': 'Identifier', - 'path': 'StringLiteral' - } - - attribute_map = { - 'type': 'type', - '_as': 'as', - 'path': 'path' - } - - def __init__(self, type=None, _as=None, path=None): # noqa: E501,D401,D403 - """ImportDeclaration - a model defined in OpenAPI.""" # noqa: E501 - self._type = None - self.__as = None - self._path = None - self.discriminator = None - - if type is not None: - self.type = type - if _as is not None: - self._as = _as - if path is not None: - self.path = path - - @property - def type(self): - """Get the type of this ImportDeclaration. - - Type of AST node - - :return: The type of this ImportDeclaration. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this ImportDeclaration. - - Type of AST node - - :param type: The type of this ImportDeclaration. - :type: str - """ # noqa: E501 - self._type = type - - @property - def _as(self): - """Get the _as of this ImportDeclaration. - - :return: The _as of this ImportDeclaration. - :rtype: Identifier - """ # noqa: E501 - return self.__as - - @_as.setter - def _as(self, _as): - """Set the _as of this ImportDeclaration. - - :param _as: The _as of this ImportDeclaration. - :type: Identifier - """ # noqa: E501 - self.__as = _as - - @property - def path(self): - """Get the path of this ImportDeclaration. - - :return: The path of this ImportDeclaration. - :rtype: StringLiteral - """ # noqa: E501 - return self._path - - @path.setter - def path(self, path): - """Set the path of this ImportDeclaration. - - :param path: The path of this ImportDeclaration. - :type: StringLiteral - """ # noqa: E501 - self._path = path - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, ImportDeclaration): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/index_expression.py b/frogpilot/third_party/influxdb_client/domain/index_expression.py deleted file mode 100644 index 4aedd731..00000000 --- a/frogpilot/third_party/influxdb_client/domain/index_expression.py +++ /dev/null @@ -1,161 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.expression import Expression - - -class IndexExpression(Expression): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'array': 'Expression', - 'index': 'Expression' - } - - attribute_map = { - 'type': 'type', - 'array': 'array', - 'index': 'index' - } - - def __init__(self, type=None, array=None, index=None): # noqa: E501,D401,D403 - """IndexExpression - a model defined in OpenAPI.""" # noqa: E501 - Expression.__init__(self) # noqa: E501 - - self._type = None - self._array = None - self._index = None - self.discriminator = None - - if type is not None: - self.type = type - if array is not None: - self.array = array - if index is not None: - self.index = index - - @property - def type(self): - """Get the type of this IndexExpression. - - Type of AST node - - :return: The type of this IndexExpression. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this IndexExpression. - - Type of AST node - - :param type: The type of this IndexExpression. - :type: str - """ # noqa: E501 - self._type = type - - @property - def array(self): - """Get the array of this IndexExpression. - - :return: The array of this IndexExpression. - :rtype: Expression - """ # noqa: E501 - return self._array - - @array.setter - def array(self, array): - """Set the array of this IndexExpression. - - :param array: The array of this IndexExpression. - :type: Expression - """ # noqa: E501 - self._array = array - - @property - def index(self): - """Get the index of this IndexExpression. - - :return: The index of this IndexExpression. - :rtype: Expression - """ # noqa: E501 - return self._index - - @index.setter - def index(self, index): - """Set the index of this IndexExpression. - - :param index: The index of this IndexExpression. - :type: Expression - """ # noqa: E501 - self._index = index - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, IndexExpression): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/integer_literal.py b/frogpilot/third_party/influxdb_client/domain/integer_literal.py deleted file mode 100644 index dcedf78d..00000000 --- a/frogpilot/third_party/influxdb_client/domain/integer_literal.py +++ /dev/null @@ -1,138 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.expression import Expression - - -class IntegerLiteral(Expression): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'value': 'str' - } - - attribute_map = { - 'type': 'type', - 'value': 'value' - } - - def __init__(self, type=None, value=None): # noqa: E501,D401,D403 - """IntegerLiteral - a model defined in OpenAPI.""" # noqa: E501 - Expression.__init__(self) # noqa: E501 - - self._type = None - self._value = None - self.discriminator = None - - if type is not None: - self.type = type - if value is not None: - self.value = value - - @property - def type(self): - """Get the type of this IntegerLiteral. - - Type of AST node - - :return: The type of this IntegerLiteral. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this IntegerLiteral. - - Type of AST node - - :param type: The type of this IntegerLiteral. - :type: str - """ # noqa: E501 - self._type = type - - @property - def value(self): - """Get the value of this IntegerLiteral. - - :return: The value of this IntegerLiteral. - :rtype: str - """ # noqa: E501 - return self._value - - @value.setter - def value(self, value): - """Set the value of this IntegerLiteral. - - :param value: The value of this IntegerLiteral. - :type: str - """ # noqa: E501 - self._value = value - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, IntegerLiteral): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/is_onboarding.py b/frogpilot/third_party/influxdb_client/domain/is_onboarding.py deleted file mode 100644 index 0e14abdb..00000000 --- a/frogpilot/third_party/influxdb_client/domain/is_onboarding.py +++ /dev/null @@ -1,111 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class IsOnboarding(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'allowed': 'bool' - } - - attribute_map = { - 'allowed': 'allowed' - } - - def __init__(self, allowed=None): # noqa: E501,D401,D403 - """IsOnboarding - a model defined in OpenAPI.""" # noqa: E501 - self._allowed = None - self.discriminator = None - - if allowed is not None: - self.allowed = allowed - - @property - def allowed(self): - """Get the allowed of this IsOnboarding. - - If `true`, the InfluxDB instance hasn't had initial setup; `false` otherwise. - - :return: The allowed of this IsOnboarding. - :rtype: bool - """ # noqa: E501 - return self._allowed - - @allowed.setter - def allowed(self, allowed): - """Set the allowed of this IsOnboarding. - - If `true`, the InfluxDB instance hasn't had initial setup; `false` otherwise. - - :param allowed: The allowed of this IsOnboarding. - :type: bool - """ # noqa: E501 - self._allowed = allowed - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, IsOnboarding): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/label.py b/frogpilot/third_party/influxdb_client/domain/label.py deleted file mode 100644 index cceaab95..00000000 --- a/frogpilot/third_party/influxdb_client/domain/label.py +++ /dev/null @@ -1,180 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class Label(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'str', - 'org_id': 'str', - 'name': 'str', - 'properties': 'dict(str, str)' - } - - attribute_map = { - 'id': 'id', - 'org_id': 'orgID', - 'name': 'name', - 'properties': 'properties' - } - - def __init__(self, id=None, org_id=None, name=None, properties=None): # noqa: E501,D401,D403 - """Label - a model defined in OpenAPI.""" # noqa: E501 - self._id = None - self._org_id = None - self._name = None - self._properties = None - self.discriminator = None - - if id is not None: - self.id = id - if org_id is not None: - self.org_id = org_id - if name is not None: - self.name = name - if properties is not None: - self.properties = properties - - @property - def id(self): - """Get the id of this Label. - - :return: The id of this Label. - :rtype: str - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this Label. - - :param id: The id of this Label. - :type: str - """ # noqa: E501 - self._id = id - - @property - def org_id(self): - """Get the org_id of this Label. - - :return: The org_id of this Label. - :rtype: str - """ # noqa: E501 - return self._org_id - - @org_id.setter - def org_id(self, org_id): - """Set the org_id of this Label. - - :param org_id: The org_id of this Label. - :type: str - """ # noqa: E501 - self._org_id = org_id - - @property - def name(self): - """Get the name of this Label. - - :return: The name of this Label. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this Label. - - :param name: The name of this Label. - :type: str - """ # noqa: E501 - self._name = name - - @property - def properties(self): - """Get the properties of this Label. - - Key-value pairs associated with this label. To remove a property, send an update with an empty value (`""`) for the key. - - :return: The properties of this Label. - :rtype: dict(str, str) - """ # noqa: E501 - return self._properties - - @properties.setter - def properties(self, properties): - """Set the properties of this Label. - - Key-value pairs associated with this label. To remove a property, send an update with an empty value (`""`) for the key. - - :param properties: The properties of this Label. - :type: dict(str, str) - """ # noqa: E501 - self._properties = properties - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Label): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/label_create_request.py b/frogpilot/third_party/influxdb_client/domain/label_create_request.py deleted file mode 100644 index 73259eea..00000000 --- a/frogpilot/third_party/influxdb_client/domain/label_create_request.py +++ /dev/null @@ -1,159 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class LabelCreateRequest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'org_id': 'str', - 'name': 'str', - 'properties': 'dict(str, str)' - } - - attribute_map = { - 'org_id': 'orgID', - 'name': 'name', - 'properties': 'properties' - } - - def __init__(self, org_id=None, name=None, properties=None): # noqa: E501,D401,D403 - """LabelCreateRequest - a model defined in OpenAPI.""" # noqa: E501 - self._org_id = None - self._name = None - self._properties = None - self.discriminator = None - - self.org_id = org_id - self.name = name - if properties is not None: - self.properties = properties - - @property - def org_id(self): - """Get the org_id of this LabelCreateRequest. - - :return: The org_id of this LabelCreateRequest. - :rtype: str - """ # noqa: E501 - return self._org_id - - @org_id.setter - def org_id(self, org_id): - """Set the org_id of this LabelCreateRequest. - - :param org_id: The org_id of this LabelCreateRequest. - :type: str - """ # noqa: E501 - if org_id is None: - raise ValueError("Invalid value for `org_id`, must not be `None`") # noqa: E501 - self._org_id = org_id - - @property - def name(self): - """Get the name of this LabelCreateRequest. - - :return: The name of this LabelCreateRequest. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this LabelCreateRequest. - - :param name: The name of this LabelCreateRequest. - :type: str - """ # noqa: E501 - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - self._name = name - - @property - def properties(self): - """Get the properties of this LabelCreateRequest. - - Key-value pairs associated with this label. To remove a property, send an update with an empty value (`""`) for the key. - - :return: The properties of this LabelCreateRequest. - :rtype: dict(str, str) - """ # noqa: E501 - return self._properties - - @properties.setter - def properties(self, properties): - """Set the properties of this LabelCreateRequest. - - Key-value pairs associated with this label. To remove a property, send an update with an empty value (`""`) for the key. - - :param properties: The properties of this LabelCreateRequest. - :type: dict(str, str) - """ # noqa: E501 - self._properties = properties - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, LabelCreateRequest): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/label_mapping.py b/frogpilot/third_party/influxdb_client/domain/label_mapping.py deleted file mode 100644 index 909d1b38..00000000 --- a/frogpilot/third_party/influxdb_client/domain/label_mapping.py +++ /dev/null @@ -1,112 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class LabelMapping(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'label_id': 'str' - } - - attribute_map = { - 'label_id': 'labelID' - } - - def __init__(self, label_id=None): # noqa: E501,D401,D403 - """LabelMapping - a model defined in OpenAPI.""" # noqa: E501 - self._label_id = None - self.discriminator = None - - self.label_id = label_id - - @property - def label_id(self): - """Get the label_id of this LabelMapping. - - A label ID. Specifies the label to attach. - - :return: The label_id of this LabelMapping. - :rtype: str - """ # noqa: E501 - return self._label_id - - @label_id.setter - def label_id(self, label_id): - """Set the label_id of this LabelMapping. - - A label ID. Specifies the label to attach. - - :param label_id: The label_id of this LabelMapping. - :type: str - """ # noqa: E501 - if label_id is None: - raise ValueError("Invalid value for `label_id`, must not be `None`") # noqa: E501 - self._label_id = label_id - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, LabelMapping): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/label_response.py b/frogpilot/third_party/influxdb_client/domain/label_response.py deleted file mode 100644 index 8eed8406..00000000 --- a/frogpilot/third_party/influxdb_client/domain/label_response.py +++ /dev/null @@ -1,130 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class LabelResponse(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'label': 'Label', - 'links': 'Links' - } - - attribute_map = { - 'label': 'label', - 'links': 'links' - } - - def __init__(self, label=None, links=None): # noqa: E501,D401,D403 - """LabelResponse - a model defined in OpenAPI.""" # noqa: E501 - self._label = None - self._links = None - self.discriminator = None - - if label is not None: - self.label = label - if links is not None: - self.links = links - - @property - def label(self): - """Get the label of this LabelResponse. - - :return: The label of this LabelResponse. - :rtype: Label - """ # noqa: E501 - return self._label - - @label.setter - def label(self, label): - """Set the label of this LabelResponse. - - :param label: The label of this LabelResponse. - :type: Label - """ # noqa: E501 - self._label = label - - @property - def links(self): - """Get the links of this LabelResponse. - - :return: The links of this LabelResponse. - :rtype: Links - """ # noqa: E501 - return self._links - - @links.setter - def links(self, links): - """Set the links of this LabelResponse. - - :param links: The links of this LabelResponse. - :type: Links - """ # noqa: E501 - self._links = links - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, LabelResponse): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/label_update.py b/frogpilot/third_party/influxdb_client/domain/label_update.py deleted file mode 100644 index c1a7c7ee..00000000 --- a/frogpilot/third_party/influxdb_client/domain/label_update.py +++ /dev/null @@ -1,130 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class LabelUpdate(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str', - 'properties': 'dict(str, str)' - } - - attribute_map = { - 'name': 'name', - 'properties': 'properties' - } - - def __init__(self, name=None, properties=None): # noqa: E501,D401,D403 - """LabelUpdate - a model defined in OpenAPI.""" # noqa: E501 - self._name = None - self._properties = None - self.discriminator = None - - if name is not None: - self.name = name - if properties is not None: - self.properties = properties - - @property - def name(self): - """Get the name of this LabelUpdate. - - :return: The name of this LabelUpdate. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this LabelUpdate. - - :param name: The name of this LabelUpdate. - :type: str - """ # noqa: E501 - self._name = name - - @property - def properties(self): - """Get the properties of this LabelUpdate. - - :return: The properties of this LabelUpdate. - :rtype: dict(str, str) - """ # noqa: E501 - return self._properties - - @properties.setter - def properties(self, properties): - """Set the properties of this LabelUpdate. - - :param properties: The properties of this LabelUpdate. - :type: dict(str, str) - """ # noqa: E501 - self._properties = properties - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, LabelUpdate): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/labels_response.py b/frogpilot/third_party/influxdb_client/domain/labels_response.py deleted file mode 100644 index fee2fdc9..00000000 --- a/frogpilot/third_party/influxdb_client/domain/labels_response.py +++ /dev/null @@ -1,130 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class LabelsResponse(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'labels': 'list[Label]', - 'links': 'Links' - } - - attribute_map = { - 'labels': 'labels', - 'links': 'links' - } - - def __init__(self, labels=None, links=None): # noqa: E501,D401,D403 - """LabelsResponse - a model defined in OpenAPI.""" # noqa: E501 - self._labels = None - self._links = None - self.discriminator = None - - if labels is not None: - self.labels = labels - if links is not None: - self.links = links - - @property - def labels(self): - """Get the labels of this LabelsResponse. - - :return: The labels of this LabelsResponse. - :rtype: list[Label] - """ # noqa: E501 - return self._labels - - @labels.setter - def labels(self, labels): - """Set the labels of this LabelsResponse. - - :param labels: The labels of this LabelsResponse. - :type: list[Label] - """ # noqa: E501 - self._labels = labels - - @property - def links(self): - """Get the links of this LabelsResponse. - - :return: The links of this LabelsResponse. - :rtype: Links - """ # noqa: E501 - return self._links - - @links.setter - def links(self, links): - """Set the links of this LabelsResponse. - - :param links: The links of this LabelsResponse. - :type: Links - """ # noqa: E501 - self._links = links - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, LabelsResponse): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/language_request.py b/frogpilot/third_party/influxdb_client/domain/language_request.py deleted file mode 100644 index 083e70a2..00000000 --- a/frogpilot/third_party/influxdb_client/domain/language_request.py +++ /dev/null @@ -1,112 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class LanguageRequest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'query': 'str' - } - - attribute_map = { - 'query': 'query' - } - - def __init__(self, query=None): # noqa: E501,D401,D403 - """LanguageRequest - a model defined in OpenAPI.""" # noqa: E501 - self._query = None - self.discriminator = None - - self.query = query - - @property - def query(self): - """Get the query of this LanguageRequest. - - The Flux query script to be analyzed. - - :return: The query of this LanguageRequest. - :rtype: str - """ # noqa: E501 - return self._query - - @query.setter - def query(self, query): - """Set the query of this LanguageRequest. - - The Flux query script to be analyzed. - - :param query: The query of this LanguageRequest. - :type: str - """ # noqa: E501 - if query is None: - raise ValueError("Invalid value for `query`, must not be `None`") # noqa: E501 - self._query = query - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, LanguageRequest): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/legacy_authorization_post_request.py b/frogpilot/third_party/influxdb_client/domain/legacy_authorization_post_request.py deleted file mode 100644 index 2976671b..00000000 --- a/frogpilot/third_party/influxdb_client/domain/legacy_authorization_post_request.py +++ /dev/null @@ -1,200 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.authorization_update_request import AuthorizationUpdateRequest - - -class LegacyAuthorizationPostRequest(AuthorizationUpdateRequest): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'org_id': 'str', - 'user_id': 'str', - 'token': 'str', - 'permissions': 'list[Permission]', - 'status': 'str', - 'description': 'str' - } - - attribute_map = { - 'org_id': 'orgID', - 'user_id': 'userID', - 'token': 'token', - 'permissions': 'permissions', - 'status': 'status', - 'description': 'description' - } - - def __init__(self, org_id=None, user_id=None, token=None, permissions=None, status='active', description=None): # noqa: E501,D401,D403 - """LegacyAuthorizationPostRequest - a model defined in OpenAPI.""" # noqa: E501 - AuthorizationUpdateRequest.__init__(self, status=status, description=description) # noqa: E501 - - self._org_id = None - self._user_id = None - self._token = None - self._permissions = None - self.discriminator = None - - if org_id is not None: - self.org_id = org_id - if user_id is not None: - self.user_id = user_id - if token is not None: - self.token = token - if permissions is not None: - self.permissions = permissions - - @property - def org_id(self): - """Get the org_id of this LegacyAuthorizationPostRequest. - - ID of org that authorization is scoped to. - - :return: The org_id of this LegacyAuthorizationPostRequest. - :rtype: str - """ # noqa: E501 - return self._org_id - - @org_id.setter - def org_id(self, org_id): - """Set the org_id of this LegacyAuthorizationPostRequest. - - ID of org that authorization is scoped to. - - :param org_id: The org_id of this LegacyAuthorizationPostRequest. - :type: str - """ # noqa: E501 - self._org_id = org_id - - @property - def user_id(self): - """Get the user_id of this LegacyAuthorizationPostRequest. - - ID of user that authorization is scoped to. - - :return: The user_id of this LegacyAuthorizationPostRequest. - :rtype: str - """ # noqa: E501 - return self._user_id - - @user_id.setter - def user_id(self, user_id): - """Set the user_id of this LegacyAuthorizationPostRequest. - - ID of user that authorization is scoped to. - - :param user_id: The user_id of this LegacyAuthorizationPostRequest. - :type: str - """ # noqa: E501 - self._user_id = user_id - - @property - def token(self): - """Get the token of this LegacyAuthorizationPostRequest. - - Token (name) of the authorization - - :return: The token of this LegacyAuthorizationPostRequest. - :rtype: str - """ # noqa: E501 - return self._token - - @token.setter - def token(self, token): - """Set the token of this LegacyAuthorizationPostRequest. - - Token (name) of the authorization - - :param token: The token of this LegacyAuthorizationPostRequest. - :type: str - """ # noqa: E501 - self._token = token - - @property - def permissions(self): - """Get the permissions of this LegacyAuthorizationPostRequest. - - List of permissions for an auth. An auth must have at least one Permission. - - :return: The permissions of this LegacyAuthorizationPostRequest. - :rtype: list[Permission] - """ # noqa: E501 - return self._permissions - - @permissions.setter - def permissions(self, permissions): - """Set the permissions of this LegacyAuthorizationPostRequest. - - List of permissions for an auth. An auth must have at least one Permission. - - :param permissions: The permissions of this LegacyAuthorizationPostRequest. - :type: list[Permission] - """ # noqa: E501 - self._permissions = permissions - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, LegacyAuthorizationPostRequest): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/lesser_threshold.py b/frogpilot/third_party/influxdb_client/domain/lesser_threshold.py deleted file mode 100644 index a75a19e2..00000000 --- a/frogpilot/third_party/influxdb_client/domain/lesser_threshold.py +++ /dev/null @@ -1,140 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.threshold_base import ThresholdBase - - -class LesserThreshold(ThresholdBase): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'value': 'float', - 'level': 'CheckStatusLevel', - 'all_values': 'bool' - } - - attribute_map = { - 'type': 'type', - 'value': 'value', - 'level': 'level', - 'all_values': 'allValues' - } - - def __init__(self, type="lesser", value=None, level=None, all_values=None): # noqa: E501,D401,D403 - """LesserThreshold - a model defined in OpenAPI.""" # noqa: E501 - ThresholdBase.__init__(self, level=level, all_values=all_values) # noqa: E501 - - self._type = None - self._value = None - self.discriminator = None - - self.type = type - self.value = value - - @property - def type(self): - """Get the type of this LesserThreshold. - - :return: The type of this LesserThreshold. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this LesserThreshold. - - :param type: The type of this LesserThreshold. - :type: str - """ # noqa: E501 - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - self._type = type - - @property - def value(self): - """Get the value of this LesserThreshold. - - :return: The value of this LesserThreshold. - :rtype: float - """ # noqa: E501 - return self._value - - @value.setter - def value(self, value): - """Set the value of this LesserThreshold. - - :param value: The value of this LesserThreshold. - :type: float - """ # noqa: E501 - if value is None: - raise ValueError("Invalid value for `value`, must not be `None`") # noqa: E501 - self._value = value - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, LesserThreshold): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/line_plus_single_stat_properties.py b/frogpilot/third_party/influxdb_client/domain/line_plus_single_stat_properties.py deleted file mode 100644 index 5196ba03..00000000 --- a/frogpilot/third_party/influxdb_client/domain/line_plus_single_stat_properties.py +++ /dev/null @@ -1,797 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.view_properties import ViewProperties - - -class LinePlusSingleStatProperties(ViewProperties): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'adaptive_zoom_hide': 'bool', - 'time_format': 'str', - 'type': 'str', - 'queries': 'list[DashboardQuery]', - 'colors': 'list[DashboardColor]', - 'shape': 'str', - 'note': 'str', - 'show_note_when_empty': 'bool', - 'axes': 'Axes', - 'static_legend': 'StaticLegend', - 'x_column': 'str', - 'generate_x_axis_ticks': 'list[str]', - 'x_total_ticks': 'int', - 'x_tick_start': 'float', - 'x_tick_step': 'float', - 'y_column': 'str', - 'generate_y_axis_ticks': 'list[str]', - 'y_total_ticks': 'int', - 'y_tick_start': 'float', - 'y_tick_step': 'float', - 'shade_below': 'bool', - 'hover_dimension': 'str', - 'position': 'str', - 'prefix': 'str', - 'suffix': 'str', - 'decimal_places': 'DecimalPlaces', - 'legend_colorize_rows': 'bool', - 'legend_hide': 'bool', - 'legend_opacity': 'float', - 'legend_orientation_threshold': 'int' - } - - attribute_map = { - 'adaptive_zoom_hide': 'adaptiveZoomHide', - 'time_format': 'timeFormat', - 'type': 'type', - 'queries': 'queries', - 'colors': 'colors', - 'shape': 'shape', - 'note': 'note', - 'show_note_when_empty': 'showNoteWhenEmpty', - 'axes': 'axes', - 'static_legend': 'staticLegend', - 'x_column': 'xColumn', - 'generate_x_axis_ticks': 'generateXAxisTicks', - 'x_total_ticks': 'xTotalTicks', - 'x_tick_start': 'xTickStart', - 'x_tick_step': 'xTickStep', - 'y_column': 'yColumn', - 'generate_y_axis_ticks': 'generateYAxisTicks', - 'y_total_ticks': 'yTotalTicks', - 'y_tick_start': 'yTickStart', - 'y_tick_step': 'yTickStep', - 'shade_below': 'shadeBelow', - 'hover_dimension': 'hoverDimension', - 'position': 'position', - 'prefix': 'prefix', - 'suffix': 'suffix', - 'decimal_places': 'decimalPlaces', - 'legend_colorize_rows': 'legendColorizeRows', - 'legend_hide': 'legendHide', - 'legend_opacity': 'legendOpacity', - 'legend_orientation_threshold': 'legendOrientationThreshold' - } - - def __init__(self, adaptive_zoom_hide=None, time_format=None, type=None, queries=None, colors=None, shape=None, note=None, show_note_when_empty=None, axes=None, static_legend=None, x_column=None, generate_x_axis_ticks=None, x_total_ticks=None, x_tick_start=None, x_tick_step=None, y_column=None, generate_y_axis_ticks=None, y_total_ticks=None, y_tick_start=None, y_tick_step=None, shade_below=None, hover_dimension=None, position=None, prefix=None, suffix=None, decimal_places=None, legend_colorize_rows=None, legend_hide=None, legend_opacity=None, legend_orientation_threshold=None): # noqa: E501,D401,D403 - """LinePlusSingleStatProperties - a model defined in OpenAPI.""" # noqa: E501 - ViewProperties.__init__(self) # noqa: E501 - - self._adaptive_zoom_hide = None - self._time_format = None - self._type = None - self._queries = None - self._colors = None - self._shape = None - self._note = None - self._show_note_when_empty = None - self._axes = None - self._static_legend = None - self._x_column = None - self._generate_x_axis_ticks = None - self._x_total_ticks = None - self._x_tick_start = None - self._x_tick_step = None - self._y_column = None - self._generate_y_axis_ticks = None - self._y_total_ticks = None - self._y_tick_start = None - self._y_tick_step = None - self._shade_below = None - self._hover_dimension = None - self._position = None - self._prefix = None - self._suffix = None - self._decimal_places = None - self._legend_colorize_rows = None - self._legend_hide = None - self._legend_opacity = None - self._legend_orientation_threshold = None - self.discriminator = None - - if adaptive_zoom_hide is not None: - self.adaptive_zoom_hide = adaptive_zoom_hide - if time_format is not None: - self.time_format = time_format - self.type = type - self.queries = queries - self.colors = colors - self.shape = shape - self.note = note - self.show_note_when_empty = show_note_when_empty - self.axes = axes - if static_legend is not None: - self.static_legend = static_legend - if x_column is not None: - self.x_column = x_column - if generate_x_axis_ticks is not None: - self.generate_x_axis_ticks = generate_x_axis_ticks - if x_total_ticks is not None: - self.x_total_ticks = x_total_ticks - if x_tick_start is not None: - self.x_tick_start = x_tick_start - if x_tick_step is not None: - self.x_tick_step = x_tick_step - if y_column is not None: - self.y_column = y_column - if generate_y_axis_ticks is not None: - self.generate_y_axis_ticks = generate_y_axis_ticks - if y_total_ticks is not None: - self.y_total_ticks = y_total_ticks - if y_tick_start is not None: - self.y_tick_start = y_tick_start - if y_tick_step is not None: - self.y_tick_step = y_tick_step - if shade_below is not None: - self.shade_below = shade_below - if hover_dimension is not None: - self.hover_dimension = hover_dimension - self.position = position - self.prefix = prefix - self.suffix = suffix - self.decimal_places = decimal_places - if legend_colorize_rows is not None: - self.legend_colorize_rows = legend_colorize_rows - if legend_hide is not None: - self.legend_hide = legend_hide - if legend_opacity is not None: - self.legend_opacity = legend_opacity - if legend_orientation_threshold is not None: - self.legend_orientation_threshold = legend_orientation_threshold - - @property - def adaptive_zoom_hide(self): - """Get the adaptive_zoom_hide of this LinePlusSingleStatProperties. - - :return: The adaptive_zoom_hide of this LinePlusSingleStatProperties. - :rtype: bool - """ # noqa: E501 - return self._adaptive_zoom_hide - - @adaptive_zoom_hide.setter - def adaptive_zoom_hide(self, adaptive_zoom_hide): - """Set the adaptive_zoom_hide of this LinePlusSingleStatProperties. - - :param adaptive_zoom_hide: The adaptive_zoom_hide of this LinePlusSingleStatProperties. - :type: bool - """ # noqa: E501 - self._adaptive_zoom_hide = adaptive_zoom_hide - - @property - def time_format(self): - """Get the time_format of this LinePlusSingleStatProperties. - - :return: The time_format of this LinePlusSingleStatProperties. - :rtype: str - """ # noqa: E501 - return self._time_format - - @time_format.setter - def time_format(self, time_format): - """Set the time_format of this LinePlusSingleStatProperties. - - :param time_format: The time_format of this LinePlusSingleStatProperties. - :type: str - """ # noqa: E501 - self._time_format = time_format - - @property - def type(self): - """Get the type of this LinePlusSingleStatProperties. - - :return: The type of this LinePlusSingleStatProperties. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this LinePlusSingleStatProperties. - - :param type: The type of this LinePlusSingleStatProperties. - :type: str - """ # noqa: E501 - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - self._type = type - - @property - def queries(self): - """Get the queries of this LinePlusSingleStatProperties. - - :return: The queries of this LinePlusSingleStatProperties. - :rtype: list[DashboardQuery] - """ # noqa: E501 - return self._queries - - @queries.setter - def queries(self, queries): - """Set the queries of this LinePlusSingleStatProperties. - - :param queries: The queries of this LinePlusSingleStatProperties. - :type: list[DashboardQuery] - """ # noqa: E501 - if queries is None: - raise ValueError("Invalid value for `queries`, must not be `None`") # noqa: E501 - self._queries = queries - - @property - def colors(self): - """Get the colors of this LinePlusSingleStatProperties. - - Colors define color encoding of data into a visualization - - :return: The colors of this LinePlusSingleStatProperties. - :rtype: list[DashboardColor] - """ # noqa: E501 - return self._colors - - @colors.setter - def colors(self, colors): - """Set the colors of this LinePlusSingleStatProperties. - - Colors define color encoding of data into a visualization - - :param colors: The colors of this LinePlusSingleStatProperties. - :type: list[DashboardColor] - """ # noqa: E501 - if colors is None: - raise ValueError("Invalid value for `colors`, must not be `None`") # noqa: E501 - self._colors = colors - - @property - def shape(self): - """Get the shape of this LinePlusSingleStatProperties. - - :return: The shape of this LinePlusSingleStatProperties. - :rtype: str - """ # noqa: E501 - return self._shape - - @shape.setter - def shape(self, shape): - """Set the shape of this LinePlusSingleStatProperties. - - :param shape: The shape of this LinePlusSingleStatProperties. - :type: str - """ # noqa: E501 - if shape is None: - raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 - self._shape = shape - - @property - def note(self): - """Get the note of this LinePlusSingleStatProperties. - - :return: The note of this LinePlusSingleStatProperties. - :rtype: str - """ # noqa: E501 - return self._note - - @note.setter - def note(self, note): - """Set the note of this LinePlusSingleStatProperties. - - :param note: The note of this LinePlusSingleStatProperties. - :type: str - """ # noqa: E501 - if note is None: - raise ValueError("Invalid value for `note`, must not be `None`") # noqa: E501 - self._note = note - - @property - def show_note_when_empty(self): - """Get the show_note_when_empty of this LinePlusSingleStatProperties. - - If true, will display note when empty - - :return: The show_note_when_empty of this LinePlusSingleStatProperties. - :rtype: bool - """ # noqa: E501 - return self._show_note_when_empty - - @show_note_when_empty.setter - def show_note_when_empty(self, show_note_when_empty): - """Set the show_note_when_empty of this LinePlusSingleStatProperties. - - If true, will display note when empty - - :param show_note_when_empty: The show_note_when_empty of this LinePlusSingleStatProperties. - :type: bool - """ # noqa: E501 - if show_note_when_empty is None: - raise ValueError("Invalid value for `show_note_when_empty`, must not be `None`") # noqa: E501 - self._show_note_when_empty = show_note_when_empty - - @property - def axes(self): - """Get the axes of this LinePlusSingleStatProperties. - - :return: The axes of this LinePlusSingleStatProperties. - :rtype: Axes - """ # noqa: E501 - return self._axes - - @axes.setter - def axes(self, axes): - """Set the axes of this LinePlusSingleStatProperties. - - :param axes: The axes of this LinePlusSingleStatProperties. - :type: Axes - """ # noqa: E501 - if axes is None: - raise ValueError("Invalid value for `axes`, must not be `None`") # noqa: E501 - self._axes = axes - - @property - def static_legend(self): - """Get the static_legend of this LinePlusSingleStatProperties. - - :return: The static_legend of this LinePlusSingleStatProperties. - :rtype: StaticLegend - """ # noqa: E501 - return self._static_legend - - @static_legend.setter - def static_legend(self, static_legend): - """Set the static_legend of this LinePlusSingleStatProperties. - - :param static_legend: The static_legend of this LinePlusSingleStatProperties. - :type: StaticLegend - """ # noqa: E501 - self._static_legend = static_legend - - @property - def x_column(self): - """Get the x_column of this LinePlusSingleStatProperties. - - :return: The x_column of this LinePlusSingleStatProperties. - :rtype: str - """ # noqa: E501 - return self._x_column - - @x_column.setter - def x_column(self, x_column): - """Set the x_column of this LinePlusSingleStatProperties. - - :param x_column: The x_column of this LinePlusSingleStatProperties. - :type: str - """ # noqa: E501 - self._x_column = x_column - - @property - def generate_x_axis_ticks(self): - """Get the generate_x_axis_ticks of this LinePlusSingleStatProperties. - - :return: The generate_x_axis_ticks of this LinePlusSingleStatProperties. - :rtype: list[str] - """ # noqa: E501 - return self._generate_x_axis_ticks - - @generate_x_axis_ticks.setter - def generate_x_axis_ticks(self, generate_x_axis_ticks): - """Set the generate_x_axis_ticks of this LinePlusSingleStatProperties. - - :param generate_x_axis_ticks: The generate_x_axis_ticks of this LinePlusSingleStatProperties. - :type: list[str] - """ # noqa: E501 - self._generate_x_axis_ticks = generate_x_axis_ticks - - @property - def x_total_ticks(self): - """Get the x_total_ticks of this LinePlusSingleStatProperties. - - :return: The x_total_ticks of this LinePlusSingleStatProperties. - :rtype: int - """ # noqa: E501 - return self._x_total_ticks - - @x_total_ticks.setter - def x_total_ticks(self, x_total_ticks): - """Set the x_total_ticks of this LinePlusSingleStatProperties. - - :param x_total_ticks: The x_total_ticks of this LinePlusSingleStatProperties. - :type: int - """ # noqa: E501 - self._x_total_ticks = x_total_ticks - - @property - def x_tick_start(self): - """Get the x_tick_start of this LinePlusSingleStatProperties. - - :return: The x_tick_start of this LinePlusSingleStatProperties. - :rtype: float - """ # noqa: E501 - return self._x_tick_start - - @x_tick_start.setter - def x_tick_start(self, x_tick_start): - """Set the x_tick_start of this LinePlusSingleStatProperties. - - :param x_tick_start: The x_tick_start of this LinePlusSingleStatProperties. - :type: float - """ # noqa: E501 - self._x_tick_start = x_tick_start - - @property - def x_tick_step(self): - """Get the x_tick_step of this LinePlusSingleStatProperties. - - :return: The x_tick_step of this LinePlusSingleStatProperties. - :rtype: float - """ # noqa: E501 - return self._x_tick_step - - @x_tick_step.setter - def x_tick_step(self, x_tick_step): - """Set the x_tick_step of this LinePlusSingleStatProperties. - - :param x_tick_step: The x_tick_step of this LinePlusSingleStatProperties. - :type: float - """ # noqa: E501 - self._x_tick_step = x_tick_step - - @property - def y_column(self): - """Get the y_column of this LinePlusSingleStatProperties. - - :return: The y_column of this LinePlusSingleStatProperties. - :rtype: str - """ # noqa: E501 - return self._y_column - - @y_column.setter - def y_column(self, y_column): - """Set the y_column of this LinePlusSingleStatProperties. - - :param y_column: The y_column of this LinePlusSingleStatProperties. - :type: str - """ # noqa: E501 - self._y_column = y_column - - @property - def generate_y_axis_ticks(self): - """Get the generate_y_axis_ticks of this LinePlusSingleStatProperties. - - :return: The generate_y_axis_ticks of this LinePlusSingleStatProperties. - :rtype: list[str] - """ # noqa: E501 - return self._generate_y_axis_ticks - - @generate_y_axis_ticks.setter - def generate_y_axis_ticks(self, generate_y_axis_ticks): - """Set the generate_y_axis_ticks of this LinePlusSingleStatProperties. - - :param generate_y_axis_ticks: The generate_y_axis_ticks of this LinePlusSingleStatProperties. - :type: list[str] - """ # noqa: E501 - self._generate_y_axis_ticks = generate_y_axis_ticks - - @property - def y_total_ticks(self): - """Get the y_total_ticks of this LinePlusSingleStatProperties. - - :return: The y_total_ticks of this LinePlusSingleStatProperties. - :rtype: int - """ # noqa: E501 - return self._y_total_ticks - - @y_total_ticks.setter - def y_total_ticks(self, y_total_ticks): - """Set the y_total_ticks of this LinePlusSingleStatProperties. - - :param y_total_ticks: The y_total_ticks of this LinePlusSingleStatProperties. - :type: int - """ # noqa: E501 - self._y_total_ticks = y_total_ticks - - @property - def y_tick_start(self): - """Get the y_tick_start of this LinePlusSingleStatProperties. - - :return: The y_tick_start of this LinePlusSingleStatProperties. - :rtype: float - """ # noqa: E501 - return self._y_tick_start - - @y_tick_start.setter - def y_tick_start(self, y_tick_start): - """Set the y_tick_start of this LinePlusSingleStatProperties. - - :param y_tick_start: The y_tick_start of this LinePlusSingleStatProperties. - :type: float - """ # noqa: E501 - self._y_tick_start = y_tick_start - - @property - def y_tick_step(self): - """Get the y_tick_step of this LinePlusSingleStatProperties. - - :return: The y_tick_step of this LinePlusSingleStatProperties. - :rtype: float - """ # noqa: E501 - return self._y_tick_step - - @y_tick_step.setter - def y_tick_step(self, y_tick_step): - """Set the y_tick_step of this LinePlusSingleStatProperties. - - :param y_tick_step: The y_tick_step of this LinePlusSingleStatProperties. - :type: float - """ # noqa: E501 - self._y_tick_step = y_tick_step - - @property - def shade_below(self): - """Get the shade_below of this LinePlusSingleStatProperties. - - :return: The shade_below of this LinePlusSingleStatProperties. - :rtype: bool - """ # noqa: E501 - return self._shade_below - - @shade_below.setter - def shade_below(self, shade_below): - """Set the shade_below of this LinePlusSingleStatProperties. - - :param shade_below: The shade_below of this LinePlusSingleStatProperties. - :type: bool - """ # noqa: E501 - self._shade_below = shade_below - - @property - def hover_dimension(self): - """Get the hover_dimension of this LinePlusSingleStatProperties. - - :return: The hover_dimension of this LinePlusSingleStatProperties. - :rtype: str - """ # noqa: E501 - return self._hover_dimension - - @hover_dimension.setter - def hover_dimension(self, hover_dimension): - """Set the hover_dimension of this LinePlusSingleStatProperties. - - :param hover_dimension: The hover_dimension of this LinePlusSingleStatProperties. - :type: str - """ # noqa: E501 - self._hover_dimension = hover_dimension - - @property - def position(self): - """Get the position of this LinePlusSingleStatProperties. - - :return: The position of this LinePlusSingleStatProperties. - :rtype: str - """ # noqa: E501 - return self._position - - @position.setter - def position(self, position): - """Set the position of this LinePlusSingleStatProperties. - - :param position: The position of this LinePlusSingleStatProperties. - :type: str - """ # noqa: E501 - if position is None: - raise ValueError("Invalid value for `position`, must not be `None`") # noqa: E501 - self._position = position - - @property - def prefix(self): - """Get the prefix of this LinePlusSingleStatProperties. - - :return: The prefix of this LinePlusSingleStatProperties. - :rtype: str - """ # noqa: E501 - return self._prefix - - @prefix.setter - def prefix(self, prefix): - """Set the prefix of this LinePlusSingleStatProperties. - - :param prefix: The prefix of this LinePlusSingleStatProperties. - :type: str - """ # noqa: E501 - if prefix is None: - raise ValueError("Invalid value for `prefix`, must not be `None`") # noqa: E501 - self._prefix = prefix - - @property - def suffix(self): - """Get the suffix of this LinePlusSingleStatProperties. - - :return: The suffix of this LinePlusSingleStatProperties. - :rtype: str - """ # noqa: E501 - return self._suffix - - @suffix.setter - def suffix(self, suffix): - """Set the suffix of this LinePlusSingleStatProperties. - - :param suffix: The suffix of this LinePlusSingleStatProperties. - :type: str - """ # noqa: E501 - if suffix is None: - raise ValueError("Invalid value for `suffix`, must not be `None`") # noqa: E501 - self._suffix = suffix - - @property - def decimal_places(self): - """Get the decimal_places of this LinePlusSingleStatProperties. - - :return: The decimal_places of this LinePlusSingleStatProperties. - :rtype: DecimalPlaces - """ # noqa: E501 - return self._decimal_places - - @decimal_places.setter - def decimal_places(self, decimal_places): - """Set the decimal_places of this LinePlusSingleStatProperties. - - :param decimal_places: The decimal_places of this LinePlusSingleStatProperties. - :type: DecimalPlaces - """ # noqa: E501 - if decimal_places is None: - raise ValueError("Invalid value for `decimal_places`, must not be `None`") # noqa: E501 - self._decimal_places = decimal_places - - @property - def legend_colorize_rows(self): - """Get the legend_colorize_rows of this LinePlusSingleStatProperties. - - :return: The legend_colorize_rows of this LinePlusSingleStatProperties. - :rtype: bool - """ # noqa: E501 - return self._legend_colorize_rows - - @legend_colorize_rows.setter - def legend_colorize_rows(self, legend_colorize_rows): - """Set the legend_colorize_rows of this LinePlusSingleStatProperties. - - :param legend_colorize_rows: The legend_colorize_rows of this LinePlusSingleStatProperties. - :type: bool - """ # noqa: E501 - self._legend_colorize_rows = legend_colorize_rows - - @property - def legend_hide(self): - """Get the legend_hide of this LinePlusSingleStatProperties. - - :return: The legend_hide of this LinePlusSingleStatProperties. - :rtype: bool - """ # noqa: E501 - return self._legend_hide - - @legend_hide.setter - def legend_hide(self, legend_hide): - """Set the legend_hide of this LinePlusSingleStatProperties. - - :param legend_hide: The legend_hide of this LinePlusSingleStatProperties. - :type: bool - """ # noqa: E501 - self._legend_hide = legend_hide - - @property - def legend_opacity(self): - """Get the legend_opacity of this LinePlusSingleStatProperties. - - :return: The legend_opacity of this LinePlusSingleStatProperties. - :rtype: float - """ # noqa: E501 - return self._legend_opacity - - @legend_opacity.setter - def legend_opacity(self, legend_opacity): - """Set the legend_opacity of this LinePlusSingleStatProperties. - - :param legend_opacity: The legend_opacity of this LinePlusSingleStatProperties. - :type: float - """ # noqa: E501 - self._legend_opacity = legend_opacity - - @property - def legend_orientation_threshold(self): - """Get the legend_orientation_threshold of this LinePlusSingleStatProperties. - - :return: The legend_orientation_threshold of this LinePlusSingleStatProperties. - :rtype: int - """ # noqa: E501 - return self._legend_orientation_threshold - - @legend_orientation_threshold.setter - def legend_orientation_threshold(self, legend_orientation_threshold): - """Set the legend_orientation_threshold of this LinePlusSingleStatProperties. - - :param legend_orientation_threshold: The legend_orientation_threshold of this LinePlusSingleStatProperties. - :type: int - """ # noqa: E501 - self._legend_orientation_threshold = legend_orientation_threshold - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, LinePlusSingleStatProperties): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/line_protocol_error.py b/frogpilot/third_party/influxdb_client/domain/line_protocol_error.py deleted file mode 100644 index 2050a8b2..00000000 --- a/frogpilot/third_party/influxdb_client/domain/line_protocol_error.py +++ /dev/null @@ -1,220 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class LineProtocolError(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'code': 'str', - 'message': 'str', - 'op': 'str', - 'err': 'str', - 'line': 'int' - } - - attribute_map = { - 'code': 'code', - 'message': 'message', - 'op': 'op', - 'err': 'err', - 'line': 'line' - } - - def __init__(self, code=None, message=None, op=None, err=None, line=None): # noqa: E501,D401,D403 - """LineProtocolError - a model defined in OpenAPI.""" # noqa: E501 - self._code = None - self._message = None - self._op = None - self._err = None - self._line = None - self.discriminator = None - - self.code = code - if message is not None: - self.message = message - if op is not None: - self.op = op - if err is not None: - self.err = err - if line is not None: - self.line = line - - @property - def code(self): - """Get the code of this LineProtocolError. - - Code is the machine-readable error code. - - :return: The code of this LineProtocolError. - :rtype: str - """ # noqa: E501 - return self._code - - @code.setter - def code(self, code): - """Set the code of this LineProtocolError. - - Code is the machine-readable error code. - - :param code: The code of this LineProtocolError. - :type: str - """ # noqa: E501 - if code is None: - raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 - self._code = code - - @property - def message(self): - """Get the message of this LineProtocolError. - - Human-readable message. - - :return: The message of this LineProtocolError. - :rtype: str - """ # noqa: E501 - return self._message - - @message.setter - def message(self, message): - """Set the message of this LineProtocolError. - - Human-readable message. - - :param message: The message of this LineProtocolError. - :type: str - """ # noqa: E501 - self._message = message - - @property - def op(self): - """Get the op of this LineProtocolError. - - Describes the logical code operation when the error occurred. Useful for debugging. - - :return: The op of this LineProtocolError. - :rtype: str - """ # noqa: E501 - return self._op - - @op.setter - def op(self, op): - """Set the op of this LineProtocolError. - - Describes the logical code operation when the error occurred. Useful for debugging. - - :param op: The op of this LineProtocolError. - :type: str - """ # noqa: E501 - self._op = op - - @property - def err(self): - """Get the err of this LineProtocolError. - - Stack of errors that occurred during processing of the request. Useful for debugging. - - :return: The err of this LineProtocolError. - :rtype: str - """ # noqa: E501 - return self._err - - @err.setter - def err(self, err): - """Set the err of this LineProtocolError. - - Stack of errors that occurred during processing of the request. Useful for debugging. - - :param err: The err of this LineProtocolError. - :type: str - """ # noqa: E501 - self._err = err - - @property - def line(self): - """Get the line of this LineProtocolError. - - First line in the request body that contains malformed data. - - :return: The line of this LineProtocolError. - :rtype: int - """ # noqa: E501 - return self._line - - @line.setter - def line(self, line): - """Set the line of this LineProtocolError. - - First line in the request body that contains malformed data. - - :param line: The line of this LineProtocolError. - :type: int - """ # noqa: E501 - self._line = line - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, LineProtocolError): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/line_protocol_length_error.py b/frogpilot/third_party/influxdb_client/domain/line_protocol_length_error.py deleted file mode 100644 index d40aa6ae..00000000 --- a/frogpilot/third_party/influxdb_client/domain/line_protocol_length_error.py +++ /dev/null @@ -1,140 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class LineProtocolLengthError(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'code': 'str', - 'message': 'str' - } - - attribute_map = { - 'code': 'code', - 'message': 'message' - } - - def __init__(self, code=None, message=None): # noqa: E501,D401,D403 - """LineProtocolLengthError - a model defined in OpenAPI.""" # noqa: E501 - self._code = None - self._message = None - self.discriminator = None - - self.code = code - self.message = message - - @property - def code(self): - """Get the code of this LineProtocolLengthError. - - Code is the machine-readable error code. - - :return: The code of this LineProtocolLengthError. - :rtype: str - """ # noqa: E501 - return self._code - - @code.setter - def code(self, code): - """Set the code of this LineProtocolLengthError. - - Code is the machine-readable error code. - - :param code: The code of this LineProtocolLengthError. - :type: str - """ # noqa: E501 - if code is None: - raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 - self._code = code - - @property - def message(self): - """Get the message of this LineProtocolLengthError. - - Human-readable message. - - :return: The message of this LineProtocolLengthError. - :rtype: str - """ # noqa: E501 - return self._message - - @message.setter - def message(self, message): - """Set the message of this LineProtocolLengthError. - - Human-readable message. - - :param message: The message of this LineProtocolLengthError. - :type: str - """ # noqa: E501 - if message is None: - raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 - self._message = message - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, LineProtocolLengthError): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/links.py b/frogpilot/third_party/influxdb_client/domain/links.py deleted file mode 100644 index d9844c8b..00000000 --- a/frogpilot/third_party/influxdb_client/domain/links.py +++ /dev/null @@ -1,166 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class Links(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'next': 'str', - '_self': 'str', - 'prev': 'str' - } - - attribute_map = { - 'next': 'next', - '_self': 'self', - 'prev': 'prev' - } - - def __init__(self, next=None, _self=None, prev=None): # noqa: E501,D401,D403 - """Links - a model defined in OpenAPI.""" # noqa: E501 - self._next = None - self.__self = None - self._prev = None - self.discriminator = None - - if next is not None: - self.next = next - self._self = _self - if prev is not None: - self.prev = prev - - @property - def next(self): - """Get the next of this Links. - - URI of resource. - - :return: The next of this Links. - :rtype: str - """ # noqa: E501 - return self._next - - @next.setter - def next(self, next): - """Set the next of this Links. - - URI of resource. - - :param next: The next of this Links. - :type: str - """ # noqa: E501 - self._next = next - - @property - def _self(self): - """Get the _self of this Links. - - URI of resource. - - :return: The _self of this Links. - :rtype: str - """ # noqa: E501 - return self.__self - - @_self.setter - def _self(self, _self): - """Set the _self of this Links. - - URI of resource. - - :param _self: The _self of this Links. - :type: str - """ # noqa: E501 - if _self is None: - raise ValueError("Invalid value for `_self`, must not be `None`") # noqa: E501 - self.__self = _self - - @property - def prev(self): - """Get the prev of this Links. - - URI of resource. - - :return: The prev of this Links. - :rtype: str - """ # noqa: E501 - return self._prev - - @prev.setter - def prev(self, prev): - """Set the prev of this Links. - - URI of resource. - - :param prev: The prev of this Links. - :type: str - """ # noqa: E501 - self._prev = prev - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Links): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/list_stacks_response.py b/frogpilot/third_party/influxdb_client/domain/list_stacks_response.py deleted file mode 100644 index 084e3402..00000000 --- a/frogpilot/third_party/influxdb_client/domain/list_stacks_response.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class ListStacksResponse(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'stacks': 'list[Stack]' - } - - attribute_map = { - 'stacks': 'stacks' - } - - def __init__(self, stacks=None): # noqa: E501,D401,D403 - """ListStacksResponse - a model defined in OpenAPI.""" # noqa: E501 - self._stacks = None - self.discriminator = None - - if stacks is not None: - self.stacks = stacks - - @property - def stacks(self): - """Get the stacks of this ListStacksResponse. - - :return: The stacks of this ListStacksResponse. - :rtype: list[Stack] - """ # noqa: E501 - return self._stacks - - @stacks.setter - def stacks(self, stacks): - """Set the stacks of this ListStacksResponse. - - :param stacks: The stacks of this ListStacksResponse. - :type: list[Stack] - """ # noqa: E501 - self._stacks = stacks - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, ListStacksResponse): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/log_event.py b/frogpilot/third_party/influxdb_client/domain/log_event.py deleted file mode 100644 index 336736e8..00000000 --- a/frogpilot/third_party/influxdb_client/domain/log_event.py +++ /dev/null @@ -1,165 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class LogEvent(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'time': 'datetime', - 'message': 'str', - 'run_id': 'str' - } - - attribute_map = { - 'time': 'time', - 'message': 'message', - 'run_id': 'runID' - } - - def __init__(self, time=None, message=None, run_id=None): # noqa: E501,D401,D403 - """LogEvent - a model defined in OpenAPI.""" # noqa: E501 - self._time = None - self._message = None - self._run_id = None - self.discriminator = None - - if time is not None: - self.time = time - if message is not None: - self.message = message - if run_id is not None: - self.run_id = run_id - - @property - def time(self): - """Get the time of this LogEvent. - - The time ([RFC3339Nano date/time format](https://docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339nano-timestamp)) that the event occurred. - - :return: The time of this LogEvent. - :rtype: datetime - """ # noqa: E501 - return self._time - - @time.setter - def time(self, time): - """Set the time of this LogEvent. - - The time ([RFC3339Nano date/time format](https://docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339nano-timestamp)) that the event occurred. - - :param time: The time of this LogEvent. - :type: datetime - """ # noqa: E501 - self._time = time - - @property - def message(self): - """Get the message of this LogEvent. - - A description of the event that occurred. - - :return: The message of this LogEvent. - :rtype: str - """ # noqa: E501 - return self._message - - @message.setter - def message(self, message): - """Set the message of this LogEvent. - - A description of the event that occurred. - - :param message: The message of this LogEvent. - :type: str - """ # noqa: E501 - self._message = message - - @property - def run_id(self): - """Get the run_id of this LogEvent. - - The ID of the task run that generated the event. - - :return: The run_id of this LogEvent. - :rtype: str - """ # noqa: E501 - return self._run_id - - @run_id.setter - def run_id(self, run_id): - """Set the run_id of this LogEvent. - - The ID of the task run that generated the event. - - :param run_id: The run_id of this LogEvent. - :type: str - """ # noqa: E501 - self._run_id = run_id - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, LogEvent): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/logical_expression.py b/frogpilot/third_party/influxdb_client/domain/logical_expression.py deleted file mode 100644 index 25a1aa9b..00000000 --- a/frogpilot/third_party/influxdb_client/domain/logical_expression.py +++ /dev/null @@ -1,184 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.expression import Expression - - -class LogicalExpression(Expression): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'operator': 'str', - 'left': 'Expression', - 'right': 'Expression' - } - - attribute_map = { - 'type': 'type', - 'operator': 'operator', - 'left': 'left', - 'right': 'right' - } - - def __init__(self, type=None, operator=None, left=None, right=None): # noqa: E501,D401,D403 - """LogicalExpression - a model defined in OpenAPI.""" # noqa: E501 - Expression.__init__(self) # noqa: E501 - - self._type = None - self._operator = None - self._left = None - self._right = None - self.discriminator = None - - if type is not None: - self.type = type - if operator is not None: - self.operator = operator - if left is not None: - self.left = left - if right is not None: - self.right = right - - @property - def type(self): - """Get the type of this LogicalExpression. - - Type of AST node - - :return: The type of this LogicalExpression. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this LogicalExpression. - - Type of AST node - - :param type: The type of this LogicalExpression. - :type: str - """ # noqa: E501 - self._type = type - - @property - def operator(self): - """Get the operator of this LogicalExpression. - - :return: The operator of this LogicalExpression. - :rtype: str - """ # noqa: E501 - return self._operator - - @operator.setter - def operator(self, operator): - """Set the operator of this LogicalExpression. - - :param operator: The operator of this LogicalExpression. - :type: str - """ # noqa: E501 - self._operator = operator - - @property - def left(self): - """Get the left of this LogicalExpression. - - :return: The left of this LogicalExpression. - :rtype: Expression - """ # noqa: E501 - return self._left - - @left.setter - def left(self, left): - """Set the left of this LogicalExpression. - - :param left: The left of this LogicalExpression. - :type: Expression - """ # noqa: E501 - self._left = left - - @property - def right(self): - """Get the right of this LogicalExpression. - - :return: The right of this LogicalExpression. - :rtype: Expression - """ # noqa: E501 - return self._right - - @right.setter - def right(self, right): - """Set the right of this LogicalExpression. - - :param right: The right of this LogicalExpression. - :type: Expression - """ # noqa: E501 - self._right = right - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, LogicalExpression): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/logs.py b/frogpilot/third_party/influxdb_client/domain/logs.py deleted file mode 100644 index 0dd2acfd..00000000 --- a/frogpilot/third_party/influxdb_client/domain/logs.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class Logs(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'events': 'list[LogEvent]' - } - - attribute_map = { - 'events': 'events' - } - - def __init__(self, events=None): # noqa: E501,D401,D403 - """Logs - a model defined in OpenAPI.""" # noqa: E501 - self._events = None - self.discriminator = None - - if events is not None: - self.events = events - - @property - def events(self): - """Get the events of this Logs. - - :return: The events of this Logs. - :rtype: list[LogEvent] - """ # noqa: E501 - return self._events - - @events.setter - def events(self, events): - """Set the events of this Logs. - - :param events: The events of this Logs. - :type: list[LogEvent] - """ # noqa: E501 - self._events = events - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Logs): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/map_variable_properties.py b/frogpilot/third_party/influxdb_client/domain/map_variable_properties.py deleted file mode 100644 index 8648d9cb..00000000 --- a/frogpilot/third_party/influxdb_client/domain/map_variable_properties.py +++ /dev/null @@ -1,134 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.variable_properties import VariableProperties - - -class MapVariableProperties(VariableProperties): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'values': 'dict(str, str)' - } - - attribute_map = { - 'type': 'type', - 'values': 'values' - } - - def __init__(self, type=None, values=None): # noqa: E501,D401,D403 - """MapVariableProperties - a model defined in OpenAPI.""" # noqa: E501 - VariableProperties.__init__(self) # noqa: E501 - - self._type = None - self._values = None - self.discriminator = None - - if type is not None: - self.type = type - if values is not None: - self.values = values - - @property - def type(self): - """Get the type of this MapVariableProperties. - - :return: The type of this MapVariableProperties. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this MapVariableProperties. - - :param type: The type of this MapVariableProperties. - :type: str - """ # noqa: E501 - self._type = type - - @property - def values(self): - """Get the values of this MapVariableProperties. - - :return: The values of this MapVariableProperties. - :rtype: dict(str, str) - """ # noqa: E501 - return self._values - - @values.setter - def values(self, values): - """Set the values of this MapVariableProperties. - - :param values: The values of this MapVariableProperties. - :type: dict(str, str) - """ # noqa: E501 - self._values = values - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, MapVariableProperties): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/markdown_view_properties.py b/frogpilot/third_party/influxdb_client/domain/markdown_view_properties.py deleted file mode 100644 index cc797f06..00000000 --- a/frogpilot/third_party/influxdb_client/domain/markdown_view_properties.py +++ /dev/null @@ -1,160 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.view_properties import ViewProperties - - -class MarkdownViewProperties(ViewProperties): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'shape': 'str', - 'note': 'str' - } - - attribute_map = { - 'type': 'type', - 'shape': 'shape', - 'note': 'note' - } - - def __init__(self, type=None, shape=None, note=None): # noqa: E501,D401,D403 - """MarkdownViewProperties - a model defined in OpenAPI.""" # noqa: E501 - ViewProperties.__init__(self) # noqa: E501 - - self._type = None - self._shape = None - self._note = None - self.discriminator = None - - self.type = type - self.shape = shape - self.note = note - - @property - def type(self): - """Get the type of this MarkdownViewProperties. - - :return: The type of this MarkdownViewProperties. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this MarkdownViewProperties. - - :param type: The type of this MarkdownViewProperties. - :type: str - """ # noqa: E501 - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - self._type = type - - @property - def shape(self): - """Get the shape of this MarkdownViewProperties. - - :return: The shape of this MarkdownViewProperties. - :rtype: str - """ # noqa: E501 - return self._shape - - @shape.setter - def shape(self, shape): - """Set the shape of this MarkdownViewProperties. - - :param shape: The shape of this MarkdownViewProperties. - :type: str - """ # noqa: E501 - if shape is None: - raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 - self._shape = shape - - @property - def note(self): - """Get the note of this MarkdownViewProperties. - - :return: The note of this MarkdownViewProperties. - :rtype: str - """ # noqa: E501 - return self._note - - @note.setter - def note(self, note): - """Set the note of this MarkdownViewProperties. - - :param note: The note of this MarkdownViewProperties. - :type: str - """ # noqa: E501 - if note is None: - raise ValueError("Invalid value for `note`, must not be `None`") # noqa: E501 - self._note = note - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, MarkdownViewProperties): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/measurement_schema.py b/frogpilot/third_party/influxdb_client/domain/measurement_schema.py deleted file mode 100644 index f2a48faa..00000000 --- a/frogpilot/third_party/influxdb_client/domain/measurement_schema.py +++ /dev/null @@ -1,262 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class MeasurementSchema(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'str', - 'org_id': 'str', - 'bucket_id': 'str', - 'name': 'str', - 'columns': 'list[MeasurementSchemaColumn]', - 'created_at': 'datetime', - 'updated_at': 'datetime' - } - - attribute_map = { - 'id': 'id', - 'org_id': 'orgID', - 'bucket_id': 'bucketID', - 'name': 'name', - 'columns': 'columns', - 'created_at': 'createdAt', - 'updated_at': 'updatedAt' - } - - def __init__(self, id=None, org_id=None, bucket_id=None, name=None, columns=None, created_at=None, updated_at=None): # noqa: E501,D401,D403 - """MeasurementSchema - a model defined in OpenAPI.""" # noqa: E501 - self._id = None - self._org_id = None - self._bucket_id = None - self._name = None - self._columns = None - self._created_at = None - self._updated_at = None - self.discriminator = None - - self.id = id - if org_id is not None: - self.org_id = org_id - if bucket_id is not None: - self.bucket_id = bucket_id - self.name = name - self.columns = columns - self.created_at = created_at - self.updated_at = updated_at - - @property - def id(self): - """Get the id of this MeasurementSchema. - - :return: The id of this MeasurementSchema. - :rtype: str - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this MeasurementSchema. - - :param id: The id of this MeasurementSchema. - :type: str - """ # noqa: E501 - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 - self._id = id - - @property - def org_id(self): - """Get the org_id of this MeasurementSchema. - - The ID of the organization. - - :return: The org_id of this MeasurementSchema. - :rtype: str - """ # noqa: E501 - return self._org_id - - @org_id.setter - def org_id(self, org_id): - """Set the org_id of this MeasurementSchema. - - The ID of the organization. - - :param org_id: The org_id of this MeasurementSchema. - :type: str - """ # noqa: E501 - self._org_id = org_id - - @property - def bucket_id(self): - """Get the bucket_id of this MeasurementSchema. - - The ID of the bucket that the measurement schema is associated with. - - :return: The bucket_id of this MeasurementSchema. - :rtype: str - """ # noqa: E501 - return self._bucket_id - - @bucket_id.setter - def bucket_id(self, bucket_id): - """Set the bucket_id of this MeasurementSchema. - - The ID of the bucket that the measurement schema is associated with. - - :param bucket_id: The bucket_id of this MeasurementSchema. - :type: str - """ # noqa: E501 - self._bucket_id = bucket_id - - @property - def name(self): - """Get the name of this MeasurementSchema. - - :return: The name of this MeasurementSchema. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this MeasurementSchema. - - :param name: The name of this MeasurementSchema. - :type: str - """ # noqa: E501 - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - self._name = name - - @property - def columns(self): - """Get the columns of this MeasurementSchema. - - Ordered collection of column definitions. - - :return: The columns of this MeasurementSchema. - :rtype: list[MeasurementSchemaColumn] - """ # noqa: E501 - return self._columns - - @columns.setter - def columns(self, columns): - """Set the columns of this MeasurementSchema. - - Ordered collection of column definitions. - - :param columns: The columns of this MeasurementSchema. - :type: list[MeasurementSchemaColumn] - """ # noqa: E501 - if columns is None: - raise ValueError("Invalid value for `columns`, must not be `None`") # noqa: E501 - self._columns = columns - - @property - def created_at(self): - """Get the created_at of this MeasurementSchema. - - :return: The created_at of this MeasurementSchema. - :rtype: datetime - """ # noqa: E501 - return self._created_at - - @created_at.setter - def created_at(self, created_at): - """Set the created_at of this MeasurementSchema. - - :param created_at: The created_at of this MeasurementSchema. - :type: datetime - """ # noqa: E501 - if created_at is None: - raise ValueError("Invalid value for `created_at`, must not be `None`") # noqa: E501 - self._created_at = created_at - - @property - def updated_at(self): - """Get the updated_at of this MeasurementSchema. - - :return: The updated_at of this MeasurementSchema. - :rtype: datetime - """ # noqa: E501 - return self._updated_at - - @updated_at.setter - def updated_at(self, updated_at): - """Set the updated_at of this MeasurementSchema. - - :param updated_at: The updated_at of this MeasurementSchema. - :type: datetime - """ # noqa: E501 - if updated_at is None: - raise ValueError("Invalid value for `updated_at`, must not be `None`") # noqa: E501 - self._updated_at = updated_at - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, MeasurementSchema): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/measurement_schema_column.py b/frogpilot/third_party/influxdb_client/domain/measurement_schema_column.py deleted file mode 100644 index 79ee3845..00000000 --- a/frogpilot/third_party/influxdb_client/domain/measurement_schema_column.py +++ /dev/null @@ -1,155 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class MeasurementSchemaColumn(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str', - 'type': 'ColumnSemanticType', - 'data_type': 'ColumnDataType' - } - - attribute_map = { - 'name': 'name', - 'type': 'type', - 'data_type': 'dataType' - } - - def __init__(self, name=None, type=None, data_type=None): # noqa: E501,D401,D403 - """MeasurementSchemaColumn - a model defined in OpenAPI.""" # noqa: E501 - self._name = None - self._type = None - self._data_type = None - self.discriminator = None - - self.name = name - self.type = type - if data_type is not None: - self.data_type = data_type - - @property - def name(self): - """Get the name of this MeasurementSchemaColumn. - - :return: The name of this MeasurementSchemaColumn. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this MeasurementSchemaColumn. - - :param name: The name of this MeasurementSchemaColumn. - :type: str - """ # noqa: E501 - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - self._name = name - - @property - def type(self): - """Get the type of this MeasurementSchemaColumn. - - :return: The type of this MeasurementSchemaColumn. - :rtype: ColumnSemanticType - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this MeasurementSchemaColumn. - - :param type: The type of this MeasurementSchemaColumn. - :type: ColumnSemanticType - """ # noqa: E501 - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - self._type = type - - @property - def data_type(self): - """Get the data_type of this MeasurementSchemaColumn. - - :return: The data_type of this MeasurementSchemaColumn. - :rtype: ColumnDataType - """ # noqa: E501 - return self._data_type - - @data_type.setter - def data_type(self, data_type): - """Set the data_type of this MeasurementSchemaColumn. - - :param data_type: The data_type of this MeasurementSchemaColumn. - :type: ColumnDataType - """ # noqa: E501 - self._data_type = data_type - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, MeasurementSchemaColumn): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/measurement_schema_create_request.py b/frogpilot/third_party/influxdb_client/domain/measurement_schema_create_request.py deleted file mode 100644 index 1308a2da..00000000 --- a/frogpilot/third_party/influxdb_client/domain/measurement_schema_create_request.py +++ /dev/null @@ -1,140 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class MeasurementSchemaCreateRequest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str', - 'columns': 'list[MeasurementSchemaColumn]' - } - - attribute_map = { - 'name': 'name', - 'columns': 'columns' - } - - def __init__(self, name=None, columns=None): # noqa: E501,D401,D403 - """MeasurementSchemaCreateRequest - a model defined in OpenAPI.""" # noqa: E501 - self._name = None - self._columns = None - self.discriminator = None - - self.name = name - self.columns = columns - - @property - def name(self): - """Get the name of this MeasurementSchemaCreateRequest. - - The [measurement](https://docs.influxdata.com/influxdb/cloud/reference/glossary/#measurement) name. - - :return: The name of this MeasurementSchemaCreateRequest. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this MeasurementSchemaCreateRequest. - - The [measurement](https://docs.influxdata.com/influxdb/cloud/reference/glossary/#measurement) name. - - :param name: The name of this MeasurementSchemaCreateRequest. - :type: str - """ # noqa: E501 - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - self._name = name - - @property - def columns(self): - """Get the columns of this MeasurementSchemaCreateRequest. - - Ordered collection of column definitions. - - :return: The columns of this MeasurementSchemaCreateRequest. - :rtype: list[MeasurementSchemaColumn] - """ # noqa: E501 - return self._columns - - @columns.setter - def columns(self, columns): - """Set the columns of this MeasurementSchemaCreateRequest. - - Ordered collection of column definitions. - - :param columns: The columns of this MeasurementSchemaCreateRequest. - :type: list[MeasurementSchemaColumn] - """ # noqa: E501 - if columns is None: - raise ValueError("Invalid value for `columns`, must not be `None`") # noqa: E501 - self._columns = columns - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, MeasurementSchemaCreateRequest): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/measurement_schema_list.py b/frogpilot/third_party/influxdb_client/domain/measurement_schema_list.py deleted file mode 100644 index f8a83dda..00000000 --- a/frogpilot/third_party/influxdb_client/domain/measurement_schema_list.py +++ /dev/null @@ -1,108 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class MeasurementSchemaList(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'measurement_schemas': 'list[MeasurementSchema]' - } - - attribute_map = { - 'measurement_schemas': 'measurementSchemas' - } - - def __init__(self, measurement_schemas=None): # noqa: E501,D401,D403 - """MeasurementSchemaList - a model defined in OpenAPI.""" # noqa: E501 - self._measurement_schemas = None - self.discriminator = None - - self.measurement_schemas = measurement_schemas - - @property - def measurement_schemas(self): - """Get the measurement_schemas of this MeasurementSchemaList. - - :return: The measurement_schemas of this MeasurementSchemaList. - :rtype: list[MeasurementSchema] - """ # noqa: E501 - return self._measurement_schemas - - @measurement_schemas.setter - def measurement_schemas(self, measurement_schemas): - """Set the measurement_schemas of this MeasurementSchemaList. - - :param measurement_schemas: The measurement_schemas of this MeasurementSchemaList. - :type: list[MeasurementSchema] - """ # noqa: E501 - if measurement_schemas is None: - raise ValueError("Invalid value for `measurement_schemas`, must not be `None`") # noqa: E501 - self._measurement_schemas = measurement_schemas - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, MeasurementSchemaList): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/measurement_schema_update_request.py b/frogpilot/third_party/influxdb_client/domain/measurement_schema_update_request.py deleted file mode 100644 index bdfa19c2..00000000 --- a/frogpilot/third_party/influxdb_client/domain/measurement_schema_update_request.py +++ /dev/null @@ -1,112 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class MeasurementSchemaUpdateRequest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'columns': 'list[MeasurementSchemaColumn]' - } - - attribute_map = { - 'columns': 'columns' - } - - def __init__(self, columns=None): # noqa: E501,D401,D403 - """MeasurementSchemaUpdateRequest - a model defined in OpenAPI.""" # noqa: E501 - self._columns = None - self.discriminator = None - - self.columns = columns - - @property - def columns(self): - """Get the columns of this MeasurementSchemaUpdateRequest. - - An ordered collection of column definitions - - :return: The columns of this MeasurementSchemaUpdateRequest. - :rtype: list[MeasurementSchemaColumn] - """ # noqa: E501 - return self._columns - - @columns.setter - def columns(self, columns): - """Set the columns of this MeasurementSchemaUpdateRequest. - - An ordered collection of column definitions - - :param columns: The columns of this MeasurementSchemaUpdateRequest. - :type: list[MeasurementSchemaColumn] - """ # noqa: E501 - if columns is None: - raise ValueError("Invalid value for `columns`, must not be `None`") # noqa: E501 - self._columns = columns - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, MeasurementSchemaUpdateRequest): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/member_assignment.py b/frogpilot/third_party/influxdb_client/domain/member_assignment.py deleted file mode 100644 index 7773b0e4..00000000 --- a/frogpilot/third_party/influxdb_client/domain/member_assignment.py +++ /dev/null @@ -1,161 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.statement import Statement - - -class MemberAssignment(Statement): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'member': 'MemberExpression', - 'init': 'Expression' - } - - attribute_map = { - 'type': 'type', - 'member': 'member', - 'init': 'init' - } - - def __init__(self, type=None, member=None, init=None): # noqa: E501,D401,D403 - """MemberAssignment - a model defined in OpenAPI.""" # noqa: E501 - Statement.__init__(self) # noqa: E501 - - self._type = None - self._member = None - self._init = None - self.discriminator = None - - if type is not None: - self.type = type - if member is not None: - self.member = member - if init is not None: - self.init = init - - @property - def type(self): - """Get the type of this MemberAssignment. - - Type of AST node - - :return: The type of this MemberAssignment. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this MemberAssignment. - - Type of AST node - - :param type: The type of this MemberAssignment. - :type: str - """ # noqa: E501 - self._type = type - - @property - def member(self): - """Get the member of this MemberAssignment. - - :return: The member of this MemberAssignment. - :rtype: MemberExpression - """ # noqa: E501 - return self._member - - @member.setter - def member(self, member): - """Set the member of this MemberAssignment. - - :param member: The member of this MemberAssignment. - :type: MemberExpression - """ # noqa: E501 - self._member = member - - @property - def init(self): - """Get the init of this MemberAssignment. - - :return: The init of this MemberAssignment. - :rtype: Expression - """ # noqa: E501 - return self._init - - @init.setter - def init(self, init): - """Set the init of this MemberAssignment. - - :param init: The init of this MemberAssignment. - :type: Expression - """ # noqa: E501 - self._init = init - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, MemberAssignment): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/member_expression.py b/frogpilot/third_party/influxdb_client/domain/member_expression.py deleted file mode 100644 index decf2c48..00000000 --- a/frogpilot/third_party/influxdb_client/domain/member_expression.py +++ /dev/null @@ -1,161 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.expression import Expression - - -class MemberExpression(Expression): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'object': 'Expression', - '_property': 'PropertyKey' - } - - attribute_map = { - 'type': 'type', - 'object': 'object', - '_property': 'property' - } - - def __init__(self, type=None, object=None, _property=None): # noqa: E501,D401,D403 - """MemberExpression - a model defined in OpenAPI.""" # noqa: E501 - Expression.__init__(self) # noqa: E501 - - self._type = None - self._object = None - self.__property = None - self.discriminator = None - - if type is not None: - self.type = type - if object is not None: - self.object = object - if _property is not None: - self._property = _property - - @property - def type(self): - """Get the type of this MemberExpression. - - Type of AST node - - :return: The type of this MemberExpression. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this MemberExpression. - - Type of AST node - - :param type: The type of this MemberExpression. - :type: str - """ # noqa: E501 - self._type = type - - @property - def object(self): - """Get the object of this MemberExpression. - - :return: The object of this MemberExpression. - :rtype: Expression - """ # noqa: E501 - return self._object - - @object.setter - def object(self, object): - """Set the object of this MemberExpression. - - :param object: The object of this MemberExpression. - :type: Expression - """ # noqa: E501 - self._object = object - - @property - def _property(self): - """Get the _property of this MemberExpression. - - :return: The _property of this MemberExpression. - :rtype: PropertyKey - """ # noqa: E501 - return self.__property - - @_property.setter - def _property(self, _property): - """Set the _property of this MemberExpression. - - :param _property: The _property of this MemberExpression. - :type: PropertyKey - """ # noqa: E501 - self.__property = _property - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, MemberExpression): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/metadata_backup.py b/frogpilot/third_party/influxdb_client/domain/metadata_backup.py deleted file mode 100644 index ebe498fc..00000000 --- a/frogpilot/third_party/influxdb_client/domain/metadata_backup.py +++ /dev/null @@ -1,156 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class MetadataBackup(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'kv': 'file', - 'sql': 'file', - 'buckets': 'list[BucketMetadataManifest]' - } - - attribute_map = { - 'kv': 'kv', - 'sql': 'sql', - 'buckets': 'buckets' - } - - def __init__(self, kv=None, sql=None, buckets=None): # noqa: E501,D401,D403 - """MetadataBackup - a model defined in OpenAPI.""" # noqa: E501 - self._kv = None - self._sql = None - self._buckets = None - self.discriminator = None - - self.kv = kv - self.sql = sql - self.buckets = buckets - - @property - def kv(self): - """Get the kv of this MetadataBackup. - - :return: The kv of this MetadataBackup. - :rtype: file - """ # noqa: E501 - return self._kv - - @kv.setter - def kv(self, kv): - """Set the kv of this MetadataBackup. - - :param kv: The kv of this MetadataBackup. - :type: file - """ # noqa: E501 - if kv is None: - raise ValueError("Invalid value for `kv`, must not be `None`") # noqa: E501 - self._kv = kv - - @property - def sql(self): - """Get the sql of this MetadataBackup. - - :return: The sql of this MetadataBackup. - :rtype: file - """ # noqa: E501 - return self._sql - - @sql.setter - def sql(self, sql): - """Set the sql of this MetadataBackup. - - :param sql: The sql of this MetadataBackup. - :type: file - """ # noqa: E501 - if sql is None: - raise ValueError("Invalid value for `sql`, must not be `None`") # noqa: E501 - self._sql = sql - - @property - def buckets(self): - """Get the buckets of this MetadataBackup. - - :return: The buckets of this MetadataBackup. - :rtype: list[BucketMetadataManifest] - """ # noqa: E501 - return self._buckets - - @buckets.setter - def buckets(self, buckets): - """Set the buckets of this MetadataBackup. - - :param buckets: The buckets of this MetadataBackup. - :type: list[BucketMetadataManifest] - """ # noqa: E501 - if buckets is None: - raise ValueError("Invalid value for `buckets`, must not be `None`") # noqa: E501 - self._buckets = buckets - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, MetadataBackup): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/model_property.py b/frogpilot/third_party/influxdb_client/domain/model_property.py deleted file mode 100644 index cbdcd249..00000000 --- a/frogpilot/third_party/influxdb_client/domain/model_property.py +++ /dev/null @@ -1,157 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class ModelProperty(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'key': 'PropertyKey', - 'value': 'Expression' - } - - attribute_map = { - 'type': 'type', - 'key': 'key', - 'value': 'value' - } - - def __init__(self, type=None, key=None, value=None): # noqa: E501,D401,D403 - """ModelProperty - a model defined in OpenAPI.""" # noqa: E501 - self._type = None - self._key = None - self._value = None - self.discriminator = None - - if type is not None: - self.type = type - if key is not None: - self.key = key - if value is not None: - self.value = value - - @property - def type(self): - """Get the type of this ModelProperty. - - Type of AST node - - :return: The type of this ModelProperty. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this ModelProperty. - - Type of AST node - - :param type: The type of this ModelProperty. - :type: str - """ # noqa: E501 - self._type = type - - @property - def key(self): - """Get the key of this ModelProperty. - - :return: The key of this ModelProperty. - :rtype: PropertyKey - """ # noqa: E501 - return self._key - - @key.setter - def key(self, key): - """Set the key of this ModelProperty. - - :param key: The key of this ModelProperty. - :type: PropertyKey - """ # noqa: E501 - self._key = key - - @property - def value(self): - """Get the value of this ModelProperty. - - :return: The value of this ModelProperty. - :rtype: Expression - """ # noqa: E501 - return self._value - - @value.setter - def value(self, value): - """Set the value of this ModelProperty. - - :param value: The value of this ModelProperty. - :type: Expression - """ # noqa: E501 - self._value = value - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, ModelProperty): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/mosaic_view_properties.py b/frogpilot/third_party/influxdb_client/domain/mosaic_view_properties.py deleted file mode 100644 index 1ea88972..00000000 --- a/frogpilot/third_party/influxdb_client/domain/mosaic_view_properties.py +++ /dev/null @@ -1,780 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.view_properties import ViewProperties - - -class MosaicViewProperties(ViewProperties): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'time_format': 'str', - 'type': 'str', - 'queries': 'list[DashboardQuery]', - 'colors': 'list[str]', - 'shape': 'str', - 'note': 'str', - 'show_note_when_empty': 'bool', - 'x_column': 'str', - 'generate_x_axis_ticks': 'list[str]', - 'x_total_ticks': 'int', - 'x_tick_start': 'float', - 'x_tick_step': 'float', - 'y_label_column_separator': 'str', - 'y_label_columns': 'list[str]', - 'y_series_columns': 'list[str]', - 'fill_columns': 'list[str]', - 'x_domain': 'list[float]', - 'y_domain': 'list[float]', - 'x_axis_label': 'str', - 'y_axis_label': 'str', - 'x_prefix': 'str', - 'x_suffix': 'str', - 'y_prefix': 'str', - 'y_suffix': 'str', - 'hover_dimension': 'str', - 'legend_colorize_rows': 'bool', - 'legend_hide': 'bool', - 'legend_opacity': 'float', - 'legend_orientation_threshold': 'int' - } - - attribute_map = { - 'time_format': 'timeFormat', - 'type': 'type', - 'queries': 'queries', - 'colors': 'colors', - 'shape': 'shape', - 'note': 'note', - 'show_note_when_empty': 'showNoteWhenEmpty', - 'x_column': 'xColumn', - 'generate_x_axis_ticks': 'generateXAxisTicks', - 'x_total_ticks': 'xTotalTicks', - 'x_tick_start': 'xTickStart', - 'x_tick_step': 'xTickStep', - 'y_label_column_separator': 'yLabelColumnSeparator', - 'y_label_columns': 'yLabelColumns', - 'y_series_columns': 'ySeriesColumns', - 'fill_columns': 'fillColumns', - 'x_domain': 'xDomain', - 'y_domain': 'yDomain', - 'x_axis_label': 'xAxisLabel', - 'y_axis_label': 'yAxisLabel', - 'x_prefix': 'xPrefix', - 'x_suffix': 'xSuffix', - 'y_prefix': 'yPrefix', - 'y_suffix': 'ySuffix', - 'hover_dimension': 'hoverDimension', - 'legend_colorize_rows': 'legendColorizeRows', - 'legend_hide': 'legendHide', - 'legend_opacity': 'legendOpacity', - 'legend_orientation_threshold': 'legendOrientationThreshold' - } - - def __init__(self, time_format=None, type=None, queries=None, colors=None, shape=None, note=None, show_note_when_empty=None, x_column=None, generate_x_axis_ticks=None, x_total_ticks=None, x_tick_start=None, x_tick_step=None, y_label_column_separator=None, y_label_columns=None, y_series_columns=None, fill_columns=None, x_domain=None, y_domain=None, x_axis_label=None, y_axis_label=None, x_prefix=None, x_suffix=None, y_prefix=None, y_suffix=None, hover_dimension=None, legend_colorize_rows=None, legend_hide=None, legend_opacity=None, legend_orientation_threshold=None): # noqa: E501,D401,D403 - """MosaicViewProperties - a model defined in OpenAPI.""" # noqa: E501 - ViewProperties.__init__(self) # noqa: E501 - - self._time_format = None - self._type = None - self._queries = None - self._colors = None - self._shape = None - self._note = None - self._show_note_when_empty = None - self._x_column = None - self._generate_x_axis_ticks = None - self._x_total_ticks = None - self._x_tick_start = None - self._x_tick_step = None - self._y_label_column_separator = None - self._y_label_columns = None - self._y_series_columns = None - self._fill_columns = None - self._x_domain = None - self._y_domain = None - self._x_axis_label = None - self._y_axis_label = None - self._x_prefix = None - self._x_suffix = None - self._y_prefix = None - self._y_suffix = None - self._hover_dimension = None - self._legend_colorize_rows = None - self._legend_hide = None - self._legend_opacity = None - self._legend_orientation_threshold = None - self.discriminator = None - - if time_format is not None: - self.time_format = time_format - self.type = type - self.queries = queries - self.colors = colors - self.shape = shape - self.note = note - self.show_note_when_empty = show_note_when_empty - self.x_column = x_column - if generate_x_axis_ticks is not None: - self.generate_x_axis_ticks = generate_x_axis_ticks - if x_total_ticks is not None: - self.x_total_ticks = x_total_ticks - if x_tick_start is not None: - self.x_tick_start = x_tick_start - if x_tick_step is not None: - self.x_tick_step = x_tick_step - if y_label_column_separator is not None: - self.y_label_column_separator = y_label_column_separator - if y_label_columns is not None: - self.y_label_columns = y_label_columns - self.y_series_columns = y_series_columns - self.fill_columns = fill_columns - self.x_domain = x_domain - self.y_domain = y_domain - self.x_axis_label = x_axis_label - self.y_axis_label = y_axis_label - self.x_prefix = x_prefix - self.x_suffix = x_suffix - self.y_prefix = y_prefix - self.y_suffix = y_suffix - if hover_dimension is not None: - self.hover_dimension = hover_dimension - if legend_colorize_rows is not None: - self.legend_colorize_rows = legend_colorize_rows - if legend_hide is not None: - self.legend_hide = legend_hide - if legend_opacity is not None: - self.legend_opacity = legend_opacity - if legend_orientation_threshold is not None: - self.legend_orientation_threshold = legend_orientation_threshold - - @property - def time_format(self): - """Get the time_format of this MosaicViewProperties. - - :return: The time_format of this MosaicViewProperties. - :rtype: str - """ # noqa: E501 - return self._time_format - - @time_format.setter - def time_format(self, time_format): - """Set the time_format of this MosaicViewProperties. - - :param time_format: The time_format of this MosaicViewProperties. - :type: str - """ # noqa: E501 - self._time_format = time_format - - @property - def type(self): - """Get the type of this MosaicViewProperties. - - :return: The type of this MosaicViewProperties. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this MosaicViewProperties. - - :param type: The type of this MosaicViewProperties. - :type: str - """ # noqa: E501 - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - self._type = type - - @property - def queries(self): - """Get the queries of this MosaicViewProperties. - - :return: The queries of this MosaicViewProperties. - :rtype: list[DashboardQuery] - """ # noqa: E501 - return self._queries - - @queries.setter - def queries(self, queries): - """Set the queries of this MosaicViewProperties. - - :param queries: The queries of this MosaicViewProperties. - :type: list[DashboardQuery] - """ # noqa: E501 - if queries is None: - raise ValueError("Invalid value for `queries`, must not be `None`") # noqa: E501 - self._queries = queries - - @property - def colors(self): - """Get the colors of this MosaicViewProperties. - - Colors define color encoding of data into a visualization - - :return: The colors of this MosaicViewProperties. - :rtype: list[str] - """ # noqa: E501 - return self._colors - - @colors.setter - def colors(self, colors): - """Set the colors of this MosaicViewProperties. - - Colors define color encoding of data into a visualization - - :param colors: The colors of this MosaicViewProperties. - :type: list[str] - """ # noqa: E501 - if colors is None: - raise ValueError("Invalid value for `colors`, must not be `None`") # noqa: E501 - self._colors = colors - - @property - def shape(self): - """Get the shape of this MosaicViewProperties. - - :return: The shape of this MosaicViewProperties. - :rtype: str - """ # noqa: E501 - return self._shape - - @shape.setter - def shape(self, shape): - """Set the shape of this MosaicViewProperties. - - :param shape: The shape of this MosaicViewProperties. - :type: str - """ # noqa: E501 - if shape is None: - raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 - self._shape = shape - - @property - def note(self): - """Get the note of this MosaicViewProperties. - - :return: The note of this MosaicViewProperties. - :rtype: str - """ # noqa: E501 - return self._note - - @note.setter - def note(self, note): - """Set the note of this MosaicViewProperties. - - :param note: The note of this MosaicViewProperties. - :type: str - """ # noqa: E501 - if note is None: - raise ValueError("Invalid value for `note`, must not be `None`") # noqa: E501 - self._note = note - - @property - def show_note_when_empty(self): - """Get the show_note_when_empty of this MosaicViewProperties. - - If true, will display note when empty - - :return: The show_note_when_empty of this MosaicViewProperties. - :rtype: bool - """ # noqa: E501 - return self._show_note_when_empty - - @show_note_when_empty.setter - def show_note_when_empty(self, show_note_when_empty): - """Set the show_note_when_empty of this MosaicViewProperties. - - If true, will display note when empty - - :param show_note_when_empty: The show_note_when_empty of this MosaicViewProperties. - :type: bool - """ # noqa: E501 - if show_note_when_empty is None: - raise ValueError("Invalid value for `show_note_when_empty`, must not be `None`") # noqa: E501 - self._show_note_when_empty = show_note_when_empty - - @property - def x_column(self): - """Get the x_column of this MosaicViewProperties. - - :return: The x_column of this MosaicViewProperties. - :rtype: str - """ # noqa: E501 - return self._x_column - - @x_column.setter - def x_column(self, x_column): - """Set the x_column of this MosaicViewProperties. - - :param x_column: The x_column of this MosaicViewProperties. - :type: str - """ # noqa: E501 - if x_column is None: - raise ValueError("Invalid value for `x_column`, must not be `None`") # noqa: E501 - self._x_column = x_column - - @property - def generate_x_axis_ticks(self): - """Get the generate_x_axis_ticks of this MosaicViewProperties. - - :return: The generate_x_axis_ticks of this MosaicViewProperties. - :rtype: list[str] - """ # noqa: E501 - return self._generate_x_axis_ticks - - @generate_x_axis_ticks.setter - def generate_x_axis_ticks(self, generate_x_axis_ticks): - """Set the generate_x_axis_ticks of this MosaicViewProperties. - - :param generate_x_axis_ticks: The generate_x_axis_ticks of this MosaicViewProperties. - :type: list[str] - """ # noqa: E501 - self._generate_x_axis_ticks = generate_x_axis_ticks - - @property - def x_total_ticks(self): - """Get the x_total_ticks of this MosaicViewProperties. - - :return: The x_total_ticks of this MosaicViewProperties. - :rtype: int - """ # noqa: E501 - return self._x_total_ticks - - @x_total_ticks.setter - def x_total_ticks(self, x_total_ticks): - """Set the x_total_ticks of this MosaicViewProperties. - - :param x_total_ticks: The x_total_ticks of this MosaicViewProperties. - :type: int - """ # noqa: E501 - self._x_total_ticks = x_total_ticks - - @property - def x_tick_start(self): - """Get the x_tick_start of this MosaicViewProperties. - - :return: The x_tick_start of this MosaicViewProperties. - :rtype: float - """ # noqa: E501 - return self._x_tick_start - - @x_tick_start.setter - def x_tick_start(self, x_tick_start): - """Set the x_tick_start of this MosaicViewProperties. - - :param x_tick_start: The x_tick_start of this MosaicViewProperties. - :type: float - """ # noqa: E501 - self._x_tick_start = x_tick_start - - @property - def x_tick_step(self): - """Get the x_tick_step of this MosaicViewProperties. - - :return: The x_tick_step of this MosaicViewProperties. - :rtype: float - """ # noqa: E501 - return self._x_tick_step - - @x_tick_step.setter - def x_tick_step(self, x_tick_step): - """Set the x_tick_step of this MosaicViewProperties. - - :param x_tick_step: The x_tick_step of this MosaicViewProperties. - :type: float - """ # noqa: E501 - self._x_tick_step = x_tick_step - - @property - def y_label_column_separator(self): - """Get the y_label_column_separator of this MosaicViewProperties. - - :return: The y_label_column_separator of this MosaicViewProperties. - :rtype: str - """ # noqa: E501 - return self._y_label_column_separator - - @y_label_column_separator.setter - def y_label_column_separator(self, y_label_column_separator): - """Set the y_label_column_separator of this MosaicViewProperties. - - :param y_label_column_separator: The y_label_column_separator of this MosaicViewProperties. - :type: str - """ # noqa: E501 - self._y_label_column_separator = y_label_column_separator - - @property - def y_label_columns(self): - """Get the y_label_columns of this MosaicViewProperties. - - :return: The y_label_columns of this MosaicViewProperties. - :rtype: list[str] - """ # noqa: E501 - return self._y_label_columns - - @y_label_columns.setter - def y_label_columns(self, y_label_columns): - """Set the y_label_columns of this MosaicViewProperties. - - :param y_label_columns: The y_label_columns of this MosaicViewProperties. - :type: list[str] - """ # noqa: E501 - self._y_label_columns = y_label_columns - - @property - def y_series_columns(self): - """Get the y_series_columns of this MosaicViewProperties. - - :return: The y_series_columns of this MosaicViewProperties. - :rtype: list[str] - """ # noqa: E501 - return self._y_series_columns - - @y_series_columns.setter - def y_series_columns(self, y_series_columns): - """Set the y_series_columns of this MosaicViewProperties. - - :param y_series_columns: The y_series_columns of this MosaicViewProperties. - :type: list[str] - """ # noqa: E501 - if y_series_columns is None: - raise ValueError("Invalid value for `y_series_columns`, must not be `None`") # noqa: E501 - self._y_series_columns = y_series_columns - - @property - def fill_columns(self): - """Get the fill_columns of this MosaicViewProperties. - - :return: The fill_columns of this MosaicViewProperties. - :rtype: list[str] - """ # noqa: E501 - return self._fill_columns - - @fill_columns.setter - def fill_columns(self, fill_columns): - """Set the fill_columns of this MosaicViewProperties. - - :param fill_columns: The fill_columns of this MosaicViewProperties. - :type: list[str] - """ # noqa: E501 - if fill_columns is None: - raise ValueError("Invalid value for `fill_columns`, must not be `None`") # noqa: E501 - self._fill_columns = fill_columns - - @property - def x_domain(self): - """Get the x_domain of this MosaicViewProperties. - - :return: The x_domain of this MosaicViewProperties. - :rtype: list[float] - """ # noqa: E501 - return self._x_domain - - @x_domain.setter - def x_domain(self, x_domain): - """Set the x_domain of this MosaicViewProperties. - - :param x_domain: The x_domain of this MosaicViewProperties. - :type: list[float] - """ # noqa: E501 - if x_domain is None: - raise ValueError("Invalid value for `x_domain`, must not be `None`") # noqa: E501 - self._x_domain = x_domain - - @property - def y_domain(self): - """Get the y_domain of this MosaicViewProperties. - - :return: The y_domain of this MosaicViewProperties. - :rtype: list[float] - """ # noqa: E501 - return self._y_domain - - @y_domain.setter - def y_domain(self, y_domain): - """Set the y_domain of this MosaicViewProperties. - - :param y_domain: The y_domain of this MosaicViewProperties. - :type: list[float] - """ # noqa: E501 - if y_domain is None: - raise ValueError("Invalid value for `y_domain`, must not be `None`") # noqa: E501 - self._y_domain = y_domain - - @property - def x_axis_label(self): - """Get the x_axis_label of this MosaicViewProperties. - - :return: The x_axis_label of this MosaicViewProperties. - :rtype: str - """ # noqa: E501 - return self._x_axis_label - - @x_axis_label.setter - def x_axis_label(self, x_axis_label): - """Set the x_axis_label of this MosaicViewProperties. - - :param x_axis_label: The x_axis_label of this MosaicViewProperties. - :type: str - """ # noqa: E501 - if x_axis_label is None: - raise ValueError("Invalid value for `x_axis_label`, must not be `None`") # noqa: E501 - self._x_axis_label = x_axis_label - - @property - def y_axis_label(self): - """Get the y_axis_label of this MosaicViewProperties. - - :return: The y_axis_label of this MosaicViewProperties. - :rtype: str - """ # noqa: E501 - return self._y_axis_label - - @y_axis_label.setter - def y_axis_label(self, y_axis_label): - """Set the y_axis_label of this MosaicViewProperties. - - :param y_axis_label: The y_axis_label of this MosaicViewProperties. - :type: str - """ # noqa: E501 - if y_axis_label is None: - raise ValueError("Invalid value for `y_axis_label`, must not be `None`") # noqa: E501 - self._y_axis_label = y_axis_label - - @property - def x_prefix(self): - """Get the x_prefix of this MosaicViewProperties. - - :return: The x_prefix of this MosaicViewProperties. - :rtype: str - """ # noqa: E501 - return self._x_prefix - - @x_prefix.setter - def x_prefix(self, x_prefix): - """Set the x_prefix of this MosaicViewProperties. - - :param x_prefix: The x_prefix of this MosaicViewProperties. - :type: str - """ # noqa: E501 - if x_prefix is None: - raise ValueError("Invalid value for `x_prefix`, must not be `None`") # noqa: E501 - self._x_prefix = x_prefix - - @property - def x_suffix(self): - """Get the x_suffix of this MosaicViewProperties. - - :return: The x_suffix of this MosaicViewProperties. - :rtype: str - """ # noqa: E501 - return self._x_suffix - - @x_suffix.setter - def x_suffix(self, x_suffix): - """Set the x_suffix of this MosaicViewProperties. - - :param x_suffix: The x_suffix of this MosaicViewProperties. - :type: str - """ # noqa: E501 - if x_suffix is None: - raise ValueError("Invalid value for `x_suffix`, must not be `None`") # noqa: E501 - self._x_suffix = x_suffix - - @property - def y_prefix(self): - """Get the y_prefix of this MosaicViewProperties. - - :return: The y_prefix of this MosaicViewProperties. - :rtype: str - """ # noqa: E501 - return self._y_prefix - - @y_prefix.setter - def y_prefix(self, y_prefix): - """Set the y_prefix of this MosaicViewProperties. - - :param y_prefix: The y_prefix of this MosaicViewProperties. - :type: str - """ # noqa: E501 - if y_prefix is None: - raise ValueError("Invalid value for `y_prefix`, must not be `None`") # noqa: E501 - self._y_prefix = y_prefix - - @property - def y_suffix(self): - """Get the y_suffix of this MosaicViewProperties. - - :return: The y_suffix of this MosaicViewProperties. - :rtype: str - """ # noqa: E501 - return self._y_suffix - - @y_suffix.setter - def y_suffix(self, y_suffix): - """Set the y_suffix of this MosaicViewProperties. - - :param y_suffix: The y_suffix of this MosaicViewProperties. - :type: str - """ # noqa: E501 - if y_suffix is None: - raise ValueError("Invalid value for `y_suffix`, must not be `None`") # noqa: E501 - self._y_suffix = y_suffix - - @property - def hover_dimension(self): - """Get the hover_dimension of this MosaicViewProperties. - - :return: The hover_dimension of this MosaicViewProperties. - :rtype: str - """ # noqa: E501 - return self._hover_dimension - - @hover_dimension.setter - def hover_dimension(self, hover_dimension): - """Set the hover_dimension of this MosaicViewProperties. - - :param hover_dimension: The hover_dimension of this MosaicViewProperties. - :type: str - """ # noqa: E501 - self._hover_dimension = hover_dimension - - @property - def legend_colorize_rows(self): - """Get the legend_colorize_rows of this MosaicViewProperties. - - :return: The legend_colorize_rows of this MosaicViewProperties. - :rtype: bool - """ # noqa: E501 - return self._legend_colorize_rows - - @legend_colorize_rows.setter - def legend_colorize_rows(self, legend_colorize_rows): - """Set the legend_colorize_rows of this MosaicViewProperties. - - :param legend_colorize_rows: The legend_colorize_rows of this MosaicViewProperties. - :type: bool - """ # noqa: E501 - self._legend_colorize_rows = legend_colorize_rows - - @property - def legend_hide(self): - """Get the legend_hide of this MosaicViewProperties. - - :return: The legend_hide of this MosaicViewProperties. - :rtype: bool - """ # noqa: E501 - return self._legend_hide - - @legend_hide.setter - def legend_hide(self, legend_hide): - """Set the legend_hide of this MosaicViewProperties. - - :param legend_hide: The legend_hide of this MosaicViewProperties. - :type: bool - """ # noqa: E501 - self._legend_hide = legend_hide - - @property - def legend_opacity(self): - """Get the legend_opacity of this MosaicViewProperties. - - :return: The legend_opacity of this MosaicViewProperties. - :rtype: float - """ # noqa: E501 - return self._legend_opacity - - @legend_opacity.setter - def legend_opacity(self, legend_opacity): - """Set the legend_opacity of this MosaicViewProperties. - - :param legend_opacity: The legend_opacity of this MosaicViewProperties. - :type: float - """ # noqa: E501 - self._legend_opacity = legend_opacity - - @property - def legend_orientation_threshold(self): - """Get the legend_orientation_threshold of this MosaicViewProperties. - - :return: The legend_orientation_threshold of this MosaicViewProperties. - :rtype: int - """ # noqa: E501 - return self._legend_orientation_threshold - - @legend_orientation_threshold.setter - def legend_orientation_threshold(self, legend_orientation_threshold): - """Set the legend_orientation_threshold of this MosaicViewProperties. - - :param legend_orientation_threshold: The legend_orientation_threshold of this MosaicViewProperties. - :type: int - """ # noqa: E501 - self._legend_orientation_threshold = legend_orientation_threshold - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, MosaicViewProperties): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/node.py b/frogpilot/third_party/influxdb_client/domain/node.py deleted file mode 100644 index c254c62a..00000000 --- a/frogpilot/third_party/influxdb_client/domain/node.py +++ /dev/null @@ -1,82 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class Node(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501,D401,D403 - """Node - a model defined in OpenAPI.""" # noqa: E501 self.discriminator = None - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Node): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/notification_endpoint.py b/frogpilot/third_party/influxdb_client/domain/notification_endpoint.py deleted file mode 100644 index 3d0a886e..00000000 --- a/frogpilot/third_party/influxdb_client/domain/notification_endpoint.py +++ /dev/null @@ -1,121 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class NotificationEndpoint(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'NotificationEndpointType' - } - - attribute_map = { - 'type': 'type' - } - - discriminator_value_class_map = { - 'slack': 'SlackNotificationEndpoint', - 'pagerduty': 'PagerDutyNotificationEndpoint', - 'http': 'HTTPNotificationEndpoint', - 'telegram': 'TelegramNotificationEndpoint' - } - - def __init__(self, type=None): # noqa: E501,D401,D403 - """NotificationEndpoint - a model defined in OpenAPI.""" # noqa: E501 - self._type = None - self.discriminator = 'type' - - self.type = type - - @property - def type(self): - """Get the type of this NotificationEndpoint. - - :return: The type of this NotificationEndpoint. - :rtype: NotificationEndpointType - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this NotificationEndpoint. - - :param type: The type of this NotificationEndpoint. - :type: NotificationEndpointType - """ # noqa: E501 - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - self._type = type - - def get_real_child_model(self, data): - """Return the real base class specified by the discriminator.""" - discriminator_key = self.attribute_map[self.discriminator] - discriminator_value = data[discriminator_key] - return self.discriminator_value_class_map.get(discriminator_value) - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, NotificationEndpoint): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/notification_endpoint_base.py b/frogpilot/third_party/influxdb_client/domain/notification_endpoint_base.py deleted file mode 100644 index 3ac9da02..00000000 --- a/frogpilot/third_party/influxdb_client/domain/notification_endpoint_base.py +++ /dev/null @@ -1,347 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class NotificationEndpointBase(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'str', - 'org_id': 'str', - 'user_id': 'str', - 'created_at': 'datetime', - 'updated_at': 'datetime', - 'description': 'str', - 'name': 'str', - 'status': 'str', - 'labels': 'list[Label]', - 'links': 'NotificationEndpointBaseLinks', - 'type': 'NotificationEndpointType' - } - - attribute_map = { - 'id': 'id', - 'org_id': 'orgID', - 'user_id': 'userID', - 'created_at': 'createdAt', - 'updated_at': 'updatedAt', - 'description': 'description', - 'name': 'name', - 'status': 'status', - 'labels': 'labels', - 'links': 'links', - 'type': 'type' - } - - def __init__(self, id=None, org_id=None, user_id=None, created_at=None, updated_at=None, description=None, name=None, status='active', labels=None, links=None, type=None): # noqa: E501,D401,D403 - """NotificationEndpointBase - a model defined in OpenAPI.""" # noqa: E501 - self._id = None - self._org_id = None - self._user_id = None - self._created_at = None - self._updated_at = None - self._description = None - self._name = None - self._status = None - self._labels = None - self._links = None - self._type = None - self.discriminator = None - - if id is not None: - self.id = id - if org_id is not None: - self.org_id = org_id - if user_id is not None: - self.user_id = user_id - if created_at is not None: - self.created_at = created_at - if updated_at is not None: - self.updated_at = updated_at - if description is not None: - self.description = description - self.name = name - if status is not None: - self.status = status - if labels is not None: - self.labels = labels - if links is not None: - self.links = links - self.type = type - - @property - def id(self): - """Get the id of this NotificationEndpointBase. - - :return: The id of this NotificationEndpointBase. - :rtype: str - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this NotificationEndpointBase. - - :param id: The id of this NotificationEndpointBase. - :type: str - """ # noqa: E501 - self._id = id - - @property - def org_id(self): - """Get the org_id of this NotificationEndpointBase. - - :return: The org_id of this NotificationEndpointBase. - :rtype: str - """ # noqa: E501 - return self._org_id - - @org_id.setter - def org_id(self, org_id): - """Set the org_id of this NotificationEndpointBase. - - :param org_id: The org_id of this NotificationEndpointBase. - :type: str - """ # noqa: E501 - self._org_id = org_id - - @property - def user_id(self): - """Get the user_id of this NotificationEndpointBase. - - :return: The user_id of this NotificationEndpointBase. - :rtype: str - """ # noqa: E501 - return self._user_id - - @user_id.setter - def user_id(self, user_id): - """Set the user_id of this NotificationEndpointBase. - - :param user_id: The user_id of this NotificationEndpointBase. - :type: str - """ # noqa: E501 - self._user_id = user_id - - @property - def created_at(self): - """Get the created_at of this NotificationEndpointBase. - - :return: The created_at of this NotificationEndpointBase. - :rtype: datetime - """ # noqa: E501 - return self._created_at - - @created_at.setter - def created_at(self, created_at): - """Set the created_at of this NotificationEndpointBase. - - :param created_at: The created_at of this NotificationEndpointBase. - :type: datetime - """ # noqa: E501 - self._created_at = created_at - - @property - def updated_at(self): - """Get the updated_at of this NotificationEndpointBase. - - :return: The updated_at of this NotificationEndpointBase. - :rtype: datetime - """ # noqa: E501 - return self._updated_at - - @updated_at.setter - def updated_at(self, updated_at): - """Set the updated_at of this NotificationEndpointBase. - - :param updated_at: The updated_at of this NotificationEndpointBase. - :type: datetime - """ # noqa: E501 - self._updated_at = updated_at - - @property - def description(self): - """Get the description of this NotificationEndpointBase. - - An optional description of the notification endpoint. - - :return: The description of this NotificationEndpointBase. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this NotificationEndpointBase. - - An optional description of the notification endpoint. - - :param description: The description of this NotificationEndpointBase. - :type: str - """ # noqa: E501 - self._description = description - - @property - def name(self): - """Get the name of this NotificationEndpointBase. - - :return: The name of this NotificationEndpointBase. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this NotificationEndpointBase. - - :param name: The name of this NotificationEndpointBase. - :type: str - """ # noqa: E501 - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - self._name = name - - @property - def status(self): - """Get the status of this NotificationEndpointBase. - - The status of the endpoint. - - :return: The status of this NotificationEndpointBase. - :rtype: str - """ # noqa: E501 - return self._status - - @status.setter - def status(self, status): - """Set the status of this NotificationEndpointBase. - - The status of the endpoint. - - :param status: The status of this NotificationEndpointBase. - :type: str - """ # noqa: E501 - self._status = status - - @property - def labels(self): - """Get the labels of this NotificationEndpointBase. - - :return: The labels of this NotificationEndpointBase. - :rtype: list[Label] - """ # noqa: E501 - return self._labels - - @labels.setter - def labels(self, labels): - """Set the labels of this NotificationEndpointBase. - - :param labels: The labels of this NotificationEndpointBase. - :type: list[Label] - """ # noqa: E501 - self._labels = labels - - @property - def links(self): - """Get the links of this NotificationEndpointBase. - - :return: The links of this NotificationEndpointBase. - :rtype: NotificationEndpointBaseLinks - """ # noqa: E501 - return self._links - - @links.setter - def links(self, links): - """Set the links of this NotificationEndpointBase. - - :param links: The links of this NotificationEndpointBase. - :type: NotificationEndpointBaseLinks - """ # noqa: E501 - self._links = links - - @property - def type(self): - """Get the type of this NotificationEndpointBase. - - :return: The type of this NotificationEndpointBase. - :rtype: NotificationEndpointType - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this NotificationEndpointBase. - - :param type: The type of this NotificationEndpointBase. - :type: NotificationEndpointType - """ # noqa: E501 - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - self._type = type - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, NotificationEndpointBase): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/notification_endpoint_base_links.py b/frogpilot/third_party/influxdb_client/domain/notification_endpoint_base_links.py deleted file mode 100644 index 4ff93cc7..00000000 --- a/frogpilot/third_party/influxdb_client/domain/notification_endpoint_base_links.py +++ /dev/null @@ -1,192 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class NotificationEndpointBaseLinks(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - '_self': 'str', - 'labels': 'str', - 'members': 'str', - 'owners': 'str' - } - - attribute_map = { - '_self': 'self', - 'labels': 'labels', - 'members': 'members', - 'owners': 'owners' - } - - def __init__(self, _self=None, labels=None, members=None, owners=None): # noqa: E501,D401,D403 - """NotificationEndpointBaseLinks - a model defined in OpenAPI.""" # noqa: E501 - self.__self = None - self._labels = None - self._members = None - self._owners = None - self.discriminator = None - - if _self is not None: - self._self = _self - if labels is not None: - self.labels = labels - if members is not None: - self.members = members - if owners is not None: - self.owners = owners - - @property - def _self(self): - """Get the _self of this NotificationEndpointBaseLinks. - - URI of resource. - - :return: The _self of this NotificationEndpointBaseLinks. - :rtype: str - """ # noqa: E501 - return self.__self - - @_self.setter - def _self(self, _self): - """Set the _self of this NotificationEndpointBaseLinks. - - URI of resource. - - :param _self: The _self of this NotificationEndpointBaseLinks. - :type: str - """ # noqa: E501 - self.__self = _self - - @property - def labels(self): - """Get the labels of this NotificationEndpointBaseLinks. - - URI of resource. - - :return: The labels of this NotificationEndpointBaseLinks. - :rtype: str - """ # noqa: E501 - return self._labels - - @labels.setter - def labels(self, labels): - """Set the labels of this NotificationEndpointBaseLinks. - - URI of resource. - - :param labels: The labels of this NotificationEndpointBaseLinks. - :type: str - """ # noqa: E501 - self._labels = labels - - @property - def members(self): - """Get the members of this NotificationEndpointBaseLinks. - - URI of resource. - - :return: The members of this NotificationEndpointBaseLinks. - :rtype: str - """ # noqa: E501 - return self._members - - @members.setter - def members(self, members): - """Set the members of this NotificationEndpointBaseLinks. - - URI of resource. - - :param members: The members of this NotificationEndpointBaseLinks. - :type: str - """ # noqa: E501 - self._members = members - - @property - def owners(self): - """Get the owners of this NotificationEndpointBaseLinks. - - URI of resource. - - :return: The owners of this NotificationEndpointBaseLinks. - :rtype: str - """ # noqa: E501 - return self._owners - - @owners.setter - def owners(self, owners): - """Set the owners of this NotificationEndpointBaseLinks. - - URI of resource. - - :param owners: The owners of this NotificationEndpointBaseLinks. - :type: str - """ # noqa: E501 - self._owners = owners - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, NotificationEndpointBaseLinks): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/notification_endpoint_discriminator.py b/frogpilot/third_party/influxdb_client/domain/notification_endpoint_discriminator.py deleted file mode 100644 index b285c12d..00000000 --- a/frogpilot/third_party/influxdb_client/domain/notification_endpoint_discriminator.py +++ /dev/null @@ -1,108 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.notification_endpoint_base import NotificationEndpointBase - - -class NotificationEndpointDiscriminator(NotificationEndpointBase): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'str', - 'org_id': 'str', - 'user_id': 'str', - 'created_at': 'datetime', - 'updated_at': 'datetime', - 'description': 'str', - 'name': 'str', - 'status': 'str', - 'labels': 'list[Label]', - 'links': 'NotificationEndpointBaseLinks', - 'type': 'NotificationEndpointType' - } - - attribute_map = { - 'id': 'id', - 'org_id': 'orgID', - 'user_id': 'userID', - 'created_at': 'createdAt', - 'updated_at': 'updatedAt', - 'description': 'description', - 'name': 'name', - 'status': 'status', - 'labels': 'labels', - 'links': 'links', - 'type': 'type' - } - - def __init__(self, id=None, org_id=None, user_id=None, created_at=None, updated_at=None, description=None, name=None, status='active', labels=None, links=None, type=None): # noqa: E501,D401,D403 - """NotificationEndpointDiscriminator - a model defined in OpenAPI.""" # noqa: E501 - NotificationEndpointBase.__init__(self, id=id, org_id=org_id, user_id=user_id, created_at=created_at, updated_at=updated_at, description=description, name=name, status=status, labels=labels, links=links, type=type) # noqa: E501 - self.discriminator = None - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, NotificationEndpointDiscriminator): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/notification_endpoint_type.py b/frogpilot/third_party/influxdb_client/domain/notification_endpoint_type.py deleted file mode 100644 index 50ae3382..00000000 --- a/frogpilot/third_party/influxdb_client/domain/notification_endpoint_type.py +++ /dev/null @@ -1,90 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class NotificationEndpointType(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - allowed enum values - """ - SLACK = "slack" - PAGERDUTY = "pagerduty" - HTTP = "http" - TELEGRAM = "telegram" - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501,D401,D403 - """NotificationEndpointType - a model defined in OpenAPI.""" # noqa: E501 self.discriminator = None - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, NotificationEndpointType): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/notification_endpoint_update.py b/frogpilot/third_party/influxdb_client/domain/notification_endpoint_update.py deleted file mode 100644 index 4e63b1ff..00000000 --- a/frogpilot/third_party/influxdb_client/domain/notification_endpoint_update.py +++ /dev/null @@ -1,153 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class NotificationEndpointUpdate(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str', - 'description': 'str', - 'status': 'str' - } - - attribute_map = { - 'name': 'name', - 'description': 'description', - 'status': 'status' - } - - def __init__(self, name=None, description=None, status=None): # noqa: E501,D401,D403 - """NotificationEndpointUpdate - a model defined in OpenAPI.""" # noqa: E501 - self._name = None - self._description = None - self._status = None - self.discriminator = None - - if name is not None: - self.name = name - if description is not None: - self.description = description - if status is not None: - self.status = status - - @property - def name(self): - """Get the name of this NotificationEndpointUpdate. - - :return: The name of this NotificationEndpointUpdate. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this NotificationEndpointUpdate. - - :param name: The name of this NotificationEndpointUpdate. - :type: str - """ # noqa: E501 - self._name = name - - @property - def description(self): - """Get the description of this NotificationEndpointUpdate. - - :return: The description of this NotificationEndpointUpdate. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this NotificationEndpointUpdate. - - :param description: The description of this NotificationEndpointUpdate. - :type: str - """ # noqa: E501 - self._description = description - - @property - def status(self): - """Get the status of this NotificationEndpointUpdate. - - :return: The status of this NotificationEndpointUpdate. - :rtype: str - """ # noqa: E501 - return self._status - - @status.setter - def status(self, status): - """Set the status of this NotificationEndpointUpdate. - - :param status: The status of this NotificationEndpointUpdate. - :type: str - """ # noqa: E501 - self._status = status - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, NotificationEndpointUpdate): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/notification_endpoints.py b/frogpilot/third_party/influxdb_client/domain/notification_endpoints.py deleted file mode 100644 index 55c2ec93..00000000 --- a/frogpilot/third_party/influxdb_client/domain/notification_endpoints.py +++ /dev/null @@ -1,130 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class NotificationEndpoints(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'notification_endpoints': 'list[NotificationEndpoint]', - 'links': 'Links' - } - - attribute_map = { - 'notification_endpoints': 'notificationEndpoints', - 'links': 'links' - } - - def __init__(self, notification_endpoints=None, links=None): # noqa: E501,D401,D403 - """NotificationEndpoints - a model defined in OpenAPI.""" # noqa: E501 - self._notification_endpoints = None - self._links = None - self.discriminator = None - - if notification_endpoints is not None: - self.notification_endpoints = notification_endpoints - if links is not None: - self.links = links - - @property - def notification_endpoints(self): - """Get the notification_endpoints of this NotificationEndpoints. - - :return: The notification_endpoints of this NotificationEndpoints. - :rtype: list[NotificationEndpoint] - """ # noqa: E501 - return self._notification_endpoints - - @notification_endpoints.setter - def notification_endpoints(self, notification_endpoints): - """Set the notification_endpoints of this NotificationEndpoints. - - :param notification_endpoints: The notification_endpoints of this NotificationEndpoints. - :type: list[NotificationEndpoint] - """ # noqa: E501 - self._notification_endpoints = notification_endpoints - - @property - def links(self): - """Get the links of this NotificationEndpoints. - - :return: The links of this NotificationEndpoints. - :rtype: Links - """ # noqa: E501 - return self._links - - @links.setter - def links(self, links): - """Set the links of this NotificationEndpoints. - - :param links: The links of this NotificationEndpoints. - :type: Links - """ # noqa: E501 - self._links = links - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, NotificationEndpoints): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/notification_rule.py b/frogpilot/third_party/influxdb_client/domain/notification_rule.py deleted file mode 100644 index b22e53bb..00000000 --- a/frogpilot/third_party/influxdb_client/domain/notification_rule.py +++ /dev/null @@ -1,126 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class NotificationRule(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str' - } - - attribute_map = { - 'type': 'type' - } - - discriminator_value_class_map = { - 'slack': 'SlackNotificationRule', - 'pagerduty': 'PagerDutyNotificationRule', - 'smtp': 'SMTPNotificationRule', - 'http': 'HTTPNotificationRule', - 'telegram': 'TelegramNotificationRule' - } - - def __init__(self, type=None): # noqa: E501,D401,D403 - """NotificationRule - a model defined in OpenAPI.""" # noqa: E501 - self._type = None - self.discriminator = 'type' - - self.type = type - - @property - def type(self): - """Get the type of this NotificationRule. - - The discriminator between other types of notification rules is "telegram". - - :return: The type of this NotificationRule. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this NotificationRule. - - The discriminator between other types of notification rules is "telegram". - - :param type: The type of this NotificationRule. - :type: str - """ # noqa: E501 - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - self._type = type - - def get_real_child_model(self, data): - """Return the real base class specified by the discriminator.""" - discriminator_key = self.attribute_map[self.discriminator] - discriminator_value = data[discriminator_key] - return self.discriminator_value_class_map.get(discriminator_value) - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, NotificationRule): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/notification_rule_base.py b/frogpilot/third_party/influxdb_client/domain/notification_rule_base.py deleted file mode 100644 index 6f3de002..00000000 --- a/frogpilot/third_party/influxdb_client/domain/notification_rule_base.py +++ /dev/null @@ -1,666 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class NotificationRuleBase(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'latest_completed': 'datetime', - 'last_run_status': 'str', - 'last_run_error': 'str', - 'id': 'str', - 'endpoint_id': 'str', - 'org_id': 'str', - 'task_id': 'str', - 'owner_id': 'str', - 'created_at': 'datetime', - 'updated_at': 'datetime', - 'status': 'TaskStatusType', - 'name': 'str', - 'sleep_until': 'str', - 'every': 'str', - 'offset': 'str', - 'runbook_link': 'str', - 'limit_every': 'int', - 'limit': 'int', - 'tag_rules': 'list[TagRule]', - 'description': 'str', - 'status_rules': 'list[StatusRule]', - 'labels': 'list[Label]', - 'links': 'NotificationRuleBaseLinks' - } - - attribute_map = { - 'latest_completed': 'latestCompleted', - 'last_run_status': 'lastRunStatus', - 'last_run_error': 'lastRunError', - 'id': 'id', - 'endpoint_id': 'endpointID', - 'org_id': 'orgID', - 'task_id': 'taskID', - 'owner_id': 'ownerID', - 'created_at': 'createdAt', - 'updated_at': 'updatedAt', - 'status': 'status', - 'name': 'name', - 'sleep_until': 'sleepUntil', - 'every': 'every', - 'offset': 'offset', - 'runbook_link': 'runbookLink', - 'limit_every': 'limitEvery', - 'limit': 'limit', - 'tag_rules': 'tagRules', - 'description': 'description', - 'status_rules': 'statusRules', - 'labels': 'labels', - 'links': 'links' - } - - def __init__(self, latest_completed=None, last_run_status=None, last_run_error=None, id=None, endpoint_id=None, org_id=None, task_id=None, owner_id=None, created_at=None, updated_at=None, status=None, name=None, sleep_until=None, every=None, offset=None, runbook_link=None, limit_every=None, limit=None, tag_rules=None, description=None, status_rules=None, labels=None, links=None): # noqa: E501,D401,D403 - """NotificationRuleBase - a model defined in OpenAPI.""" # noqa: E501 - self._latest_completed = None - self._last_run_status = None - self._last_run_error = None - self._id = None - self._endpoint_id = None - self._org_id = None - self._task_id = None - self._owner_id = None - self._created_at = None - self._updated_at = None - self._status = None - self._name = None - self._sleep_until = None - self._every = None - self._offset = None - self._runbook_link = None - self._limit_every = None - self._limit = None - self._tag_rules = None - self._description = None - self._status_rules = None - self._labels = None - self._links = None - self.discriminator = None - - if latest_completed is not None: - self.latest_completed = latest_completed - if last_run_status is not None: - self.last_run_status = last_run_status - if last_run_error is not None: - self.last_run_error = last_run_error - if id is not None: - self.id = id - self.endpoint_id = endpoint_id - self.org_id = org_id - if task_id is not None: - self.task_id = task_id - if owner_id is not None: - self.owner_id = owner_id - if created_at is not None: - self.created_at = created_at - if updated_at is not None: - self.updated_at = updated_at - self.status = status - self.name = name - if sleep_until is not None: - self.sleep_until = sleep_until - if every is not None: - self.every = every - if offset is not None: - self.offset = offset - if runbook_link is not None: - self.runbook_link = runbook_link - if limit_every is not None: - self.limit_every = limit_every - if limit is not None: - self.limit = limit - if tag_rules is not None: - self.tag_rules = tag_rules - if description is not None: - self.description = description - self.status_rules = status_rules - if labels is not None: - self.labels = labels - if links is not None: - self.links = links - - @property - def latest_completed(self): - """Get the latest_completed of this NotificationRuleBase. - - A timestamp ([RFC3339 date/time format](https://docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339-timestamp)) of the latest scheduled and completed run. - - :return: The latest_completed of this NotificationRuleBase. - :rtype: datetime - """ # noqa: E501 - return self._latest_completed - - @latest_completed.setter - def latest_completed(self, latest_completed): - """Set the latest_completed of this NotificationRuleBase. - - A timestamp ([RFC3339 date/time format](https://docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339-timestamp)) of the latest scheduled and completed run. - - :param latest_completed: The latest_completed of this NotificationRuleBase. - :type: datetime - """ # noqa: E501 - self._latest_completed = latest_completed - - @property - def last_run_status(self): - """Get the last_run_status of this NotificationRuleBase. - - :return: The last_run_status of this NotificationRuleBase. - :rtype: str - """ # noqa: E501 - return self._last_run_status - - @last_run_status.setter - def last_run_status(self, last_run_status): - """Set the last_run_status of this NotificationRuleBase. - - :param last_run_status: The last_run_status of this NotificationRuleBase. - :type: str - """ # noqa: E501 - self._last_run_status = last_run_status - - @property - def last_run_error(self): - """Get the last_run_error of this NotificationRuleBase. - - :return: The last_run_error of this NotificationRuleBase. - :rtype: str - """ # noqa: E501 - return self._last_run_error - - @last_run_error.setter - def last_run_error(self, last_run_error): - """Set the last_run_error of this NotificationRuleBase. - - :param last_run_error: The last_run_error of this NotificationRuleBase. - :type: str - """ # noqa: E501 - self._last_run_error = last_run_error - - @property - def id(self): - """Get the id of this NotificationRuleBase. - - :return: The id of this NotificationRuleBase. - :rtype: str - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this NotificationRuleBase. - - :param id: The id of this NotificationRuleBase. - :type: str - """ # noqa: E501 - self._id = id - - @property - def endpoint_id(self): - """Get the endpoint_id of this NotificationRuleBase. - - :return: The endpoint_id of this NotificationRuleBase. - :rtype: str - """ # noqa: E501 - return self._endpoint_id - - @endpoint_id.setter - def endpoint_id(self, endpoint_id): - """Set the endpoint_id of this NotificationRuleBase. - - :param endpoint_id: The endpoint_id of this NotificationRuleBase. - :type: str - """ # noqa: E501 - if endpoint_id is None: - raise ValueError("Invalid value for `endpoint_id`, must not be `None`") # noqa: E501 - self._endpoint_id = endpoint_id - - @property - def org_id(self): - """Get the org_id of this NotificationRuleBase. - - The ID of the organization that owns this notification rule. - - :return: The org_id of this NotificationRuleBase. - :rtype: str - """ # noqa: E501 - return self._org_id - - @org_id.setter - def org_id(self, org_id): - """Set the org_id of this NotificationRuleBase. - - The ID of the organization that owns this notification rule. - - :param org_id: The org_id of this NotificationRuleBase. - :type: str - """ # noqa: E501 - if org_id is None: - raise ValueError("Invalid value for `org_id`, must not be `None`") # noqa: E501 - self._org_id = org_id - - @property - def task_id(self): - """Get the task_id of this NotificationRuleBase. - - The ID of the task associated with this notification rule. - - :return: The task_id of this NotificationRuleBase. - :rtype: str - """ # noqa: E501 - return self._task_id - - @task_id.setter - def task_id(self, task_id): - """Set the task_id of this NotificationRuleBase. - - The ID of the task associated with this notification rule. - - :param task_id: The task_id of this NotificationRuleBase. - :type: str - """ # noqa: E501 - self._task_id = task_id - - @property - def owner_id(self): - """Get the owner_id of this NotificationRuleBase. - - The ID of creator used to create this notification rule. - - :return: The owner_id of this NotificationRuleBase. - :rtype: str - """ # noqa: E501 - return self._owner_id - - @owner_id.setter - def owner_id(self, owner_id): - """Set the owner_id of this NotificationRuleBase. - - The ID of creator used to create this notification rule. - - :param owner_id: The owner_id of this NotificationRuleBase. - :type: str - """ # noqa: E501 - self._owner_id = owner_id - - @property - def created_at(self): - """Get the created_at of this NotificationRuleBase. - - :return: The created_at of this NotificationRuleBase. - :rtype: datetime - """ # noqa: E501 - return self._created_at - - @created_at.setter - def created_at(self, created_at): - """Set the created_at of this NotificationRuleBase. - - :param created_at: The created_at of this NotificationRuleBase. - :type: datetime - """ # noqa: E501 - self._created_at = created_at - - @property - def updated_at(self): - """Get the updated_at of this NotificationRuleBase. - - :return: The updated_at of this NotificationRuleBase. - :rtype: datetime - """ # noqa: E501 - return self._updated_at - - @updated_at.setter - def updated_at(self, updated_at): - """Set the updated_at of this NotificationRuleBase. - - :param updated_at: The updated_at of this NotificationRuleBase. - :type: datetime - """ # noqa: E501 - self._updated_at = updated_at - - @property - def status(self): - """Get the status of this NotificationRuleBase. - - :return: The status of this NotificationRuleBase. - :rtype: TaskStatusType - """ # noqa: E501 - return self._status - - @status.setter - def status(self, status): - """Set the status of this NotificationRuleBase. - - :param status: The status of this NotificationRuleBase. - :type: TaskStatusType - """ # noqa: E501 - if status is None: - raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 - self._status = status - - @property - def name(self): - """Get the name of this NotificationRuleBase. - - Human-readable name describing the notification rule. - - :return: The name of this NotificationRuleBase. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this NotificationRuleBase. - - Human-readable name describing the notification rule. - - :param name: The name of this NotificationRuleBase. - :type: str - """ # noqa: E501 - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - self._name = name - - @property - def sleep_until(self): - """Get the sleep_until of this NotificationRuleBase. - - :return: The sleep_until of this NotificationRuleBase. - :rtype: str - """ # noqa: E501 - return self._sleep_until - - @sleep_until.setter - def sleep_until(self, sleep_until): - """Set the sleep_until of this NotificationRuleBase. - - :param sleep_until: The sleep_until of this NotificationRuleBase. - :type: str - """ # noqa: E501 - self._sleep_until = sleep_until - - @property - def every(self): - """Get the every of this NotificationRuleBase. - - The notification repetition interval. - - :return: The every of this NotificationRuleBase. - :rtype: str - """ # noqa: E501 - return self._every - - @every.setter - def every(self, every): - """Set the every of this NotificationRuleBase. - - The notification repetition interval. - - :param every: The every of this NotificationRuleBase. - :type: str - """ # noqa: E501 - self._every = every - - @property - def offset(self): - """Get the offset of this NotificationRuleBase. - - Duration to delay after the schedule, before executing check. - - :return: The offset of this NotificationRuleBase. - :rtype: str - """ # noqa: E501 - return self._offset - - @offset.setter - def offset(self, offset): - """Set the offset of this NotificationRuleBase. - - Duration to delay after the schedule, before executing check. - - :param offset: The offset of this NotificationRuleBase. - :type: str - """ # noqa: E501 - self._offset = offset - - @property - def runbook_link(self): - """Get the runbook_link of this NotificationRuleBase. - - :return: The runbook_link of this NotificationRuleBase. - :rtype: str - """ # noqa: E501 - return self._runbook_link - - @runbook_link.setter - def runbook_link(self, runbook_link): - """Set the runbook_link of this NotificationRuleBase. - - :param runbook_link: The runbook_link of this NotificationRuleBase. - :type: str - """ # noqa: E501 - self._runbook_link = runbook_link - - @property - def limit_every(self): - """Get the limit_every of this NotificationRuleBase. - - Don't notify me more than times every seconds. If set, limit cannot be empty. - - :return: The limit_every of this NotificationRuleBase. - :rtype: int - """ # noqa: E501 - return self._limit_every - - @limit_every.setter - def limit_every(self, limit_every): - """Set the limit_every of this NotificationRuleBase. - - Don't notify me more than times every seconds. If set, limit cannot be empty. - - :param limit_every: The limit_every of this NotificationRuleBase. - :type: int - """ # noqa: E501 - self._limit_every = limit_every - - @property - def limit(self): - """Get the limit of this NotificationRuleBase. - - Don't notify me more than times every seconds. If set, limitEvery cannot be empty. - - :return: The limit of this NotificationRuleBase. - :rtype: int - """ # noqa: E501 - return self._limit - - @limit.setter - def limit(self, limit): - """Set the limit of this NotificationRuleBase. - - Don't notify me more than times every seconds. If set, limitEvery cannot be empty. - - :param limit: The limit of this NotificationRuleBase. - :type: int - """ # noqa: E501 - self._limit = limit - - @property - def tag_rules(self): - """Get the tag_rules of this NotificationRuleBase. - - List of tag rules the notification rule attempts to match. - - :return: The tag_rules of this NotificationRuleBase. - :rtype: list[TagRule] - """ # noqa: E501 - return self._tag_rules - - @tag_rules.setter - def tag_rules(self, tag_rules): - """Set the tag_rules of this NotificationRuleBase. - - List of tag rules the notification rule attempts to match. - - :param tag_rules: The tag_rules of this NotificationRuleBase. - :type: list[TagRule] - """ # noqa: E501 - self._tag_rules = tag_rules - - @property - def description(self): - """Get the description of this NotificationRuleBase. - - An optional description of the notification rule. - - :return: The description of this NotificationRuleBase. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this NotificationRuleBase. - - An optional description of the notification rule. - - :param description: The description of this NotificationRuleBase. - :type: str - """ # noqa: E501 - self._description = description - - @property - def status_rules(self): - """Get the status_rules of this NotificationRuleBase. - - List of status rules the notification rule attempts to match. - - :return: The status_rules of this NotificationRuleBase. - :rtype: list[StatusRule] - """ # noqa: E501 - return self._status_rules - - @status_rules.setter - def status_rules(self, status_rules): - """Set the status_rules of this NotificationRuleBase. - - List of status rules the notification rule attempts to match. - - :param status_rules: The status_rules of this NotificationRuleBase. - :type: list[StatusRule] - """ # noqa: E501 - if status_rules is None: - raise ValueError("Invalid value for `status_rules`, must not be `None`") # noqa: E501 - self._status_rules = status_rules - - @property - def labels(self): - """Get the labels of this NotificationRuleBase. - - :return: The labels of this NotificationRuleBase. - :rtype: list[Label] - """ # noqa: E501 - return self._labels - - @labels.setter - def labels(self, labels): - """Set the labels of this NotificationRuleBase. - - :param labels: The labels of this NotificationRuleBase. - :type: list[Label] - """ # noqa: E501 - self._labels = labels - - @property - def links(self): - """Get the links of this NotificationRuleBase. - - :return: The links of this NotificationRuleBase. - :rtype: NotificationRuleBaseLinks - """ # noqa: E501 - return self._links - - @links.setter - def links(self, links): - """Set the links of this NotificationRuleBase. - - :param links: The links of this NotificationRuleBase. - :type: NotificationRuleBaseLinks - """ # noqa: E501 - self._links = links - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, NotificationRuleBase): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/notification_rule_base_links.py b/frogpilot/third_party/influxdb_client/domain/notification_rule_base_links.py deleted file mode 100644 index 2f6e1c25..00000000 --- a/frogpilot/third_party/influxdb_client/domain/notification_rule_base_links.py +++ /dev/null @@ -1,219 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class NotificationRuleBaseLinks(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - '_self': 'str', - 'labels': 'str', - 'members': 'str', - 'owners': 'str', - 'query': 'str' - } - - attribute_map = { - '_self': 'self', - 'labels': 'labels', - 'members': 'members', - 'owners': 'owners', - 'query': 'query' - } - - def __init__(self, _self=None, labels=None, members=None, owners=None, query=None): # noqa: E501,D401,D403 - """NotificationRuleBaseLinks - a model defined in OpenAPI.""" # noqa: E501 - self.__self = None - self._labels = None - self._members = None - self._owners = None - self._query = None - self.discriminator = None - - if _self is not None: - self._self = _self - if labels is not None: - self.labels = labels - if members is not None: - self.members = members - if owners is not None: - self.owners = owners - if query is not None: - self.query = query - - @property - def _self(self): - """Get the _self of this NotificationRuleBaseLinks. - - URI of resource. - - :return: The _self of this NotificationRuleBaseLinks. - :rtype: str - """ # noqa: E501 - return self.__self - - @_self.setter - def _self(self, _self): - """Set the _self of this NotificationRuleBaseLinks. - - URI of resource. - - :param _self: The _self of this NotificationRuleBaseLinks. - :type: str - """ # noqa: E501 - self.__self = _self - - @property - def labels(self): - """Get the labels of this NotificationRuleBaseLinks. - - URI of resource. - - :return: The labels of this NotificationRuleBaseLinks. - :rtype: str - """ # noqa: E501 - return self._labels - - @labels.setter - def labels(self, labels): - """Set the labels of this NotificationRuleBaseLinks. - - URI of resource. - - :param labels: The labels of this NotificationRuleBaseLinks. - :type: str - """ # noqa: E501 - self._labels = labels - - @property - def members(self): - """Get the members of this NotificationRuleBaseLinks. - - URI of resource. - - :return: The members of this NotificationRuleBaseLinks. - :rtype: str - """ # noqa: E501 - return self._members - - @members.setter - def members(self, members): - """Set the members of this NotificationRuleBaseLinks. - - URI of resource. - - :param members: The members of this NotificationRuleBaseLinks. - :type: str - """ # noqa: E501 - self._members = members - - @property - def owners(self): - """Get the owners of this NotificationRuleBaseLinks. - - URI of resource. - - :return: The owners of this NotificationRuleBaseLinks. - :rtype: str - """ # noqa: E501 - return self._owners - - @owners.setter - def owners(self, owners): - """Set the owners of this NotificationRuleBaseLinks. - - URI of resource. - - :param owners: The owners of this NotificationRuleBaseLinks. - :type: str - """ # noqa: E501 - self._owners = owners - - @property - def query(self): - """Get the query of this NotificationRuleBaseLinks. - - URI of resource. - - :return: The query of this NotificationRuleBaseLinks. - :rtype: str - """ # noqa: E501 - return self._query - - @query.setter - def query(self, query): - """Set the query of this NotificationRuleBaseLinks. - - URI of resource. - - :param query: The query of this NotificationRuleBaseLinks. - :type: str - """ # noqa: E501 - self._query = query - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, NotificationRuleBaseLinks): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/notification_rule_discriminator.py b/frogpilot/third_party/influxdb_client/domain/notification_rule_discriminator.py deleted file mode 100644 index a677fa52..00000000 --- a/frogpilot/third_party/influxdb_client/domain/notification_rule_discriminator.py +++ /dev/null @@ -1,132 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.notification_rule_base import NotificationRuleBase - - -class NotificationRuleDiscriminator(NotificationRuleBase): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'latest_completed': 'datetime', - 'last_run_status': 'str', - 'last_run_error': 'str', - 'id': 'str', - 'endpoint_id': 'str', - 'org_id': 'str', - 'task_id': 'str', - 'owner_id': 'str', - 'created_at': 'datetime', - 'updated_at': 'datetime', - 'status': 'TaskStatusType', - 'name': 'str', - 'sleep_until': 'str', - 'every': 'str', - 'offset': 'str', - 'runbook_link': 'str', - 'limit_every': 'int', - 'limit': 'int', - 'tag_rules': 'list[TagRule]', - 'description': 'str', - 'status_rules': 'list[StatusRule]', - 'labels': 'list[Label]', - 'links': 'NotificationRuleBaseLinks' - } - - attribute_map = { - 'latest_completed': 'latestCompleted', - 'last_run_status': 'lastRunStatus', - 'last_run_error': 'lastRunError', - 'id': 'id', - 'endpoint_id': 'endpointID', - 'org_id': 'orgID', - 'task_id': 'taskID', - 'owner_id': 'ownerID', - 'created_at': 'createdAt', - 'updated_at': 'updatedAt', - 'status': 'status', - 'name': 'name', - 'sleep_until': 'sleepUntil', - 'every': 'every', - 'offset': 'offset', - 'runbook_link': 'runbookLink', - 'limit_every': 'limitEvery', - 'limit': 'limit', - 'tag_rules': 'tagRules', - 'description': 'description', - 'status_rules': 'statusRules', - 'labels': 'labels', - 'links': 'links' - } - - def __init__(self, latest_completed=None, last_run_status=None, last_run_error=None, id=None, endpoint_id=None, org_id=None, task_id=None, owner_id=None, created_at=None, updated_at=None, status=None, name=None, sleep_until=None, every=None, offset=None, runbook_link=None, limit_every=None, limit=None, tag_rules=None, description=None, status_rules=None, labels=None, links=None): # noqa: E501,D401,D403 - """NotificationRuleDiscriminator - a model defined in OpenAPI.""" # noqa: E501 - NotificationRuleBase.__init__(self, latest_completed=latest_completed, last_run_status=last_run_status, last_run_error=last_run_error, id=id, endpoint_id=endpoint_id, org_id=org_id, task_id=task_id, owner_id=owner_id, created_at=created_at, updated_at=updated_at, status=status, name=name, sleep_until=sleep_until, every=every, offset=offset, runbook_link=runbook_link, limit_every=limit_every, limit=limit, tag_rules=tag_rules, description=description, status_rules=status_rules, labels=labels, links=links) # noqa: E501 - self.discriminator = None - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, NotificationRuleDiscriminator): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/notification_rule_update.py b/frogpilot/third_party/influxdb_client/domain/notification_rule_update.py deleted file mode 100644 index a8e9fa1f..00000000 --- a/frogpilot/third_party/influxdb_client/domain/notification_rule_update.py +++ /dev/null @@ -1,153 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class NotificationRuleUpdate(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str', - 'description': 'str', - 'status': 'str' - } - - attribute_map = { - 'name': 'name', - 'description': 'description', - 'status': 'status' - } - - def __init__(self, name=None, description=None, status=None): # noqa: E501,D401,D403 - """NotificationRuleUpdate - a model defined in OpenAPI.""" # noqa: E501 - self._name = None - self._description = None - self._status = None - self.discriminator = None - - if name is not None: - self.name = name - if description is not None: - self.description = description - if status is not None: - self.status = status - - @property - def name(self): - """Get the name of this NotificationRuleUpdate. - - :return: The name of this NotificationRuleUpdate. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this NotificationRuleUpdate. - - :param name: The name of this NotificationRuleUpdate. - :type: str - """ # noqa: E501 - self._name = name - - @property - def description(self): - """Get the description of this NotificationRuleUpdate. - - :return: The description of this NotificationRuleUpdate. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this NotificationRuleUpdate. - - :param description: The description of this NotificationRuleUpdate. - :type: str - """ # noqa: E501 - self._description = description - - @property - def status(self): - """Get the status of this NotificationRuleUpdate. - - :return: The status of this NotificationRuleUpdate. - :rtype: str - """ # noqa: E501 - return self._status - - @status.setter - def status(self, status): - """Set the status of this NotificationRuleUpdate. - - :param status: The status of this NotificationRuleUpdate. - :type: str - """ # noqa: E501 - self._status = status - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, NotificationRuleUpdate): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/notification_rules.py b/frogpilot/third_party/influxdb_client/domain/notification_rules.py deleted file mode 100644 index 08eaf6d8..00000000 --- a/frogpilot/third_party/influxdb_client/domain/notification_rules.py +++ /dev/null @@ -1,130 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class NotificationRules(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'notification_rules': 'list[NotificationRule]', - 'links': 'Links' - } - - attribute_map = { - 'notification_rules': 'notificationRules', - 'links': 'links' - } - - def __init__(self, notification_rules=None, links=None): # noqa: E501,D401,D403 - """NotificationRules - a model defined in OpenAPI.""" # noqa: E501 - self._notification_rules = None - self._links = None - self.discriminator = None - - if notification_rules is not None: - self.notification_rules = notification_rules - if links is not None: - self.links = links - - @property - def notification_rules(self): - """Get the notification_rules of this NotificationRules. - - :return: The notification_rules of this NotificationRules. - :rtype: list[NotificationRule] - """ # noqa: E501 - return self._notification_rules - - @notification_rules.setter - def notification_rules(self, notification_rules): - """Set the notification_rules of this NotificationRules. - - :param notification_rules: The notification_rules of this NotificationRules. - :type: list[NotificationRule] - """ # noqa: E501 - self._notification_rules = notification_rules - - @property - def links(self): - """Get the links of this NotificationRules. - - :return: The links of this NotificationRules. - :rtype: Links - """ # noqa: E501 - return self._links - - @links.setter - def links(self, links): - """Set the links of this NotificationRules. - - :param links: The links of this NotificationRules. - :type: Links - """ # noqa: E501 - self._links = links - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, NotificationRules): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/object_expression.py b/frogpilot/third_party/influxdb_client/domain/object_expression.py deleted file mode 100644 index 05ca2a05..00000000 --- a/frogpilot/third_party/influxdb_client/domain/object_expression.py +++ /dev/null @@ -1,142 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.expression import Expression - - -class ObjectExpression(Expression): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'properties': 'list[ModelProperty]' - } - - attribute_map = { - 'type': 'type', - 'properties': 'properties' - } - - def __init__(self, type=None, properties=None): # noqa: E501,D401,D403 - """ObjectExpression - a model defined in OpenAPI.""" # noqa: E501 - Expression.__init__(self) # noqa: E501 - - self._type = None - self._properties = None - self.discriminator = None - - if type is not None: - self.type = type - if properties is not None: - self.properties = properties - - @property - def type(self): - """Get the type of this ObjectExpression. - - Type of AST node - - :return: The type of this ObjectExpression. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this ObjectExpression. - - Type of AST node - - :param type: The type of this ObjectExpression. - :type: str - """ # noqa: E501 - self._type = type - - @property - def properties(self): - """Get the properties of this ObjectExpression. - - Object properties - - :return: The properties of this ObjectExpression. - :rtype: list[ModelProperty] - """ # noqa: E501 - return self._properties - - @properties.setter - def properties(self, properties): - """Set the properties of this ObjectExpression. - - Object properties - - :param properties: The properties of this ObjectExpression. - :type: list[ModelProperty] - """ # noqa: E501 - self._properties = properties - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, ObjectExpression): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/onboarding_request.py b/frogpilot/third_party/influxdb_client/domain/onboarding_request.py deleted file mode 100644 index 7ca4bf0c..00000000 --- a/frogpilot/third_party/influxdb_client/domain/onboarding_request.py +++ /dev/null @@ -1,256 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class OnboardingRequest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'username': 'str', - 'password': 'str', - 'org': 'str', - 'bucket': 'str', - 'retention_period_seconds': 'int', - 'retention_period_hrs': 'int', - 'token': 'str' - } - - attribute_map = { - 'username': 'username', - 'password': 'password', - 'org': 'org', - 'bucket': 'bucket', - 'retention_period_seconds': 'retentionPeriodSeconds', - 'retention_period_hrs': 'retentionPeriodHrs', - 'token': 'token' - } - - def __init__(self, username=None, password=None, org=None, bucket=None, retention_period_seconds=None, retention_period_hrs=None, token=None): # noqa: E501,D401,D403 - """OnboardingRequest - a model defined in OpenAPI.""" # noqa: E501 - self._username = None - self._password = None - self._org = None - self._bucket = None - self._retention_period_seconds = None - self._retention_period_hrs = None - self._token = None - self.discriminator = None - - self.username = username - if password is not None: - self.password = password - self.org = org - self.bucket = bucket - if retention_period_seconds is not None: - self.retention_period_seconds = retention_period_seconds - if retention_period_hrs is not None: - self.retention_period_hrs = retention_period_hrs - if token is not None: - self.token = token - - @property - def username(self): - """Get the username of this OnboardingRequest. - - :return: The username of this OnboardingRequest. - :rtype: str - """ # noqa: E501 - return self._username - - @username.setter - def username(self, username): - """Set the username of this OnboardingRequest. - - :param username: The username of this OnboardingRequest. - :type: str - """ # noqa: E501 - if username is None: - raise ValueError("Invalid value for `username`, must not be `None`") # noqa: E501 - self._username = username - - @property - def password(self): - """Get the password of this OnboardingRequest. - - :return: The password of this OnboardingRequest. - :rtype: str - """ # noqa: E501 - return self._password - - @password.setter - def password(self, password): - """Set the password of this OnboardingRequest. - - :param password: The password of this OnboardingRequest. - :type: str - """ # noqa: E501 - self._password = password - - @property - def org(self): - """Get the org of this OnboardingRequest. - - :return: The org of this OnboardingRequest. - :rtype: str - """ # noqa: E501 - return self._org - - @org.setter - def org(self, org): - """Set the org of this OnboardingRequest. - - :param org: The org of this OnboardingRequest. - :type: str - """ # noqa: E501 - if org is None: - raise ValueError("Invalid value for `org`, must not be `None`") # noqa: E501 - self._org = org - - @property - def bucket(self): - """Get the bucket of this OnboardingRequest. - - :return: The bucket of this OnboardingRequest. - :rtype: str - """ # noqa: E501 - return self._bucket - - @bucket.setter - def bucket(self, bucket): - """Set the bucket of this OnboardingRequest. - - :param bucket: The bucket of this OnboardingRequest. - :type: str - """ # noqa: E501 - if bucket is None: - raise ValueError("Invalid value for `bucket`, must not be `None`") # noqa: E501 - self._bucket = bucket - - @property - def retention_period_seconds(self): - """Get the retention_period_seconds of this OnboardingRequest. - - :return: The retention_period_seconds of this OnboardingRequest. - :rtype: int - """ # noqa: E501 - return self._retention_period_seconds - - @retention_period_seconds.setter - def retention_period_seconds(self, retention_period_seconds): - """Set the retention_period_seconds of this OnboardingRequest. - - :param retention_period_seconds: The retention_period_seconds of this OnboardingRequest. - :type: int - """ # noqa: E501 - self._retention_period_seconds = retention_period_seconds - - @property - def retention_period_hrs(self): - """Get the retention_period_hrs of this OnboardingRequest. - - Retention period *in nanoseconds* for the new bucket. This key's name has been misleading since OSS 2.0 GA, please transition to use `retentionPeriodSeconds` - - :return: The retention_period_hrs of this OnboardingRequest. - :rtype: int - """ # noqa: E501 - return self._retention_period_hrs - - @retention_period_hrs.setter - def retention_period_hrs(self, retention_period_hrs): - """Set the retention_period_hrs of this OnboardingRequest. - - Retention period *in nanoseconds* for the new bucket. This key's name has been misleading since OSS 2.0 GA, please transition to use `retentionPeriodSeconds` - - :param retention_period_hrs: The retention_period_hrs of this OnboardingRequest. - :type: int - """ # noqa: E501 - self._retention_period_hrs = retention_period_hrs - - @property - def token(self): - """Get the token of this OnboardingRequest. - - Authentication token to set on the initial user. If not specified, the server will generate a token. - - :return: The token of this OnboardingRequest. - :rtype: str - """ # noqa: E501 - return self._token - - @token.setter - def token(self, token): - """Set the token of this OnboardingRequest. - - Authentication token to set on the initial user. If not specified, the server will generate a token. - - :param token: The token of this OnboardingRequest. - :type: str - """ # noqa: E501 - self._token = token - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, OnboardingRequest): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/onboarding_response.py b/frogpilot/third_party/influxdb_client/domain/onboarding_response.py deleted file mode 100644 index 62db52f5..00000000 --- a/frogpilot/third_party/influxdb_client/domain/onboarding_response.py +++ /dev/null @@ -1,176 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class OnboardingResponse(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'user': 'UserResponse', - 'org': 'Organization', - 'bucket': 'Bucket', - 'auth': 'Authorization' - } - - attribute_map = { - 'user': 'user', - 'org': 'org', - 'bucket': 'bucket', - 'auth': 'auth' - } - - def __init__(self, user=None, org=None, bucket=None, auth=None): # noqa: E501,D401,D403 - """OnboardingResponse - a model defined in OpenAPI.""" # noqa: E501 - self._user = None - self._org = None - self._bucket = None - self._auth = None - self.discriminator = None - - if user is not None: - self.user = user - if org is not None: - self.org = org - if bucket is not None: - self.bucket = bucket - if auth is not None: - self.auth = auth - - @property - def user(self): - """Get the user of this OnboardingResponse. - - :return: The user of this OnboardingResponse. - :rtype: UserResponse - """ # noqa: E501 - return self._user - - @user.setter - def user(self, user): - """Set the user of this OnboardingResponse. - - :param user: The user of this OnboardingResponse. - :type: UserResponse - """ # noqa: E501 - self._user = user - - @property - def org(self): - """Get the org of this OnboardingResponse. - - :return: The org of this OnboardingResponse. - :rtype: Organization - """ # noqa: E501 - return self._org - - @org.setter - def org(self, org): - """Set the org of this OnboardingResponse. - - :param org: The org of this OnboardingResponse. - :type: Organization - """ # noqa: E501 - self._org = org - - @property - def bucket(self): - """Get the bucket of this OnboardingResponse. - - :return: The bucket of this OnboardingResponse. - :rtype: Bucket - """ # noqa: E501 - return self._bucket - - @bucket.setter - def bucket(self, bucket): - """Set the bucket of this OnboardingResponse. - - :param bucket: The bucket of this OnboardingResponse. - :type: Bucket - """ # noqa: E501 - self._bucket = bucket - - @property - def auth(self): - """Get the auth of this OnboardingResponse. - - :return: The auth of this OnboardingResponse. - :rtype: Authorization - """ # noqa: E501 - return self._auth - - @auth.setter - def auth(self, auth): - """Set the auth of this OnboardingResponse. - - :param auth: The auth of this OnboardingResponse. - :type: Authorization - """ # noqa: E501 - self._auth = auth - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, OnboardingResponse): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/option_statement.py b/frogpilot/third_party/influxdb_client/domain/option_statement.py deleted file mode 100644 index 4ab15699..00000000 --- a/frogpilot/third_party/influxdb_client/domain/option_statement.py +++ /dev/null @@ -1,138 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.statement import Statement - - -class OptionStatement(Statement): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'assignment': 'object' - } - - attribute_map = { - 'type': 'type', - 'assignment': 'assignment' - } - - def __init__(self, type=None, assignment=None): # noqa: E501,D401,D403 - """OptionStatement - a model defined in OpenAPI.""" # noqa: E501 - Statement.__init__(self) # noqa: E501 - - self._type = None - self._assignment = None - self.discriminator = None - - if type is not None: - self.type = type - if assignment is not None: - self.assignment = assignment - - @property - def type(self): - """Get the type of this OptionStatement. - - Type of AST node - - :return: The type of this OptionStatement. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this OptionStatement. - - Type of AST node - - :param type: The type of this OptionStatement. - :type: str - """ # noqa: E501 - self._type = type - - @property - def assignment(self): - """Get the assignment of this OptionStatement. - - :return: The assignment of this OptionStatement. - :rtype: object - """ # noqa: E501 - return self._assignment - - @assignment.setter - def assignment(self, assignment): - """Set the assignment of this OptionStatement. - - :param assignment: The assignment of this OptionStatement. - :type: object - """ # noqa: E501 - self._assignment = assignment - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, OptionStatement): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/organization.py b/frogpilot/third_party/influxdb_client/domain/organization.py deleted file mode 100644 index 4071964c..00000000 --- a/frogpilot/third_party/influxdb_client/domain/organization.py +++ /dev/null @@ -1,277 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class Organization(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'links': 'OrganizationLinks', - 'id': 'str', - 'name': 'str', - 'default_storage_type': 'str', - 'description': 'str', - 'created_at': 'datetime', - 'updated_at': 'datetime', - 'status': 'str' - } - - attribute_map = { - 'links': 'links', - 'id': 'id', - 'name': 'name', - 'default_storage_type': 'defaultStorageType', - 'description': 'description', - 'created_at': 'createdAt', - 'updated_at': 'updatedAt', - 'status': 'status' - } - - def __init__(self, links=None, id=None, name=None, default_storage_type=None, description=None, created_at=None, updated_at=None, status='active'): # noqa: E501,D401,D403 - """Organization - a model defined in OpenAPI.""" # noqa: E501 - self._links = None - self._id = None - self._name = None - self._default_storage_type = None - self._description = None - self._created_at = None - self._updated_at = None - self._status = None - self.discriminator = None - - if links is not None: - self.links = links - if id is not None: - self.id = id - self.name = name - if default_storage_type is not None: - self.default_storage_type = default_storage_type - if description is not None: - self.description = description - if created_at is not None: - self.created_at = created_at - if updated_at is not None: - self.updated_at = updated_at - if status is not None: - self.status = status - - @property - def links(self): - """Get the links of this Organization. - - :return: The links of this Organization. - :rtype: OrganizationLinks - """ # noqa: E501 - return self._links - - @links.setter - def links(self, links): - """Set the links of this Organization. - - :param links: The links of this Organization. - :type: OrganizationLinks - """ # noqa: E501 - self._links = links - - @property - def id(self): - """Get the id of this Organization. - - :return: The id of this Organization. - :rtype: str - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this Organization. - - :param id: The id of this Organization. - :type: str - """ # noqa: E501 - self._id = id - - @property - def name(self): - """Get the name of this Organization. - - :return: The name of this Organization. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this Organization. - - :param name: The name of this Organization. - :type: str - """ # noqa: E501 - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - self._name = name - - @property - def default_storage_type(self): - """Get the default_storage_type of this Organization. - - Discloses whether the organization uses TSM or IOx. - - :return: The default_storage_type of this Organization. - :rtype: str - """ # noqa: E501 - return self._default_storage_type - - @default_storage_type.setter - def default_storage_type(self, default_storage_type): - """Set the default_storage_type of this Organization. - - Discloses whether the organization uses TSM or IOx. - - :param default_storage_type: The default_storage_type of this Organization. - :type: str - """ # noqa: E501 - self._default_storage_type = default_storage_type - - @property - def description(self): - """Get the description of this Organization. - - :return: The description of this Organization. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this Organization. - - :param description: The description of this Organization. - :type: str - """ # noqa: E501 - self._description = description - - @property - def created_at(self): - """Get the created_at of this Organization. - - :return: The created_at of this Organization. - :rtype: datetime - """ # noqa: E501 - return self._created_at - - @created_at.setter - def created_at(self, created_at): - """Set the created_at of this Organization. - - :param created_at: The created_at of this Organization. - :type: datetime - """ # noqa: E501 - self._created_at = created_at - - @property - def updated_at(self): - """Get the updated_at of this Organization. - - :return: The updated_at of this Organization. - :rtype: datetime - """ # noqa: E501 - return self._updated_at - - @updated_at.setter - def updated_at(self, updated_at): - """Set the updated_at of this Organization. - - :param updated_at: The updated_at of this Organization. - :type: datetime - """ # noqa: E501 - self._updated_at = updated_at - - @property - def status(self): - """Get the status of this Organization. - - If inactive, the organization is inactive. - - :return: The status of this Organization. - :rtype: str - """ # noqa: E501 - return self._status - - @status.setter - def status(self, status): - """Set the status of this Organization. - - If inactive, the organization is inactive. - - :param status: The status of this Organization. - :type: str - """ # noqa: E501 - self._status = status - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Organization): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/organization_links.py b/frogpilot/third_party/influxdb_client/domain/organization_links.py deleted file mode 100644 index a2cca042..00000000 --- a/frogpilot/third_party/influxdb_client/domain/organization_links.py +++ /dev/null @@ -1,300 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class OrganizationLinks(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - '_self': 'str', - 'members': 'str', - 'owners': 'str', - 'labels': 'str', - 'secrets': 'str', - 'buckets': 'str', - 'tasks': 'str', - 'dashboards': 'str' - } - - attribute_map = { - '_self': 'self', - 'members': 'members', - 'owners': 'owners', - 'labels': 'labels', - 'secrets': 'secrets', - 'buckets': 'buckets', - 'tasks': 'tasks', - 'dashboards': 'dashboards' - } - - def __init__(self, _self=None, members=None, owners=None, labels=None, secrets=None, buckets=None, tasks=None, dashboards=None): # noqa: E501,D401,D403 - """OrganizationLinks - a model defined in OpenAPI.""" # noqa: E501 - self.__self = None - self._members = None - self._owners = None - self._labels = None - self._secrets = None - self._buckets = None - self._tasks = None - self._dashboards = None - self.discriminator = None - - if _self is not None: - self._self = _self - if members is not None: - self.members = members - if owners is not None: - self.owners = owners - if labels is not None: - self.labels = labels - if secrets is not None: - self.secrets = secrets - if buckets is not None: - self.buckets = buckets - if tasks is not None: - self.tasks = tasks - if dashboards is not None: - self.dashboards = dashboards - - @property - def _self(self): - """Get the _self of this OrganizationLinks. - - URI of resource. - - :return: The _self of this OrganizationLinks. - :rtype: str - """ # noqa: E501 - return self.__self - - @_self.setter - def _self(self, _self): - """Set the _self of this OrganizationLinks. - - URI of resource. - - :param _self: The _self of this OrganizationLinks. - :type: str - """ # noqa: E501 - self.__self = _self - - @property - def members(self): - """Get the members of this OrganizationLinks. - - URI of resource. - - :return: The members of this OrganizationLinks. - :rtype: str - """ # noqa: E501 - return self._members - - @members.setter - def members(self, members): - """Set the members of this OrganizationLinks. - - URI of resource. - - :param members: The members of this OrganizationLinks. - :type: str - """ # noqa: E501 - self._members = members - - @property - def owners(self): - """Get the owners of this OrganizationLinks. - - URI of resource. - - :return: The owners of this OrganizationLinks. - :rtype: str - """ # noqa: E501 - return self._owners - - @owners.setter - def owners(self, owners): - """Set the owners of this OrganizationLinks. - - URI of resource. - - :param owners: The owners of this OrganizationLinks. - :type: str - """ # noqa: E501 - self._owners = owners - - @property - def labels(self): - """Get the labels of this OrganizationLinks. - - URI of resource. - - :return: The labels of this OrganizationLinks. - :rtype: str - """ # noqa: E501 - return self._labels - - @labels.setter - def labels(self, labels): - """Set the labels of this OrganizationLinks. - - URI of resource. - - :param labels: The labels of this OrganizationLinks. - :type: str - """ # noqa: E501 - self._labels = labels - - @property - def secrets(self): - """Get the secrets of this OrganizationLinks. - - URI of resource. - - :return: The secrets of this OrganizationLinks. - :rtype: str - """ # noqa: E501 - return self._secrets - - @secrets.setter - def secrets(self, secrets): - """Set the secrets of this OrganizationLinks. - - URI of resource. - - :param secrets: The secrets of this OrganizationLinks. - :type: str - """ # noqa: E501 - self._secrets = secrets - - @property - def buckets(self): - """Get the buckets of this OrganizationLinks. - - URI of resource. - - :return: The buckets of this OrganizationLinks. - :rtype: str - """ # noqa: E501 - return self._buckets - - @buckets.setter - def buckets(self, buckets): - """Set the buckets of this OrganizationLinks. - - URI of resource. - - :param buckets: The buckets of this OrganizationLinks. - :type: str - """ # noqa: E501 - self._buckets = buckets - - @property - def tasks(self): - """Get the tasks of this OrganizationLinks. - - URI of resource. - - :return: The tasks of this OrganizationLinks. - :rtype: str - """ # noqa: E501 - return self._tasks - - @tasks.setter - def tasks(self, tasks): - """Set the tasks of this OrganizationLinks. - - URI of resource. - - :param tasks: The tasks of this OrganizationLinks. - :type: str - """ # noqa: E501 - self._tasks = tasks - - @property - def dashboards(self): - """Get the dashboards of this OrganizationLinks. - - URI of resource. - - :return: The dashboards of this OrganizationLinks. - :rtype: str - """ # noqa: E501 - return self._dashboards - - @dashboards.setter - def dashboards(self, dashboards): - """Set the dashboards of this OrganizationLinks. - - URI of resource. - - :param dashboards: The dashboards of this OrganizationLinks. - :type: str - """ # noqa: E501 - self._dashboards = dashboards - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, OrganizationLinks): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/organizations.py b/frogpilot/third_party/influxdb_client/domain/organizations.py deleted file mode 100644 index 844c7faa..00000000 --- a/frogpilot/third_party/influxdb_client/domain/organizations.py +++ /dev/null @@ -1,130 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class Organizations(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'links': 'Links', - 'orgs': 'list[Organization]' - } - - attribute_map = { - 'links': 'links', - 'orgs': 'orgs' - } - - def __init__(self, links=None, orgs=None): # noqa: E501,D401,D403 - """Organizations - a model defined in OpenAPI.""" # noqa: E501 - self._links = None - self._orgs = None - self.discriminator = None - - if links is not None: - self.links = links - if orgs is not None: - self.orgs = orgs - - @property - def links(self): - """Get the links of this Organizations. - - :return: The links of this Organizations. - :rtype: Links - """ # noqa: E501 - return self._links - - @links.setter - def links(self, links): - """Set the links of this Organizations. - - :param links: The links of this Organizations. - :type: Links - """ # noqa: E501 - self._links = links - - @property - def orgs(self): - """Get the orgs of this Organizations. - - :return: The orgs of this Organizations. - :rtype: list[Organization] - """ # noqa: E501 - return self._orgs - - @orgs.setter - def orgs(self, orgs): - """Set the orgs of this Organizations. - - :param orgs: The orgs of this Organizations. - :type: list[Organization] - """ # noqa: E501 - self._orgs = orgs - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Organizations): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/package.py b/frogpilot/third_party/influxdb_client/domain/package.py deleted file mode 100644 index 9c328e6f..00000000 --- a/frogpilot/third_party/influxdb_client/domain/package.py +++ /dev/null @@ -1,192 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class Package(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'path': 'str', - 'package': 'str', - 'files': 'list[File]' - } - - attribute_map = { - 'type': 'type', - 'path': 'path', - 'package': 'package', - 'files': 'files' - } - - def __init__(self, type=None, path=None, package=None, files=None): # noqa: E501,D401,D403 - """Package - a model defined in OpenAPI.""" # noqa: E501 - self._type = None - self._path = None - self._package = None - self._files = None - self.discriminator = None - - if type is not None: - self.type = type - if path is not None: - self.path = path - if package is not None: - self.package = package - if files is not None: - self.files = files - - @property - def type(self): - """Get the type of this Package. - - Type of AST node - - :return: The type of this Package. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this Package. - - Type of AST node - - :param type: The type of this Package. - :type: str - """ # noqa: E501 - self._type = type - - @property - def path(self): - """Get the path of this Package. - - Package import path - - :return: The path of this Package. - :rtype: str - """ # noqa: E501 - return self._path - - @path.setter - def path(self, path): - """Set the path of this Package. - - Package import path - - :param path: The path of this Package. - :type: str - """ # noqa: E501 - self._path = path - - @property - def package(self): - """Get the package of this Package. - - Package name - - :return: The package of this Package. - :rtype: str - """ # noqa: E501 - return self._package - - @package.setter - def package(self, package): - """Set the package of this Package. - - Package name - - :param package: The package of this Package. - :type: str - """ # noqa: E501 - self._package = package - - @property - def files(self): - """Get the files of this Package. - - Package files - - :return: The files of this Package. - :rtype: list[File] - """ # noqa: E501 - return self._files - - @files.setter - def files(self, files): - """Set the files of this Package. - - Package files - - :param files: The files of this Package. - :type: list[File] - """ # noqa: E501 - self._files = files - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Package): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/package_clause.py b/frogpilot/third_party/influxdb_client/domain/package_clause.py deleted file mode 100644 index b9cb6abc..00000000 --- a/frogpilot/third_party/influxdb_client/domain/package_clause.py +++ /dev/null @@ -1,134 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class PackageClause(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'name': 'Identifier' - } - - attribute_map = { - 'type': 'type', - 'name': 'name' - } - - def __init__(self, type=None, name=None): # noqa: E501,D401,D403 - """PackageClause - a model defined in OpenAPI.""" # noqa: E501 - self._type = None - self._name = None - self.discriminator = None - - if type is not None: - self.type = type - if name is not None: - self.name = name - - @property - def type(self): - """Get the type of this PackageClause. - - Type of AST node - - :return: The type of this PackageClause. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this PackageClause. - - Type of AST node - - :param type: The type of this PackageClause. - :type: str - """ # noqa: E501 - self._type = type - - @property - def name(self): - """Get the name of this PackageClause. - - :return: The name of this PackageClause. - :rtype: Identifier - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this PackageClause. - - :param name: The name of this PackageClause. - :type: Identifier - """ # noqa: E501 - self._name = name - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, PackageClause): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/pager_duty_notification_endpoint.py b/frogpilot/third_party/influxdb_client/domain/pager_duty_notification_endpoint.py deleted file mode 100644 index f57b6c00..00000000 --- a/frogpilot/third_party/influxdb_client/domain/pager_duty_notification_endpoint.py +++ /dev/null @@ -1,157 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.notification_endpoint_discriminator import NotificationEndpointDiscriminator - - -class PagerDutyNotificationEndpoint(NotificationEndpointDiscriminator): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'client_url': 'str', - 'routing_key': 'str', - 'id': 'str', - 'org_id': 'str', - 'user_id': 'str', - 'created_at': 'datetime', - 'updated_at': 'datetime', - 'description': 'str', - 'name': 'str', - 'status': 'str', - 'labels': 'list[Label]', - 'links': 'NotificationEndpointBaseLinks', - 'type': 'NotificationEndpointType' - } - - attribute_map = { - 'client_url': 'clientURL', - 'routing_key': 'routingKey', - 'id': 'id', - 'org_id': 'orgID', - 'user_id': 'userID', - 'created_at': 'createdAt', - 'updated_at': 'updatedAt', - 'description': 'description', - 'name': 'name', - 'status': 'status', - 'labels': 'labels', - 'links': 'links', - 'type': 'type' - } - - def __init__(self, client_url=None, routing_key=None, id=None, org_id=None, user_id=None, created_at=None, updated_at=None, description=None, name=None, status='active', labels=None, links=None, type="pagerduty"): # noqa: E501,D401,D403 - """PagerDutyNotificationEndpoint - a model defined in OpenAPI.""" # noqa: E501 - NotificationEndpointDiscriminator.__init__(self, id=id, org_id=org_id, user_id=user_id, created_at=created_at, updated_at=updated_at, description=description, name=name, status=status, labels=labels, links=links, type=type) # noqa: E501 - - self._client_url = None - self._routing_key = None - self.discriminator = None - - if client_url is not None: - self.client_url = client_url - self.routing_key = routing_key - - @property - def client_url(self): - """Get the client_url of this PagerDutyNotificationEndpoint. - - :return: The client_url of this PagerDutyNotificationEndpoint. - :rtype: str - """ # noqa: E501 - return self._client_url - - @client_url.setter - def client_url(self, client_url): - """Set the client_url of this PagerDutyNotificationEndpoint. - - :param client_url: The client_url of this PagerDutyNotificationEndpoint. - :type: str - """ # noqa: E501 - self._client_url = client_url - - @property - def routing_key(self): - """Get the routing_key of this PagerDutyNotificationEndpoint. - - :return: The routing_key of this PagerDutyNotificationEndpoint. - :rtype: str - """ # noqa: E501 - return self._routing_key - - @routing_key.setter - def routing_key(self, routing_key): - """Set the routing_key of this PagerDutyNotificationEndpoint. - - :param routing_key: The routing_key of this PagerDutyNotificationEndpoint. - :type: str - """ # noqa: E501 - if routing_key is None: - raise ValueError("Invalid value for `routing_key`, must not be `None`") # noqa: E501 - self._routing_key = routing_key - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, PagerDutyNotificationEndpoint): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/pager_duty_notification_rule.py b/frogpilot/third_party/influxdb_client/domain/pager_duty_notification_rule.py deleted file mode 100644 index 8ccf2bd2..00000000 --- a/frogpilot/third_party/influxdb_client/domain/pager_duty_notification_rule.py +++ /dev/null @@ -1,136 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.pager_duty_notification_rule_base import PagerDutyNotificationRuleBase - - -class PagerDutyNotificationRule(PagerDutyNotificationRuleBase): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'message_template': 'str', - 'latest_completed': 'datetime', - 'last_run_status': 'str', - 'last_run_error': 'str', - 'id': 'str', - 'endpoint_id': 'str', - 'org_id': 'str', - 'task_id': 'str', - 'owner_id': 'str', - 'created_at': 'datetime', - 'updated_at': 'datetime', - 'status': 'TaskStatusType', - 'name': 'str', - 'sleep_until': 'str', - 'every': 'str', - 'offset': 'str', - 'runbook_link': 'str', - 'limit_every': 'int', - 'limit': 'int', - 'tag_rules': 'list[TagRule]', - 'description': 'str', - 'status_rules': 'list[StatusRule]', - 'labels': 'list[Label]', - 'links': 'NotificationRuleBaseLinks' - } - - attribute_map = { - 'type': 'type', - 'message_template': 'messageTemplate', - 'latest_completed': 'latestCompleted', - 'last_run_status': 'lastRunStatus', - 'last_run_error': 'lastRunError', - 'id': 'id', - 'endpoint_id': 'endpointID', - 'org_id': 'orgID', - 'task_id': 'taskID', - 'owner_id': 'ownerID', - 'created_at': 'createdAt', - 'updated_at': 'updatedAt', - 'status': 'status', - 'name': 'name', - 'sleep_until': 'sleepUntil', - 'every': 'every', - 'offset': 'offset', - 'runbook_link': 'runbookLink', - 'limit_every': 'limitEvery', - 'limit': 'limit', - 'tag_rules': 'tagRules', - 'description': 'description', - 'status_rules': 'statusRules', - 'labels': 'labels', - 'links': 'links' - } - - def __init__(self, type="pagerduty", message_template=None, latest_completed=None, last_run_status=None, last_run_error=None, id=None, endpoint_id=None, org_id=None, task_id=None, owner_id=None, created_at=None, updated_at=None, status=None, name=None, sleep_until=None, every=None, offset=None, runbook_link=None, limit_every=None, limit=None, tag_rules=None, description=None, status_rules=None, labels=None, links=None): # noqa: E501,D401,D403 - """PagerDutyNotificationRule - a model defined in OpenAPI.""" # noqa: E501 - PagerDutyNotificationRuleBase.__init__(self, type=type, message_template=message_template, latest_completed=latest_completed, last_run_status=last_run_status, last_run_error=last_run_error, id=id, endpoint_id=endpoint_id, org_id=org_id, task_id=task_id, owner_id=owner_id, created_at=created_at, updated_at=updated_at, status=status, name=name, sleep_until=sleep_until, every=every, offset=offset, runbook_link=runbook_link, limit_every=limit_every, limit=limit, tag_rules=tag_rules, description=description, status_rules=status_rules, labels=labels, links=links) # noqa: E501 - self.discriminator = None - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, PagerDutyNotificationRule): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/pager_duty_notification_rule_base.py b/frogpilot/third_party/influxdb_client/domain/pager_duty_notification_rule_base.py deleted file mode 100644 index 8e447743..00000000 --- a/frogpilot/third_party/influxdb_client/domain/pager_duty_notification_rule_base.py +++ /dev/null @@ -1,182 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.notification_rule_discriminator import NotificationRuleDiscriminator - - -class PagerDutyNotificationRuleBase(NotificationRuleDiscriminator): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'message_template': 'str', - 'latest_completed': 'datetime', - 'last_run_status': 'str', - 'last_run_error': 'str', - 'id': 'str', - 'endpoint_id': 'str', - 'org_id': 'str', - 'task_id': 'str', - 'owner_id': 'str', - 'created_at': 'datetime', - 'updated_at': 'datetime', - 'status': 'TaskStatusType', - 'name': 'str', - 'sleep_until': 'str', - 'every': 'str', - 'offset': 'str', - 'runbook_link': 'str', - 'limit_every': 'int', - 'limit': 'int', - 'tag_rules': 'list[TagRule]', - 'description': 'str', - 'status_rules': 'list[StatusRule]', - 'labels': 'list[Label]', - 'links': 'NotificationRuleBaseLinks' - } - - attribute_map = { - 'type': 'type', - 'message_template': 'messageTemplate', - 'latest_completed': 'latestCompleted', - 'last_run_status': 'lastRunStatus', - 'last_run_error': 'lastRunError', - 'id': 'id', - 'endpoint_id': 'endpointID', - 'org_id': 'orgID', - 'task_id': 'taskID', - 'owner_id': 'ownerID', - 'created_at': 'createdAt', - 'updated_at': 'updatedAt', - 'status': 'status', - 'name': 'name', - 'sleep_until': 'sleepUntil', - 'every': 'every', - 'offset': 'offset', - 'runbook_link': 'runbookLink', - 'limit_every': 'limitEvery', - 'limit': 'limit', - 'tag_rules': 'tagRules', - 'description': 'description', - 'status_rules': 'statusRules', - 'labels': 'labels', - 'links': 'links' - } - - def __init__(self, type=None, message_template=None, latest_completed=None, last_run_status=None, last_run_error=None, id=None, endpoint_id=None, org_id=None, task_id=None, owner_id=None, created_at=None, updated_at=None, status=None, name=None, sleep_until=None, every=None, offset=None, runbook_link=None, limit_every=None, limit=None, tag_rules=None, description=None, status_rules=None, labels=None, links=None): # noqa: E501,D401,D403 - """PagerDutyNotificationRuleBase - a model defined in OpenAPI.""" # noqa: E501 - NotificationRuleDiscriminator.__init__(self, latest_completed=latest_completed, last_run_status=last_run_status, last_run_error=last_run_error, id=id, endpoint_id=endpoint_id, org_id=org_id, task_id=task_id, owner_id=owner_id, created_at=created_at, updated_at=updated_at, status=status, name=name, sleep_until=sleep_until, every=every, offset=offset, runbook_link=runbook_link, limit_every=limit_every, limit=limit, tag_rules=tag_rules, description=description, status_rules=status_rules, labels=labels, links=links) # noqa: E501 - - self._type = None - self._message_template = None - self.discriminator = None - - self.type = type - self.message_template = message_template - - @property - def type(self): - """Get the type of this PagerDutyNotificationRuleBase. - - :return: The type of this PagerDutyNotificationRuleBase. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this PagerDutyNotificationRuleBase. - - :param type: The type of this PagerDutyNotificationRuleBase. - :type: str - """ # noqa: E501 - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - self._type = type - - @property - def message_template(self): - """Get the message_template of this PagerDutyNotificationRuleBase. - - :return: The message_template of this PagerDutyNotificationRuleBase. - :rtype: str - """ # noqa: E501 - return self._message_template - - @message_template.setter - def message_template(self, message_template): - """Set the message_template of this PagerDutyNotificationRuleBase. - - :param message_template: The message_template of this PagerDutyNotificationRuleBase. - :type: str - """ # noqa: E501 - if message_template is None: - raise ValueError("Invalid value for `message_template`, must not be `None`") # noqa: E501 - self._message_template = message_template - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, PagerDutyNotificationRuleBase): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/paren_expression.py b/frogpilot/third_party/influxdb_client/domain/paren_expression.py deleted file mode 100644 index 68bcfe03..00000000 --- a/frogpilot/third_party/influxdb_client/domain/paren_expression.py +++ /dev/null @@ -1,138 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.expression import Expression - - -class ParenExpression(Expression): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'expression': 'Expression' - } - - attribute_map = { - 'type': 'type', - 'expression': 'expression' - } - - def __init__(self, type=None, expression=None): # noqa: E501,D401,D403 - """ParenExpression - a model defined in OpenAPI.""" # noqa: E501 - Expression.__init__(self) # noqa: E501 - - self._type = None - self._expression = None - self.discriminator = None - - if type is not None: - self.type = type - if expression is not None: - self.expression = expression - - @property - def type(self): - """Get the type of this ParenExpression. - - Type of AST node - - :return: The type of this ParenExpression. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this ParenExpression. - - Type of AST node - - :param type: The type of this ParenExpression. - :type: str - """ # noqa: E501 - self._type = type - - @property - def expression(self): - """Get the expression of this ParenExpression. - - :return: The expression of this ParenExpression. - :rtype: Expression - """ # noqa: E501 - return self._expression - - @expression.setter - def expression(self, expression): - """Set the expression of this ParenExpression. - - :param expression: The expression of this ParenExpression. - :type: Expression - """ # noqa: E501 - self._expression = expression - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, ParenExpression): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/password_reset_body.py b/frogpilot/third_party/influxdb_client/domain/password_reset_body.py deleted file mode 100644 index 22dc5c97..00000000 --- a/frogpilot/third_party/influxdb_client/domain/password_reset_body.py +++ /dev/null @@ -1,108 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class PasswordResetBody(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'password': 'str' - } - - attribute_map = { - 'password': 'password' - } - - def __init__(self, password=None): # noqa: E501,D401,D403 - """PasswordResetBody - a model defined in OpenAPI.""" # noqa: E501 - self._password = None - self.discriminator = None - - self.password = password - - @property - def password(self): - """Get the password of this PasswordResetBody. - - :return: The password of this PasswordResetBody. - :rtype: str - """ # noqa: E501 - return self._password - - @password.setter - def password(self, password): - """Set the password of this PasswordResetBody. - - :param password: The password of this PasswordResetBody. - :type: str - """ # noqa: E501 - if password is None: - raise ValueError("Invalid value for `password`, must not be `None`") # noqa: E501 - self._password = password - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, PasswordResetBody): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/patch_bucket_request.py b/frogpilot/third_party/influxdb_client/domain/patch_bucket_request.py deleted file mode 100644 index d2416a54..00000000 --- a/frogpilot/third_party/influxdb_client/domain/patch_bucket_request.py +++ /dev/null @@ -1,165 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class PatchBucketRequest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str', - 'description': 'str', - 'retention_rules': 'list[PatchRetentionRule]' - } - - attribute_map = { - 'name': 'name', - 'description': 'description', - 'retention_rules': 'retentionRules' - } - - def __init__(self, name=None, description=None, retention_rules=None): # noqa: E501,D401,D403 - """PatchBucketRequest - a model defined in OpenAPI.""" # noqa: E501 - self._name = None - self._description = None - self._retention_rules = None - self.discriminator = None - - if name is not None: - self.name = name - if description is not None: - self.description = description - if retention_rules is not None: - self.retention_rules = retention_rules - - @property - def name(self): - """Get the name of this PatchBucketRequest. - - The name of the bucket. - - :return: The name of this PatchBucketRequest. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this PatchBucketRequest. - - The name of the bucket. - - :param name: The name of this PatchBucketRequest. - :type: str - """ # noqa: E501 - self._name = name - - @property - def description(self): - """Get the description of this PatchBucketRequest. - - A description of the bucket. - - :return: The description of this PatchBucketRequest. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this PatchBucketRequest. - - A description of the bucket. - - :param description: The description of this PatchBucketRequest. - :type: str - """ # noqa: E501 - self._description = description - - @property - def retention_rules(self): - """Get the retention_rules of this PatchBucketRequest. - - Updates to rules to expire or retain data. No rules means no updates. - - :return: The retention_rules of this PatchBucketRequest. - :rtype: list[PatchRetentionRule] - """ # noqa: E501 - return self._retention_rules - - @retention_rules.setter - def retention_rules(self, retention_rules): - """Set the retention_rules of this PatchBucketRequest. - - Updates to rules to expire or retain data. No rules means no updates. - - :param retention_rules: The retention_rules of this PatchBucketRequest. - :type: list[PatchRetentionRule] - """ # noqa: E501 - self._retention_rules = retention_rules - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, PatchBucketRequest): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/patch_dashboard_request.py b/frogpilot/third_party/influxdb_client/domain/patch_dashboard_request.py deleted file mode 100644 index 8405c3b0..00000000 --- a/frogpilot/third_party/influxdb_client/domain/patch_dashboard_request.py +++ /dev/null @@ -1,161 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class PatchDashboardRequest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str', - 'description': 'str', - 'cells': 'CellWithViewProperties' - } - - attribute_map = { - 'name': 'name', - 'description': 'description', - 'cells': 'cells' - } - - def __init__(self, name=None, description=None, cells=None): # noqa: E501,D401,D403 - """PatchDashboardRequest - a model defined in OpenAPI.""" # noqa: E501 - self._name = None - self._description = None - self._cells = None - self.discriminator = None - - if name is not None: - self.name = name - if description is not None: - self.description = description - if cells is not None: - self.cells = cells - - @property - def name(self): - """Get the name of this PatchDashboardRequest. - - optional, when provided will replace the name - - :return: The name of this PatchDashboardRequest. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this PatchDashboardRequest. - - optional, when provided will replace the name - - :param name: The name of this PatchDashboardRequest. - :type: str - """ # noqa: E501 - self._name = name - - @property - def description(self): - """Get the description of this PatchDashboardRequest. - - optional, when provided will replace the description - - :return: The description of this PatchDashboardRequest. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this PatchDashboardRequest. - - optional, when provided will replace the description - - :param description: The description of this PatchDashboardRequest. - :type: str - """ # noqa: E501 - self._description = description - - @property - def cells(self): - """Get the cells of this PatchDashboardRequest. - - :return: The cells of this PatchDashboardRequest. - :rtype: CellWithViewProperties - """ # noqa: E501 - return self._cells - - @cells.setter - def cells(self, cells): - """Set the cells of this PatchDashboardRequest. - - :param cells: The cells of this PatchDashboardRequest. - :type: CellWithViewProperties - """ # noqa: E501 - self._cells = cells - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, PatchDashboardRequest): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/patch_organization_request.py b/frogpilot/third_party/influxdb_client/domain/patch_organization_request.py deleted file mode 100644 index ff74e17b..00000000 --- a/frogpilot/third_party/influxdb_client/domain/patch_organization_request.py +++ /dev/null @@ -1,138 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class PatchOrganizationRequest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str', - 'description': 'str' - } - - attribute_map = { - 'name': 'name', - 'description': 'description' - } - - def __init__(self, name=None, description=None): # noqa: E501,D401,D403 - """PatchOrganizationRequest - a model defined in OpenAPI.""" # noqa: E501 - self._name = None - self._description = None - self.discriminator = None - - if name is not None: - self.name = name - if description is not None: - self.description = description - - @property - def name(self): - """Get the name of this PatchOrganizationRequest. - - The name of the organization. - - :return: The name of this PatchOrganizationRequest. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this PatchOrganizationRequest. - - The name of the organization. - - :param name: The name of this PatchOrganizationRequest. - :type: str - """ # noqa: E501 - self._name = name - - @property - def description(self): - """Get the description of this PatchOrganizationRequest. - - The description of the organization. - - :return: The description of this PatchOrganizationRequest. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this PatchOrganizationRequest. - - The description of the organization. - - :param description: The description of this PatchOrganizationRequest. - :type: str - """ # noqa: E501 - self._description = description - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, PatchOrganizationRequest): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/patch_retention_rule.py b/frogpilot/third_party/influxdb_client/domain/patch_retention_rule.py deleted file mode 100644 index d02335a1..00000000 --- a/frogpilot/third_party/influxdb_client/domain/patch_retention_rule.py +++ /dev/null @@ -1,164 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class PatchRetentionRule(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'every_seconds': 'int', - 'shard_group_duration_seconds': 'int' - } - - attribute_map = { - 'type': 'type', - 'every_seconds': 'everySeconds', - 'shard_group_duration_seconds': 'shardGroupDurationSeconds' - } - - def __init__(self, type='expire', every_seconds=2592000, shard_group_duration_seconds=None): # noqa: E501,D401,D403 - """PatchRetentionRule - a model defined in OpenAPI.""" # noqa: E501 - self._type = None - self._every_seconds = None - self._shard_group_duration_seconds = None - self.discriminator = None - - if type is not None: - self.type = type - self.every_seconds = every_seconds - if shard_group_duration_seconds is not None: - self.shard_group_duration_seconds = shard_group_duration_seconds - - @property - def type(self): - """Get the type of this PatchRetentionRule. - - :return: The type of this PatchRetentionRule. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this PatchRetentionRule. - - :param type: The type of this PatchRetentionRule. - :type: str - """ # noqa: E501 - self._type = type - - @property - def every_seconds(self): - """Get the every_seconds of this PatchRetentionRule. - - The number of seconds to keep data. Default duration is `2592000` (30 days). `0` represents infinite retention. - - :return: The every_seconds of this PatchRetentionRule. - :rtype: int - """ # noqa: E501 - return self._every_seconds - - @every_seconds.setter - def every_seconds(self, every_seconds): - """Set the every_seconds of this PatchRetentionRule. - - The number of seconds to keep data. Default duration is `2592000` (30 days). `0` represents infinite retention. - - :param every_seconds: The every_seconds of this PatchRetentionRule. - :type: int - """ # noqa: E501 - if every_seconds is None: - raise ValueError("Invalid value for `every_seconds`, must not be `None`") # noqa: E501 - if every_seconds is not None and every_seconds < 0: # noqa: E501 - raise ValueError("Invalid value for `every_seconds`, must be a value greater than or equal to `0`") # noqa: E501 - self._every_seconds = every_seconds - - @property - def shard_group_duration_seconds(self): - """Get the shard_group_duration_seconds of this PatchRetentionRule. - - The [shard group duration](https://docs.influxdata.com/influxdb/latest/reference/glossary/#shard). The number of seconds that each shard group covers. #### InfluxDB Cloud - Doesn't use `shardGroupDurationsSeconds`. #### InfluxDB OSS - Default value depends on the [bucket retention period](https://docs.influxdata.com/influxdb/latest/reference/internals/shards/#shard-group-duration). #### Related guides - InfluxDB [shards and shard groups](https://docs.influxdata.com/influxdb/latest/reference/internals/shards/) - - :return: The shard_group_duration_seconds of this PatchRetentionRule. - :rtype: int - """ # noqa: E501 - return self._shard_group_duration_seconds - - @shard_group_duration_seconds.setter - def shard_group_duration_seconds(self, shard_group_duration_seconds): - """Set the shard_group_duration_seconds of this PatchRetentionRule. - - The [shard group duration](https://docs.influxdata.com/influxdb/latest/reference/glossary/#shard). The number of seconds that each shard group covers. #### InfluxDB Cloud - Doesn't use `shardGroupDurationsSeconds`. #### InfluxDB OSS - Default value depends on the [bucket retention period](https://docs.influxdata.com/influxdb/latest/reference/internals/shards/#shard-group-duration). #### Related guides - InfluxDB [shards and shard groups](https://docs.influxdata.com/influxdb/latest/reference/internals/shards/) - - :param shard_group_duration_seconds: The shard_group_duration_seconds of this PatchRetentionRule. - :type: int - """ # noqa: E501 - self._shard_group_duration_seconds = shard_group_duration_seconds - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, PatchRetentionRule): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/patch_stack_request.py b/frogpilot/third_party/influxdb_client/domain/patch_stack_request.py deleted file mode 100644 index 917cc315..00000000 --- a/frogpilot/third_party/influxdb_client/domain/patch_stack_request.py +++ /dev/null @@ -1,173 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class PatchStackRequest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str', - 'description': 'str', - 'template_ur_ls': 'list[str]', - 'additional_resources': 'list[PatchStackRequestAdditionalResources]' - } - - attribute_map = { - 'name': 'name', - 'description': 'description', - 'template_ur_ls': 'templateURLs', - 'additional_resources': 'additionalResources' - } - - def __init__(self, name=None, description=None, template_ur_ls=None, additional_resources=None): # noqa: E501,D401,D403 - """PatchStackRequest - a model defined in OpenAPI.""" # noqa: E501 - self._name = None - self._description = None - self._template_ur_ls = None - self._additional_resources = None - self.discriminator = None - - self.name = name - self.description = description - self.template_ur_ls = template_ur_ls - if additional_resources is not None: - self.additional_resources = additional_resources - - @property - def name(self): - """Get the name of this PatchStackRequest. - - :return: The name of this PatchStackRequest. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this PatchStackRequest. - - :param name: The name of this PatchStackRequest. - :type: str - """ # noqa: E501 - self._name = name - - @property - def description(self): - """Get the description of this PatchStackRequest. - - :return: The description of this PatchStackRequest. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this PatchStackRequest. - - :param description: The description of this PatchStackRequest. - :type: str - """ # noqa: E501 - self._description = description - - @property - def template_ur_ls(self): - """Get the template_ur_ls of this PatchStackRequest. - - :return: The template_ur_ls of this PatchStackRequest. - :rtype: list[str] - """ # noqa: E501 - return self._template_ur_ls - - @template_ur_ls.setter - def template_ur_ls(self, template_ur_ls): - """Set the template_ur_ls of this PatchStackRequest. - - :param template_ur_ls: The template_ur_ls of this PatchStackRequest. - :type: list[str] - """ # noqa: E501 - self._template_ur_ls = template_ur_ls - - @property - def additional_resources(self): - """Get the additional_resources of this PatchStackRequest. - - :return: The additional_resources of this PatchStackRequest. - :rtype: list[PatchStackRequestAdditionalResources] - """ # noqa: E501 - return self._additional_resources - - @additional_resources.setter - def additional_resources(self, additional_resources): - """Set the additional_resources of this PatchStackRequest. - - :param additional_resources: The additional_resources of this PatchStackRequest. - :type: list[PatchStackRequestAdditionalResources] - """ # noqa: E501 - self._additional_resources = additional_resources - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, PatchStackRequest): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/patch_stack_request_additional_resources.py b/frogpilot/third_party/influxdb_client/domain/patch_stack_request_additional_resources.py deleted file mode 100644 index 6df857bb..00000000 --- a/frogpilot/third_party/influxdb_client/domain/patch_stack_request_additional_resources.py +++ /dev/null @@ -1,155 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class PatchStackRequestAdditionalResources(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'resource_id': 'str', - 'kind': 'str', - 'template_meta_name': 'str' - } - - attribute_map = { - 'resource_id': 'resourceID', - 'kind': 'kind', - 'template_meta_name': 'templateMetaName' - } - - def __init__(self, resource_id=None, kind=None, template_meta_name=None): # noqa: E501,D401,D403 - """PatchStackRequestAdditionalResources - a model defined in OpenAPI.""" # noqa: E501 - self._resource_id = None - self._kind = None - self._template_meta_name = None - self.discriminator = None - - self.resource_id = resource_id - self.kind = kind - if template_meta_name is not None: - self.template_meta_name = template_meta_name - - @property - def resource_id(self): - """Get the resource_id of this PatchStackRequestAdditionalResources. - - :return: The resource_id of this PatchStackRequestAdditionalResources. - :rtype: str - """ # noqa: E501 - return self._resource_id - - @resource_id.setter - def resource_id(self, resource_id): - """Set the resource_id of this PatchStackRequestAdditionalResources. - - :param resource_id: The resource_id of this PatchStackRequestAdditionalResources. - :type: str - """ # noqa: E501 - if resource_id is None: - raise ValueError("Invalid value for `resource_id`, must not be `None`") # noqa: E501 - self._resource_id = resource_id - - @property - def kind(self): - """Get the kind of this PatchStackRequestAdditionalResources. - - :return: The kind of this PatchStackRequestAdditionalResources. - :rtype: str - """ # noqa: E501 - return self._kind - - @kind.setter - def kind(self, kind): - """Set the kind of this PatchStackRequestAdditionalResources. - - :param kind: The kind of this PatchStackRequestAdditionalResources. - :type: str - """ # noqa: E501 - if kind is None: - raise ValueError("Invalid value for `kind`, must not be `None`") # noqa: E501 - self._kind = kind - - @property - def template_meta_name(self): - """Get the template_meta_name of this PatchStackRequestAdditionalResources. - - :return: The template_meta_name of this PatchStackRequestAdditionalResources. - :rtype: str - """ # noqa: E501 - return self._template_meta_name - - @template_meta_name.setter - def template_meta_name(self, template_meta_name): - """Set the template_meta_name of this PatchStackRequestAdditionalResources. - - :param template_meta_name: The template_meta_name of this PatchStackRequestAdditionalResources. - :type: str - """ # noqa: E501 - self._template_meta_name = template_meta_name - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, PatchStackRequestAdditionalResources): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/permission.py b/frogpilot/third_party/influxdb_client/domain/permission.py deleted file mode 100644 index 4d25db70..00000000 --- a/frogpilot/third_party/influxdb_client/domain/permission.py +++ /dev/null @@ -1,132 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class Permission(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'action': 'str', - 'resource': 'PermissionResource' - } - - attribute_map = { - 'action': 'action', - 'resource': 'resource' - } - - def __init__(self, action=None, resource=None): # noqa: E501,D401,D403 - """Permission - a model defined in OpenAPI.""" # noqa: E501 - self._action = None - self._resource = None - self.discriminator = None - - self.action = action - self.resource = resource - - @property - def action(self): - """Get the action of this Permission. - - :return: The action of this Permission. - :rtype: str - """ # noqa: E501 - return self._action - - @action.setter - def action(self, action): - """Set the action of this Permission. - - :param action: The action of this Permission. - :type: str - """ # noqa: E501 - if action is None: - raise ValueError("Invalid value for `action`, must not be `None`") # noqa: E501 - self._action = action - - @property - def resource(self): - """Get the resource of this Permission. - - :return: The resource of this Permission. - :rtype: PermissionResource - """ # noqa: E501 - return self._resource - - @resource.setter - def resource(self, resource): - """Set the resource of this Permission. - - :param resource: The resource of this Permission. - :type: PermissionResource - """ # noqa: E501 - if resource is None: - raise ValueError("Invalid value for `resource`, must not be `None`") # noqa: E501 - self._resource = resource - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Permission): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/permission_resource.py b/frogpilot/third_party/influxdb_client/domain/permission_resource.py deleted file mode 100644 index 07634a03..00000000 --- a/frogpilot/third_party/influxdb_client/domain/permission_resource.py +++ /dev/null @@ -1,220 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class PermissionResource(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'id': 'str', - 'name': 'str', - 'org_id': 'str', - 'org': 'str' - } - - attribute_map = { - 'type': 'type', - 'id': 'id', - 'name': 'name', - 'org_id': 'orgID', - 'org': 'org' - } - - def __init__(self, type=None, id=None, name=None, org_id=None, org=None): # noqa: E501,D401,D403 - """PermissionResource - a model defined in OpenAPI.""" # noqa: E501 - self._type = None - self._id = None - self._name = None - self._org_id = None - self._org = None - self.discriminator = None - - self.type = type - if id is not None: - self.id = id - if name is not None: - self.name = name - if org_id is not None: - self.org_id = org_id - if org is not None: - self.org = org - - @property - def type(self): - """Get the type of this PermissionResource. - - A resource type. Identifies the API resource's type (or _kind_). - - :return: The type of this PermissionResource. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this PermissionResource. - - A resource type. Identifies the API resource's type (or _kind_). - - :param type: The type of this PermissionResource. - :type: str - """ # noqa: E501 - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - self._type = type - - @property - def id(self): - """Get the id of this PermissionResource. - - A resource ID. Identifies a specific resource. - - :return: The id of this PermissionResource. - :rtype: str - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this PermissionResource. - - A resource ID. Identifies a specific resource. - - :param id: The id of this PermissionResource. - :type: str - """ # noqa: E501 - self._id = id - - @property - def name(self): - """Get the name of this PermissionResource. - - The name of the resource. _Note: not all resource types have a `name` property_. - - :return: The name of this PermissionResource. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this PermissionResource. - - The name of the resource. _Note: not all resource types have a `name` property_. - - :param name: The name of this PermissionResource. - :type: str - """ # noqa: E501 - self._name = name - - @property - def org_id(self): - """Get the org_id of this PermissionResource. - - An organization ID. Identifies the organization that owns the resource. - - :return: The org_id of this PermissionResource. - :rtype: str - """ # noqa: E501 - return self._org_id - - @org_id.setter - def org_id(self, org_id): - """Set the org_id of this PermissionResource. - - An organization ID. Identifies the organization that owns the resource. - - :param org_id: The org_id of this PermissionResource. - :type: str - """ # noqa: E501 - self._org_id = org_id - - @property - def org(self): - """Get the org of this PermissionResource. - - An organization name. The organization that owns the resource. - - :return: The org of this PermissionResource. - :rtype: str - """ # noqa: E501 - return self._org - - @org.setter - def org(self, org): - """Set the org of this PermissionResource. - - An organization name. The organization that owns the resource. - - :param org: The org of this PermissionResource. - :type: str - """ # noqa: E501 - self._org = org - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, PermissionResource): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/pipe_expression.py b/frogpilot/third_party/influxdb_client/domain/pipe_expression.py deleted file mode 100644 index 3f984113..00000000 --- a/frogpilot/third_party/influxdb_client/domain/pipe_expression.py +++ /dev/null @@ -1,161 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.expression import Expression - - -class PipeExpression(Expression): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'argument': 'Expression', - 'call': 'CallExpression' - } - - attribute_map = { - 'type': 'type', - 'argument': 'argument', - 'call': 'call' - } - - def __init__(self, type=None, argument=None, call=None): # noqa: E501,D401,D403 - """PipeExpression - a model defined in OpenAPI.""" # noqa: E501 - Expression.__init__(self) # noqa: E501 - - self._type = None - self._argument = None - self._call = None - self.discriminator = None - - if type is not None: - self.type = type - if argument is not None: - self.argument = argument - if call is not None: - self.call = call - - @property - def type(self): - """Get the type of this PipeExpression. - - Type of AST node - - :return: The type of this PipeExpression. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this PipeExpression. - - Type of AST node - - :param type: The type of this PipeExpression. - :type: str - """ # noqa: E501 - self._type = type - - @property - def argument(self): - """Get the argument of this PipeExpression. - - :return: The argument of this PipeExpression. - :rtype: Expression - """ # noqa: E501 - return self._argument - - @argument.setter - def argument(self, argument): - """Set the argument of this PipeExpression. - - :param argument: The argument of this PipeExpression. - :type: Expression - """ # noqa: E501 - self._argument = argument - - @property - def call(self): - """Get the call of this PipeExpression. - - :return: The call of this PipeExpression. - :rtype: CallExpression - """ # noqa: E501 - return self._call - - @call.setter - def call(self, call): - """Set the call of this PipeExpression. - - :param call: The call of this PipeExpression. - :type: CallExpression - """ # noqa: E501 - self._call = call - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, PipeExpression): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/pipe_literal.py b/frogpilot/third_party/influxdb_client/domain/pipe_literal.py deleted file mode 100644 index eea02437..00000000 --- a/frogpilot/third_party/influxdb_client/domain/pipe_literal.py +++ /dev/null @@ -1,115 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.expression import Expression - - -class PipeLiteral(Expression): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str' - } - - attribute_map = { - 'type': 'type' - } - - def __init__(self, type=None): # noqa: E501,D401,D403 - """PipeLiteral - a model defined in OpenAPI.""" # noqa: E501 - Expression.__init__(self) # noqa: E501 - - self._type = None - self.discriminator = None - - if type is not None: - self.type = type - - @property - def type(self): - """Get the type of this PipeLiteral. - - Type of AST node - - :return: The type of this PipeLiteral. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this PipeLiteral. - - Type of AST node - - :param type: The type of this PipeLiteral. - :type: str - """ # noqa: E501 - self._type = type - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, PipeLiteral): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/post_bucket_request.py b/frogpilot/third_party/influxdb_client/domain/post_bucket_request.py deleted file mode 100644 index 83215a70..00000000 --- a/frogpilot/third_party/influxdb_client/domain/post_bucket_request.py +++ /dev/null @@ -1,244 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class PostBucketRequest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'org_id': 'str', - 'name': 'str', - 'description': 'str', - 'rp': 'str', - 'retention_rules': 'list[BucketRetentionRules]', - 'schema_type': 'SchemaType' - } - - attribute_map = { - 'org_id': 'orgID', - 'name': 'name', - 'description': 'description', - 'rp': 'rp', - 'retention_rules': 'retentionRules', - 'schema_type': 'schemaType' - } - - def __init__(self, org_id=None, name=None, description=None, rp='0', retention_rules=None, schema_type=None): # noqa: E501,D401,D403 - """PostBucketRequest - a model defined in OpenAPI.""" # noqa: E501 - self._org_id = None - self._name = None - self._description = None - self._rp = None - self._retention_rules = None - self._schema_type = None - self.discriminator = None - - self.org_id = org_id - self.name = name - if description is not None: - self.description = description - if rp is not None: - self.rp = rp - if retention_rules is not None: - self.retention_rules = retention_rules - if schema_type is not None: - self.schema_type = schema_type - - @property - def org_id(self): - """Get the org_id of this PostBucketRequest. - - The organization ID. Specifies the organization that owns the bucket. - - :return: The org_id of this PostBucketRequest. - :rtype: str - """ # noqa: E501 - return self._org_id - - @org_id.setter - def org_id(self, org_id): - """Set the org_id of this PostBucketRequest. - - The organization ID. Specifies the organization that owns the bucket. - - :param org_id: The org_id of this PostBucketRequest. - :type: str - """ # noqa: E501 - if org_id is None: - raise ValueError("Invalid value for `org_id`, must not be `None`") # noqa: E501 - self._org_id = org_id - - @property - def name(self): - """Get the name of this PostBucketRequest. - - The bucket name. - - :return: The name of this PostBucketRequest. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this PostBucketRequest. - - The bucket name. - - :param name: The name of this PostBucketRequest. - :type: str - """ # noqa: E501 - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - self._name = name - - @property - def description(self): - """Get the description of this PostBucketRequest. - - A description of the bucket. - - :return: The description of this PostBucketRequest. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this PostBucketRequest. - - A description of the bucket. - - :param description: The description of this PostBucketRequest. - :type: str - """ # noqa: E501 - self._description = description - - @property - def rp(self): - """Get the rp of this PostBucketRequest. - - The retention policy for the bucket. For InfluxDB 1.x, specifies the duration of time that each data point in the retention policy persists. If you need compatibility with InfluxDB 1.x, specify a value for the `rp` property; otherwise, see the `retentionRules` property. [Retention policy](https://docs.influxdata.com/influxdb/v1.8/concepts/glossary/#retention-policy-rp) is an InfluxDB 1.x concept. The InfluxDB 2.x and Cloud equivalent is [retention period](https://docs.influxdata.com/influxdb/latest/reference/glossary/#retention-period). The InfluxDB `/api/v2` API uses `RetentionRules` to configure the retention period. - - :return: The rp of this PostBucketRequest. - :rtype: str - """ # noqa: E501 - return self._rp - - @rp.setter - def rp(self, rp): - """Set the rp of this PostBucketRequest. - - The retention policy for the bucket. For InfluxDB 1.x, specifies the duration of time that each data point in the retention policy persists. If you need compatibility with InfluxDB 1.x, specify a value for the `rp` property; otherwise, see the `retentionRules` property. [Retention policy](https://docs.influxdata.com/influxdb/v1.8/concepts/glossary/#retention-policy-rp) is an InfluxDB 1.x concept. The InfluxDB 2.x and Cloud equivalent is [retention period](https://docs.influxdata.com/influxdb/latest/reference/glossary/#retention-period). The InfluxDB `/api/v2` API uses `RetentionRules` to configure the retention period. - - :param rp: The rp of this PostBucketRequest. - :type: str - """ # noqa: E501 - self._rp = rp - - @property - def retention_rules(self): - """Get the retention_rules of this PostBucketRequest. - - Retention rules to expire or retain data. The InfluxDB `/api/v2` API uses `RetentionRules` to configure the [retention period](https://docs.influxdata.com/influxdb/latest/reference/glossary/#retention-period). #### InfluxDB Cloud - `retentionRules` is required. #### InfluxDB OSS - `retentionRules` isn't required. - - :return: The retention_rules of this PostBucketRequest. - :rtype: list[BucketRetentionRules] - """ # noqa: E501 - return self._retention_rules - - @retention_rules.setter - def retention_rules(self, retention_rules): - """Set the retention_rules of this PostBucketRequest. - - Retention rules to expire or retain data. The InfluxDB `/api/v2` API uses `RetentionRules` to configure the [retention period](https://docs.influxdata.com/influxdb/latest/reference/glossary/#retention-period). #### InfluxDB Cloud - `retentionRules` is required. #### InfluxDB OSS - `retentionRules` isn't required. - - :param retention_rules: The retention_rules of this PostBucketRequest. - :type: list[BucketRetentionRules] - """ # noqa: E501 - self._retention_rules = retention_rules - - @property - def schema_type(self): - """Get the schema_type of this PostBucketRequest. - - :return: The schema_type of this PostBucketRequest. - :rtype: SchemaType - """ # noqa: E501 - return self._schema_type - - @schema_type.setter - def schema_type(self, schema_type): - """Set the schema_type of this PostBucketRequest. - - :param schema_type: The schema_type of this PostBucketRequest. - :type: SchemaType - """ # noqa: E501 - self._schema_type = schema_type - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, PostBucketRequest): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/post_check.py b/frogpilot/third_party/influxdb_client/domain/post_check.py deleted file mode 100644 index 144a72e3..00000000 --- a/frogpilot/third_party/influxdb_client/domain/post_check.py +++ /dev/null @@ -1,120 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class PostCheck(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str' - } - - attribute_map = { - 'type': 'type' - } - - discriminator_value_class_map = { - 'deadman': 'DeadmanCheck', - 'custom': 'CustomCheck', - 'threshold': 'ThresholdCheck' - } - - def __init__(self, type=None): # noqa: E501,D401,D403 - """PostCheck - a model defined in OpenAPI.""" # noqa: E501 - self._type = None - self.discriminator = 'type' - - self.type = type - - @property - def type(self): - """Get the type of this PostCheck. - - :return: The type of this PostCheck. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this PostCheck. - - :param type: The type of this PostCheck. - :type: str - """ # noqa: E501 - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - self._type = type - - def get_real_child_model(self, data): - """Return the real base class specified by the discriminator.""" - discriminator_key = self.attribute_map[self.discriminator] - discriminator_value = data[discriminator_key] - return self.discriminator_value_class_map.get(discriminator_value) - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, PostCheck): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/post_notification_endpoint.py b/frogpilot/third_party/influxdb_client/domain/post_notification_endpoint.py deleted file mode 100644 index d2d0b3c8..00000000 --- a/frogpilot/third_party/influxdb_client/domain/post_notification_endpoint.py +++ /dev/null @@ -1,121 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class PostNotificationEndpoint(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'NotificationEndpointType' - } - - attribute_map = { - 'type': 'type' - } - - discriminator_value_class_map = { - 'slack': 'SlackNotificationEndpoint', - 'pagerduty': 'PagerDutyNotificationEndpoint', - 'http': 'HTTPNotificationEndpoint', - 'telegram': 'TelegramNotificationEndpoint' - } - - def __init__(self, type=None): # noqa: E501,D401,D403 - """PostNotificationEndpoint - a model defined in OpenAPI.""" # noqa: E501 - self._type = None - self.discriminator = 'type' - - self.type = type - - @property - def type(self): - """Get the type of this PostNotificationEndpoint. - - :return: The type of this PostNotificationEndpoint. - :rtype: NotificationEndpointType - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this PostNotificationEndpoint. - - :param type: The type of this PostNotificationEndpoint. - :type: NotificationEndpointType - """ # noqa: E501 - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - self._type = type - - def get_real_child_model(self, data): - """Return the real base class specified by the discriminator.""" - discriminator_key = self.attribute_map[self.discriminator] - discriminator_value = data[discriminator_key] - return self.discriminator_value_class_map.get(discriminator_value) - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, PostNotificationEndpoint): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/post_notification_rule.py b/frogpilot/third_party/influxdb_client/domain/post_notification_rule.py deleted file mode 100644 index d0a54a0d..00000000 --- a/frogpilot/third_party/influxdb_client/domain/post_notification_rule.py +++ /dev/null @@ -1,126 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class PostNotificationRule(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str' - } - - attribute_map = { - 'type': 'type' - } - - discriminator_value_class_map = { - 'slack': 'SlackNotificationRule', - 'pagerduty': 'PagerDutyNotificationRule', - 'smtp': 'SMTPNotificationRule', - 'http': 'HTTPNotificationRule', - 'telegram': 'TelegramNotificationRule' - } - - def __init__(self, type=None): # noqa: E501,D401,D403 - """PostNotificationRule - a model defined in OpenAPI.""" # noqa: E501 - self._type = None - self.discriminator = 'type' - - self.type = type - - @property - def type(self): - """Get the type of this PostNotificationRule. - - The discriminator between other types of notification rules is "telegram". - - :return: The type of this PostNotificationRule. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this PostNotificationRule. - - The discriminator between other types of notification rules is "telegram". - - :param type: The type of this PostNotificationRule. - :type: str - """ # noqa: E501 - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - self._type = type - - def get_real_child_model(self, data): - """Return the real base class specified by the discriminator.""" - discriminator_key = self.attribute_map[self.discriminator] - discriminator_value = data[discriminator_key] - return self.discriminator_value_class_map.get(discriminator_value) - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, PostNotificationRule): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/post_organization_request.py b/frogpilot/third_party/influxdb_client/domain/post_organization_request.py deleted file mode 100644 index 5e152d37..00000000 --- a/frogpilot/third_party/influxdb_client/domain/post_organization_request.py +++ /dev/null @@ -1,139 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class PostOrganizationRequest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str', - 'description': 'str' - } - - attribute_map = { - 'name': 'name', - 'description': 'description' - } - - def __init__(self, name=None, description=None): # noqa: E501,D401,D403 - """PostOrganizationRequest - a model defined in OpenAPI.""" # noqa: E501 - self._name = None - self._description = None - self.discriminator = None - - self.name = name - if description is not None: - self.description = description - - @property - def name(self): - """Get the name of this PostOrganizationRequest. - - The name of the organization. - - :return: The name of this PostOrganizationRequest. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this PostOrganizationRequest. - - The name of the organization. - - :param name: The name of this PostOrganizationRequest. - :type: str - """ # noqa: E501 - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - self._name = name - - @property - def description(self): - """Get the description of this PostOrganizationRequest. - - The description of the organization. - - :return: The description of this PostOrganizationRequest. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this PostOrganizationRequest. - - The description of the organization. - - :param description: The description of this PostOrganizationRequest. - :type: str - """ # noqa: E501 - self._description = description - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, PostOrganizationRequest): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/post_restore_kv_response.py b/frogpilot/third_party/influxdb_client/domain/post_restore_kv_response.py deleted file mode 100644 index 5cd5c166..00000000 --- a/frogpilot/third_party/influxdb_client/domain/post_restore_kv_response.py +++ /dev/null @@ -1,111 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class PostRestoreKVResponse(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'token': 'str' - } - - attribute_map = { - 'token': 'token' - } - - def __init__(self, token=None): # noqa: E501,D401,D403 - """PostRestoreKVResponse - a model defined in OpenAPI.""" # noqa: E501 - self._token = None - self.discriminator = None - - if token is not None: - self.token = token - - @property - def token(self): - """Get the token of this PostRestoreKVResponse. - - token is the root token for the instance after restore (this is overwritten during the restore) - - :return: The token of this PostRestoreKVResponse. - :rtype: str - """ # noqa: E501 - return self._token - - @token.setter - def token(self, token): - """Set the token of this PostRestoreKVResponse. - - token is the root token for the instance after restore (this is overwritten during the restore) - - :param token: The token of this PostRestoreKVResponse. - :type: str - """ # noqa: E501 - self._token = token - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, PostRestoreKVResponse): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/post_stack_request.py b/frogpilot/third_party/influxdb_client/domain/post_stack_request.py deleted file mode 100644 index ce683035..00000000 --- a/frogpilot/third_party/influxdb_client/domain/post_stack_request.py +++ /dev/null @@ -1,176 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class PostStackRequest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'org_id': 'str', - 'name': 'str', - 'description': 'str', - 'urls': 'list[str]' - } - - attribute_map = { - 'org_id': 'orgID', - 'name': 'name', - 'description': 'description', - 'urls': 'urls' - } - - def __init__(self, org_id=None, name=None, description=None, urls=None): # noqa: E501,D401,D403 - """PostStackRequest - a model defined in OpenAPI.""" # noqa: E501 - self._org_id = None - self._name = None - self._description = None - self._urls = None - self.discriminator = None - - if org_id is not None: - self.org_id = org_id - if name is not None: - self.name = name - if description is not None: - self.description = description - if urls is not None: - self.urls = urls - - @property - def org_id(self): - """Get the org_id of this PostStackRequest. - - :return: The org_id of this PostStackRequest. - :rtype: str - """ # noqa: E501 - return self._org_id - - @org_id.setter - def org_id(self, org_id): - """Set the org_id of this PostStackRequest. - - :param org_id: The org_id of this PostStackRequest. - :type: str - """ # noqa: E501 - self._org_id = org_id - - @property - def name(self): - """Get the name of this PostStackRequest. - - :return: The name of this PostStackRequest. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this PostStackRequest. - - :param name: The name of this PostStackRequest. - :type: str - """ # noqa: E501 - self._name = name - - @property - def description(self): - """Get the description of this PostStackRequest. - - :return: The description of this PostStackRequest. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this PostStackRequest. - - :param description: The description of this PostStackRequest. - :type: str - """ # noqa: E501 - self._description = description - - @property - def urls(self): - """Get the urls of this PostStackRequest. - - :return: The urls of this PostStackRequest. - :rtype: list[str] - """ # noqa: E501 - return self._urls - - @urls.setter - def urls(self, urls): - """Set the urls of this PostStackRequest. - - :param urls: The urls of this PostStackRequest. - :type: list[str] - """ # noqa: E501 - self._urls = urls - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, PostStackRequest): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/property_key.py b/frogpilot/third_party/influxdb_client/domain/property_key.py deleted file mode 100644 index e072527b..00000000 --- a/frogpilot/third_party/influxdb_client/domain/property_key.py +++ /dev/null @@ -1,86 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.expression import Expression - - -class PropertyKey(Expression): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501,D401,D403 - """PropertyKey - a model defined in OpenAPI.""" # noqa: E501 - Expression.__init__(self) # noqa: E501 - self.discriminator = None - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, PropertyKey): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/query.py b/frogpilot/third_party/influxdb_client/domain/query.py deleted file mode 100644 index 9b69972c..00000000 --- a/frogpilot/third_party/influxdb_client/domain/query.py +++ /dev/null @@ -1,239 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class Query(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'extern': 'File', - 'query': 'str', - 'type': 'str', - 'params': 'dict(str, object)', - 'dialect': 'Dialect', - 'now': 'datetime' - } - - attribute_map = { - 'extern': 'extern', - 'query': 'query', - 'type': 'type', - 'params': 'params', - 'dialect': 'dialect', - 'now': 'now' - } - - def __init__(self, extern=None, query=None, type=None, params=None, dialect=None, now=None): # noqa: E501,D401,D403 - """Query - a model defined in OpenAPI.""" # noqa: E501 - self._extern = None - self._query = None - self._type = None - self._params = None - self._dialect = None - self._now = None - self.discriminator = None - - if extern is not None: - self.extern = extern - self.query = query - if type is not None: - self.type = type - if params is not None: - self.params = params - if dialect is not None: - self.dialect = dialect - if now is not None: - self.now = now - - @property - def extern(self): - """Get the extern of this Query. - - :return: The extern of this Query. - :rtype: File - """ # noqa: E501 - return self._extern - - @extern.setter - def extern(self, extern): - """Set the extern of this Query. - - :param extern: The extern of this Query. - :type: File - """ # noqa: E501 - self._extern = extern - - @property - def query(self): - """Get the query of this Query. - - The query script to execute. - - :return: The query of this Query. - :rtype: str - """ # noqa: E501 - return self._query - - @query.setter - def query(self, query): - """Set the query of this Query. - - The query script to execute. - - :param query: The query of this Query. - :type: str - """ # noqa: E501 - if query is None: - raise ValueError("Invalid value for `query`, must not be `None`") # noqa: E501 - self._query = query - - @property - def type(self): - """Get the type of this Query. - - The type of query. Must be "flux". - - :return: The type of this Query. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this Query. - - The type of query. Must be "flux". - - :param type: The type of this Query. - :type: str - """ # noqa: E501 - self._type = type - - @property - def params(self): - r"""Get the params of this Query. - - Key-value pairs passed as parameters during query execution. To use parameters in your query, pass a _`query`_ with `params` references (in dot notation)--for example: ```json query: "from(bucket: params.mybucket)\\ |> range(start: params.rangeStart) |> limit(n:1)" ``` and pass _`params`_ with the key-value pairs--for example: ```json params: { "mybucket": "environment", "rangeStart": "-30d" } ``` During query execution, InfluxDB passes _`params`_ to your script and substitutes the values. #### Limitations - If you use _`params`_, you can't use _`extern`_. - - :return: The params of this Query. - :rtype: dict(str, object) - """ # noqa: E501 - return self._params - - @params.setter - def params(self, params): - r"""Set the params of this Query. - - Key-value pairs passed as parameters during query execution. To use parameters in your query, pass a _`query`_ with `params` references (in dot notation)--for example: ```json query: "from(bucket: params.mybucket)\\ |> range(start: params.rangeStart) |> limit(n:1)" ``` and pass _`params`_ with the key-value pairs--for example: ```json params: { "mybucket": "environment", "rangeStart": "-30d" } ``` During query execution, InfluxDB passes _`params`_ to your script and substitutes the values. #### Limitations - If you use _`params`_, you can't use _`extern`_. - - :param params: The params of this Query. - :type: dict(str, object) - """ # noqa: E501 - self._params = params - - @property - def dialect(self): - """Get the dialect of this Query. - - :return: The dialect of this Query. - :rtype: Dialect - """ # noqa: E501 - return self._dialect - - @dialect.setter - def dialect(self, dialect): - """Set the dialect of this Query. - - :param dialect: The dialect of this Query. - :type: Dialect - """ # noqa: E501 - self._dialect = dialect - - @property - def now(self): - """Get the now of this Query. - - Specifies the time that should be reported as `now` in the query. Default is the server `now` time. - - :return: The now of this Query. - :rtype: datetime - """ # noqa: E501 - return self._now - - @now.setter - def now(self, now): - """Set the now of this Query. - - Specifies the time that should be reported as `now` in the query. Default is the server `now` time. - - :param now: The now of this Query. - :type: datetime - """ # noqa: E501 - self._now = now - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Query): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/query_edit_mode.py b/frogpilot/third_party/influxdb_client/domain/query_edit_mode.py deleted file mode 100644 index 8a7fba8b..00000000 --- a/frogpilot/third_party/influxdb_client/domain/query_edit_mode.py +++ /dev/null @@ -1,88 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class QueryEditMode(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - allowed enum values - """ - BUILDER = "builder" - ADVANCED = "advanced" - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501,D401,D403 - """QueryEditMode - a model defined in OpenAPI.""" # noqa: E501 self.discriminator = None - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, QueryEditMode): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/query_variable_properties.py b/frogpilot/third_party/influxdb_client/domain/query_variable_properties.py deleted file mode 100644 index 143bb01e..00000000 --- a/frogpilot/third_party/influxdb_client/domain/query_variable_properties.py +++ /dev/null @@ -1,134 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.variable_properties import VariableProperties - - -class QueryVariableProperties(VariableProperties): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'values': 'QueryVariablePropertiesValues' - } - - attribute_map = { - 'type': 'type', - 'values': 'values' - } - - def __init__(self, type=None, values=None): # noqa: E501,D401,D403 - """QueryVariableProperties - a model defined in OpenAPI.""" # noqa: E501 - VariableProperties.__init__(self) # noqa: E501 - - self._type = None - self._values = None - self.discriminator = None - - if type is not None: - self.type = type - if values is not None: - self.values = values - - @property - def type(self): - """Get the type of this QueryVariableProperties. - - :return: The type of this QueryVariableProperties. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this QueryVariableProperties. - - :param type: The type of this QueryVariableProperties. - :type: str - """ # noqa: E501 - self._type = type - - @property - def values(self): - """Get the values of this QueryVariableProperties. - - :return: The values of this QueryVariableProperties. - :rtype: QueryVariablePropertiesValues - """ # noqa: E501 - return self._values - - @values.setter - def values(self, values): - """Set the values of this QueryVariableProperties. - - :param values: The values of this QueryVariableProperties. - :type: QueryVariablePropertiesValues - """ # noqa: E501 - self._values = values - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, QueryVariableProperties): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/query_variable_properties_values.py b/frogpilot/third_party/influxdb_client/domain/query_variable_properties_values.py deleted file mode 100644 index a06a174e..00000000 --- a/frogpilot/third_party/influxdb_client/domain/query_variable_properties_values.py +++ /dev/null @@ -1,130 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class QueryVariablePropertiesValues(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'query': 'str', - 'language': 'str' - } - - attribute_map = { - 'query': 'query', - 'language': 'language' - } - - def __init__(self, query=None, language=None): # noqa: E501,D401,D403 - """QueryVariablePropertiesValues - a model defined in OpenAPI.""" # noqa: E501 - self._query = None - self._language = None - self.discriminator = None - - if query is not None: - self.query = query - if language is not None: - self.language = language - - @property - def query(self): - """Get the query of this QueryVariablePropertiesValues. - - :return: The query of this QueryVariablePropertiesValues. - :rtype: str - """ # noqa: E501 - return self._query - - @query.setter - def query(self, query): - """Set the query of this QueryVariablePropertiesValues. - - :param query: The query of this QueryVariablePropertiesValues. - :type: str - """ # noqa: E501 - self._query = query - - @property - def language(self): - """Get the language of this QueryVariablePropertiesValues. - - :return: The language of this QueryVariablePropertiesValues. - :rtype: str - """ # noqa: E501 - return self._language - - @language.setter - def language(self, language): - """Set the language of this QueryVariablePropertiesValues. - - :param language: The language of this QueryVariablePropertiesValues. - :type: str - """ # noqa: E501 - self._language = language - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, QueryVariablePropertiesValues): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/range_threshold.py b/frogpilot/third_party/influxdb_client/domain/range_threshold.py deleted file mode 100644 index 68e19860..00000000 --- a/frogpilot/third_party/influxdb_client/domain/range_threshold.py +++ /dev/null @@ -1,188 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.threshold_base import ThresholdBase - - -class RangeThreshold(ThresholdBase): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'min': 'float', - 'max': 'float', - 'within': 'bool', - 'level': 'CheckStatusLevel', - 'all_values': 'bool' - } - - attribute_map = { - 'type': 'type', - 'min': 'min', - 'max': 'max', - 'within': 'within', - 'level': 'level', - 'all_values': 'allValues' - } - - def __init__(self, type="range", min=None, max=None, within=None, level=None, all_values=None): # noqa: E501,D401,D403 - """RangeThreshold - a model defined in OpenAPI.""" # noqa: E501 - ThresholdBase.__init__(self, level=level, all_values=all_values) # noqa: E501 - - self._type = None - self._min = None - self._max = None - self._within = None - self.discriminator = None - - self.type = type - self.min = min - self.max = max - self.within = within - - @property - def type(self): - """Get the type of this RangeThreshold. - - :return: The type of this RangeThreshold. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this RangeThreshold. - - :param type: The type of this RangeThreshold. - :type: str - """ # noqa: E501 - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - self._type = type - - @property - def min(self): - """Get the min of this RangeThreshold. - - :return: The min of this RangeThreshold. - :rtype: float - """ # noqa: E501 - return self._min - - @min.setter - def min(self, min): - """Set the min of this RangeThreshold. - - :param min: The min of this RangeThreshold. - :type: float - """ # noqa: E501 - if min is None: - raise ValueError("Invalid value for `min`, must not be `None`") # noqa: E501 - self._min = min - - @property - def max(self): - """Get the max of this RangeThreshold. - - :return: The max of this RangeThreshold. - :rtype: float - """ # noqa: E501 - return self._max - - @max.setter - def max(self, max): - """Set the max of this RangeThreshold. - - :param max: The max of this RangeThreshold. - :type: float - """ # noqa: E501 - if max is None: - raise ValueError("Invalid value for `max`, must not be `None`") # noqa: E501 - self._max = max - - @property - def within(self): - """Get the within of this RangeThreshold. - - :return: The within of this RangeThreshold. - :rtype: bool - """ # noqa: E501 - return self._within - - @within.setter - def within(self, within): - """Set the within of this RangeThreshold. - - :param within: The within of this RangeThreshold. - :type: bool - """ # noqa: E501 - if within is None: - raise ValueError("Invalid value for `within`, must not be `None`") # noqa: E501 - self._within = within - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, RangeThreshold): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/ready.py b/frogpilot/third_party/influxdb_client/domain/ready.py deleted file mode 100644 index 46c4d29b..00000000 --- a/frogpilot/third_party/influxdb_client/domain/ready.py +++ /dev/null @@ -1,153 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class Ready(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'status': 'str', - 'started': 'datetime', - 'up': 'str' - } - - attribute_map = { - 'status': 'status', - 'started': 'started', - 'up': 'up' - } - - def __init__(self, status=None, started=None, up=None): # noqa: E501,D401,D403 - """Ready - a model defined in OpenAPI.""" # noqa: E501 - self._status = None - self._started = None - self._up = None - self.discriminator = None - - if status is not None: - self.status = status - if started is not None: - self.started = started - if up is not None: - self.up = up - - @property - def status(self): - """Get the status of this Ready. - - :return: The status of this Ready. - :rtype: str - """ # noqa: E501 - return self._status - - @status.setter - def status(self, status): - """Set the status of this Ready. - - :param status: The status of this Ready. - :type: str - """ # noqa: E501 - self._status = status - - @property - def started(self): - """Get the started of this Ready. - - :return: The started of this Ready. - :rtype: datetime - """ # noqa: E501 - return self._started - - @started.setter - def started(self, started): - """Set the started of this Ready. - - :param started: The started of this Ready. - :type: datetime - """ # noqa: E501 - self._started = started - - @property - def up(self): - """Get the up of this Ready. - - :return: The up of this Ready. - :rtype: str - """ # noqa: E501 - return self._up - - @up.setter - def up(self, up): - """Set the up of this Ready. - - :param up: The up of this Ready. - :type: str - """ # noqa: E501 - self._up = up - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Ready): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/regexp_literal.py b/frogpilot/third_party/influxdb_client/domain/regexp_literal.py deleted file mode 100644 index 95fe4cb1..00000000 --- a/frogpilot/third_party/influxdb_client/domain/regexp_literal.py +++ /dev/null @@ -1,138 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.expression import Expression - - -class RegexpLiteral(Expression): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'value': 'str' - } - - attribute_map = { - 'type': 'type', - 'value': 'value' - } - - def __init__(self, type=None, value=None): # noqa: E501,D401,D403 - """RegexpLiteral - a model defined in OpenAPI.""" # noqa: E501 - Expression.__init__(self) # noqa: E501 - - self._type = None - self._value = None - self.discriminator = None - - if type is not None: - self.type = type - if value is not None: - self.value = value - - @property - def type(self): - """Get the type of this RegexpLiteral. - - Type of AST node - - :return: The type of this RegexpLiteral. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this RegexpLiteral. - - Type of AST node - - :param type: The type of this RegexpLiteral. - :type: str - """ # noqa: E501 - self._type = type - - @property - def value(self): - """Get the value of this RegexpLiteral. - - :return: The value of this RegexpLiteral. - :rtype: str - """ # noqa: E501 - return self._value - - @value.setter - def value(self, value): - """Set the value of this RegexpLiteral. - - :param value: The value of this RegexpLiteral. - :type: str - """ # noqa: E501 - self._value = value - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, RegexpLiteral): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/remote_connection.py b/frogpilot/third_party/influxdb_client/domain/remote_connection.py deleted file mode 100644 index e0c1785c..00000000 --- a/frogpilot/third_party/influxdb_client/domain/remote_connection.py +++ /dev/null @@ -1,250 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class RemoteConnection(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'str', - 'name': 'str', - 'org_id': 'str', - 'description': 'str', - 'remote_url': 'str', - 'remote_org_id': 'str', - 'allow_insecure_tls': 'bool' - } - - attribute_map = { - 'id': 'id', - 'name': 'name', - 'org_id': 'orgID', - 'description': 'description', - 'remote_url': 'remoteURL', - 'remote_org_id': 'remoteOrgID', - 'allow_insecure_tls': 'allowInsecureTLS' - } - - def __init__(self, id=None, name=None, org_id=None, description=None, remote_url=None, remote_org_id=None, allow_insecure_tls=False): # noqa: E501,D401,D403 - """RemoteConnection - a model defined in OpenAPI.""" # noqa: E501 - self._id = None - self._name = None - self._org_id = None - self._description = None - self._remote_url = None - self._remote_org_id = None - self._allow_insecure_tls = None - self.discriminator = None - - self.id = id - self.name = name - self.org_id = org_id - if description is not None: - self.description = description - self.remote_url = remote_url - if remote_org_id is not None: - self.remote_org_id = remote_org_id - self.allow_insecure_tls = allow_insecure_tls - - @property - def id(self): - """Get the id of this RemoteConnection. - - :return: The id of this RemoteConnection. - :rtype: str - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this RemoteConnection. - - :param id: The id of this RemoteConnection. - :type: str - """ # noqa: E501 - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 - self._id = id - - @property - def name(self): - """Get the name of this RemoteConnection. - - :return: The name of this RemoteConnection. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this RemoteConnection. - - :param name: The name of this RemoteConnection. - :type: str - """ # noqa: E501 - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - self._name = name - - @property - def org_id(self): - """Get the org_id of this RemoteConnection. - - :return: The org_id of this RemoteConnection. - :rtype: str - """ # noqa: E501 - return self._org_id - - @org_id.setter - def org_id(self, org_id): - """Set the org_id of this RemoteConnection. - - :param org_id: The org_id of this RemoteConnection. - :type: str - """ # noqa: E501 - if org_id is None: - raise ValueError("Invalid value for `org_id`, must not be `None`") # noqa: E501 - self._org_id = org_id - - @property - def description(self): - """Get the description of this RemoteConnection. - - :return: The description of this RemoteConnection. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this RemoteConnection. - - :param description: The description of this RemoteConnection. - :type: str - """ # noqa: E501 - self._description = description - - @property - def remote_url(self): - """Get the remote_url of this RemoteConnection. - - :return: The remote_url of this RemoteConnection. - :rtype: str - """ # noqa: E501 - return self._remote_url - - @remote_url.setter - def remote_url(self, remote_url): - """Set the remote_url of this RemoteConnection. - - :param remote_url: The remote_url of this RemoteConnection. - :type: str - """ # noqa: E501 - if remote_url is None: - raise ValueError("Invalid value for `remote_url`, must not be `None`") # noqa: E501 - self._remote_url = remote_url - - @property - def remote_org_id(self): - """Get the remote_org_id of this RemoteConnection. - - :return: The remote_org_id of this RemoteConnection. - :rtype: str - """ # noqa: E501 - return self._remote_org_id - - @remote_org_id.setter - def remote_org_id(self, remote_org_id): - """Set the remote_org_id of this RemoteConnection. - - :param remote_org_id: The remote_org_id of this RemoteConnection. - :type: str - """ # noqa: E501 - self._remote_org_id = remote_org_id - - @property - def allow_insecure_tls(self): - """Get the allow_insecure_tls of this RemoteConnection. - - :return: The allow_insecure_tls of this RemoteConnection. - :rtype: bool - """ # noqa: E501 - return self._allow_insecure_tls - - @allow_insecure_tls.setter - def allow_insecure_tls(self, allow_insecure_tls): - """Set the allow_insecure_tls of this RemoteConnection. - - :param allow_insecure_tls: The allow_insecure_tls of this RemoteConnection. - :type: bool - """ # noqa: E501 - if allow_insecure_tls is None: - raise ValueError("Invalid value for `allow_insecure_tls`, must not be `None`") # noqa: E501 - self._allow_insecure_tls = allow_insecure_tls - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, RemoteConnection): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/remote_connection_creation_request.py b/frogpilot/third_party/influxdb_client/domain/remote_connection_creation_request.py deleted file mode 100644 index ba775362..00000000 --- a/frogpilot/third_party/influxdb_client/domain/remote_connection_creation_request.py +++ /dev/null @@ -1,250 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class RemoteConnectionCreationRequest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str', - 'description': 'str', - 'org_id': 'str', - 'remote_url': 'str', - 'remote_api_token': 'str', - 'remote_org_id': 'str', - 'allow_insecure_tls': 'bool' - } - - attribute_map = { - 'name': 'name', - 'description': 'description', - 'org_id': 'orgID', - 'remote_url': 'remoteURL', - 'remote_api_token': 'remoteAPIToken', - 'remote_org_id': 'remoteOrgID', - 'allow_insecure_tls': 'allowInsecureTLS' - } - - def __init__(self, name=None, description=None, org_id=None, remote_url=None, remote_api_token=None, remote_org_id=None, allow_insecure_tls=False): # noqa: E501,D401,D403 - """RemoteConnectionCreationRequest - a model defined in OpenAPI.""" # noqa: E501 - self._name = None - self._description = None - self._org_id = None - self._remote_url = None - self._remote_api_token = None - self._remote_org_id = None - self._allow_insecure_tls = None - self.discriminator = None - - self.name = name - if description is not None: - self.description = description - self.org_id = org_id - self.remote_url = remote_url - self.remote_api_token = remote_api_token - if remote_org_id is not None: - self.remote_org_id = remote_org_id - self.allow_insecure_tls = allow_insecure_tls - - @property - def name(self): - """Get the name of this RemoteConnectionCreationRequest. - - :return: The name of this RemoteConnectionCreationRequest. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this RemoteConnectionCreationRequest. - - :param name: The name of this RemoteConnectionCreationRequest. - :type: str - """ # noqa: E501 - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - self._name = name - - @property - def description(self): - """Get the description of this RemoteConnectionCreationRequest. - - :return: The description of this RemoteConnectionCreationRequest. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this RemoteConnectionCreationRequest. - - :param description: The description of this RemoteConnectionCreationRequest. - :type: str - """ # noqa: E501 - self._description = description - - @property - def org_id(self): - """Get the org_id of this RemoteConnectionCreationRequest. - - :return: The org_id of this RemoteConnectionCreationRequest. - :rtype: str - """ # noqa: E501 - return self._org_id - - @org_id.setter - def org_id(self, org_id): - """Set the org_id of this RemoteConnectionCreationRequest. - - :param org_id: The org_id of this RemoteConnectionCreationRequest. - :type: str - """ # noqa: E501 - if org_id is None: - raise ValueError("Invalid value for `org_id`, must not be `None`") # noqa: E501 - self._org_id = org_id - - @property - def remote_url(self): - """Get the remote_url of this RemoteConnectionCreationRequest. - - :return: The remote_url of this RemoteConnectionCreationRequest. - :rtype: str - """ # noqa: E501 - return self._remote_url - - @remote_url.setter - def remote_url(self, remote_url): - """Set the remote_url of this RemoteConnectionCreationRequest. - - :param remote_url: The remote_url of this RemoteConnectionCreationRequest. - :type: str - """ # noqa: E501 - if remote_url is None: - raise ValueError("Invalid value for `remote_url`, must not be `None`") # noqa: E501 - self._remote_url = remote_url - - @property - def remote_api_token(self): - """Get the remote_api_token of this RemoteConnectionCreationRequest. - - :return: The remote_api_token of this RemoteConnectionCreationRequest. - :rtype: str - """ # noqa: E501 - return self._remote_api_token - - @remote_api_token.setter - def remote_api_token(self, remote_api_token): - """Set the remote_api_token of this RemoteConnectionCreationRequest. - - :param remote_api_token: The remote_api_token of this RemoteConnectionCreationRequest. - :type: str - """ # noqa: E501 - if remote_api_token is None: - raise ValueError("Invalid value for `remote_api_token`, must not be `None`") # noqa: E501 - self._remote_api_token = remote_api_token - - @property - def remote_org_id(self): - """Get the remote_org_id of this RemoteConnectionCreationRequest. - - :return: The remote_org_id of this RemoteConnectionCreationRequest. - :rtype: str - """ # noqa: E501 - return self._remote_org_id - - @remote_org_id.setter - def remote_org_id(self, remote_org_id): - """Set the remote_org_id of this RemoteConnectionCreationRequest. - - :param remote_org_id: The remote_org_id of this RemoteConnectionCreationRequest. - :type: str - """ # noqa: E501 - self._remote_org_id = remote_org_id - - @property - def allow_insecure_tls(self): - """Get the allow_insecure_tls of this RemoteConnectionCreationRequest. - - :return: The allow_insecure_tls of this RemoteConnectionCreationRequest. - :rtype: bool - """ # noqa: E501 - return self._allow_insecure_tls - - @allow_insecure_tls.setter - def allow_insecure_tls(self, allow_insecure_tls): - """Set the allow_insecure_tls of this RemoteConnectionCreationRequest. - - :param allow_insecure_tls: The allow_insecure_tls of this RemoteConnectionCreationRequest. - :type: bool - """ # noqa: E501 - if allow_insecure_tls is None: - raise ValueError("Invalid value for `allow_insecure_tls`, must not be `None`") # noqa: E501 - self._allow_insecure_tls = allow_insecure_tls - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, RemoteConnectionCreationRequest): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/remote_connection_update_request.py b/frogpilot/third_party/influxdb_client/domain/remote_connection_update_request.py deleted file mode 100644 index 54fd9f1c..00000000 --- a/frogpilot/third_party/influxdb_client/domain/remote_connection_update_request.py +++ /dev/null @@ -1,222 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class RemoteConnectionUpdateRequest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str', - 'description': 'str', - 'remote_url': 'str', - 'remote_api_token': 'str', - 'remote_org_id': 'str', - 'allow_insecure_tls': 'bool' - } - - attribute_map = { - 'name': 'name', - 'description': 'description', - 'remote_url': 'remoteURL', - 'remote_api_token': 'remoteAPIToken', - 'remote_org_id': 'remoteOrgID', - 'allow_insecure_tls': 'allowInsecureTLS' - } - - def __init__(self, name=None, description=None, remote_url=None, remote_api_token=None, remote_org_id=None, allow_insecure_tls=False): # noqa: E501,D401,D403 - """RemoteConnectionUpdateRequest - a model defined in OpenAPI.""" # noqa: E501 - self._name = None - self._description = None - self._remote_url = None - self._remote_api_token = None - self._remote_org_id = None - self._allow_insecure_tls = None - self.discriminator = None - - if name is not None: - self.name = name - if description is not None: - self.description = description - if remote_url is not None: - self.remote_url = remote_url - if remote_api_token is not None: - self.remote_api_token = remote_api_token - if remote_org_id is not None: - self.remote_org_id = remote_org_id - if allow_insecure_tls is not None: - self.allow_insecure_tls = allow_insecure_tls - - @property - def name(self): - """Get the name of this RemoteConnectionUpdateRequest. - - :return: The name of this RemoteConnectionUpdateRequest. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this RemoteConnectionUpdateRequest. - - :param name: The name of this RemoteConnectionUpdateRequest. - :type: str - """ # noqa: E501 - self._name = name - - @property - def description(self): - """Get the description of this RemoteConnectionUpdateRequest. - - :return: The description of this RemoteConnectionUpdateRequest. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this RemoteConnectionUpdateRequest. - - :param description: The description of this RemoteConnectionUpdateRequest. - :type: str - """ # noqa: E501 - self._description = description - - @property - def remote_url(self): - """Get the remote_url of this RemoteConnectionUpdateRequest. - - :return: The remote_url of this RemoteConnectionUpdateRequest. - :rtype: str - """ # noqa: E501 - return self._remote_url - - @remote_url.setter - def remote_url(self, remote_url): - """Set the remote_url of this RemoteConnectionUpdateRequest. - - :param remote_url: The remote_url of this RemoteConnectionUpdateRequest. - :type: str - """ # noqa: E501 - self._remote_url = remote_url - - @property - def remote_api_token(self): - """Get the remote_api_token of this RemoteConnectionUpdateRequest. - - :return: The remote_api_token of this RemoteConnectionUpdateRequest. - :rtype: str - """ # noqa: E501 - return self._remote_api_token - - @remote_api_token.setter - def remote_api_token(self, remote_api_token): - """Set the remote_api_token of this RemoteConnectionUpdateRequest. - - :param remote_api_token: The remote_api_token of this RemoteConnectionUpdateRequest. - :type: str - """ # noqa: E501 - self._remote_api_token = remote_api_token - - @property - def remote_org_id(self): - """Get the remote_org_id of this RemoteConnectionUpdateRequest. - - :return: The remote_org_id of this RemoteConnectionUpdateRequest. - :rtype: str - """ # noqa: E501 - return self._remote_org_id - - @remote_org_id.setter - def remote_org_id(self, remote_org_id): - """Set the remote_org_id of this RemoteConnectionUpdateRequest. - - :param remote_org_id: The remote_org_id of this RemoteConnectionUpdateRequest. - :type: str - """ # noqa: E501 - self._remote_org_id = remote_org_id - - @property - def allow_insecure_tls(self): - """Get the allow_insecure_tls of this RemoteConnectionUpdateRequest. - - :return: The allow_insecure_tls of this RemoteConnectionUpdateRequest. - :rtype: bool - """ # noqa: E501 - return self._allow_insecure_tls - - @allow_insecure_tls.setter - def allow_insecure_tls(self, allow_insecure_tls): - """Set the allow_insecure_tls of this RemoteConnectionUpdateRequest. - - :param allow_insecure_tls: The allow_insecure_tls of this RemoteConnectionUpdateRequest. - :type: bool - """ # noqa: E501 - self._allow_insecure_tls = allow_insecure_tls - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, RemoteConnectionUpdateRequest): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/remote_connections.py b/frogpilot/third_party/influxdb_client/domain/remote_connections.py deleted file mode 100644 index ca6d30ce..00000000 --- a/frogpilot/third_party/influxdb_client/domain/remote_connections.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class RemoteConnections(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'remotes': 'list[RemoteConnection]' - } - - attribute_map = { - 'remotes': 'remotes' - } - - def __init__(self, remotes=None): # noqa: E501,D401,D403 - """RemoteConnections - a model defined in OpenAPI.""" # noqa: E501 - self._remotes = None - self.discriminator = None - - if remotes is not None: - self.remotes = remotes - - @property - def remotes(self): - """Get the remotes of this RemoteConnections. - - :return: The remotes of this RemoteConnections. - :rtype: list[RemoteConnection] - """ # noqa: E501 - return self._remotes - - @remotes.setter - def remotes(self, remotes): - """Set the remotes of this RemoteConnections. - - :param remotes: The remotes of this RemoteConnections. - :type: list[RemoteConnection] - """ # noqa: E501 - self._remotes = remotes - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, RemoteConnections): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/renamable_field.py b/frogpilot/third_party/influxdb_client/domain/renamable_field.py deleted file mode 100644 index 088cea3d..00000000 --- a/frogpilot/third_party/influxdb_client/domain/renamable_field.py +++ /dev/null @@ -1,165 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class RenamableField(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'internal_name': 'str', - 'display_name': 'str', - 'visible': 'bool' - } - - attribute_map = { - 'internal_name': 'internalName', - 'display_name': 'displayName', - 'visible': 'visible' - } - - def __init__(self, internal_name=None, display_name=None, visible=None): # noqa: E501,D401,D403 - """RenamableField - a model defined in OpenAPI.""" # noqa: E501 - self._internal_name = None - self._display_name = None - self._visible = None - self.discriminator = None - - if internal_name is not None: - self.internal_name = internal_name - if display_name is not None: - self.display_name = display_name - if visible is not None: - self.visible = visible - - @property - def internal_name(self): - """Get the internal_name of this RenamableField. - - The calculated name of a field. - - :return: The internal_name of this RenamableField. - :rtype: str - """ # noqa: E501 - return self._internal_name - - @internal_name.setter - def internal_name(self, internal_name): - """Set the internal_name of this RenamableField. - - The calculated name of a field. - - :param internal_name: The internal_name of this RenamableField. - :type: str - """ # noqa: E501 - self._internal_name = internal_name - - @property - def display_name(self): - """Get the display_name of this RenamableField. - - The name that a field is renamed to by the user. - - :return: The display_name of this RenamableField. - :rtype: str - """ # noqa: E501 - return self._display_name - - @display_name.setter - def display_name(self, display_name): - """Set the display_name of this RenamableField. - - The name that a field is renamed to by the user. - - :param display_name: The display_name of this RenamableField. - :type: str - """ # noqa: E501 - self._display_name = display_name - - @property - def visible(self): - """Get the visible of this RenamableField. - - Indicates whether this field should be visible on the table. - - :return: The visible of this RenamableField. - :rtype: bool - """ # noqa: E501 - return self._visible - - @visible.setter - def visible(self, visible): - """Set the visible of this RenamableField. - - Indicates whether this field should be visible on the table. - - :param visible: The visible of this RenamableField. - :type: bool - """ # noqa: E501 - self._visible = visible - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, RenamableField): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/replication.py b/frogpilot/third_party/influxdb_client/domain/replication.py deleted file mode 100644 index fea45ca3..00000000 --- a/frogpilot/third_party/influxdb_client/domain/replication.py +++ /dev/null @@ -1,412 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class Replication(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'str', - 'name': 'str', - 'description': 'str', - 'org_id': 'str', - 'remote_id': 'str', - 'local_bucket_id': 'str', - 'remote_bucket_id': 'str', - 'remote_bucket_name': 'str', - 'max_queue_size_bytes': 'int', - 'current_queue_size_bytes': 'int', - 'remaining_bytes_to_be_synced': 'int', - 'latest_response_code': 'int', - 'latest_error_message': 'str', - 'drop_non_retryable_data': 'bool' - } - - attribute_map = { - 'id': 'id', - 'name': 'name', - 'description': 'description', - 'org_id': 'orgID', - 'remote_id': 'remoteID', - 'local_bucket_id': 'localBucketID', - 'remote_bucket_id': 'remoteBucketID', - 'remote_bucket_name': 'remoteBucketName', - 'max_queue_size_bytes': 'maxQueueSizeBytes', - 'current_queue_size_bytes': 'currentQueueSizeBytes', - 'remaining_bytes_to_be_synced': 'remainingBytesToBeSynced', - 'latest_response_code': 'latestResponseCode', - 'latest_error_message': 'latestErrorMessage', - 'drop_non_retryable_data': 'dropNonRetryableData' - } - - def __init__(self, id=None, name=None, description=None, org_id=None, remote_id=None, local_bucket_id=None, remote_bucket_id=None, remote_bucket_name=None, max_queue_size_bytes=None, current_queue_size_bytes=None, remaining_bytes_to_be_synced=None, latest_response_code=None, latest_error_message=None, drop_non_retryable_data=None): # noqa: E501,D401,D403 - """Replication - a model defined in OpenAPI.""" # noqa: E501 - self._id = None - self._name = None - self._description = None - self._org_id = None - self._remote_id = None - self._local_bucket_id = None - self._remote_bucket_id = None - self._remote_bucket_name = None - self._max_queue_size_bytes = None - self._current_queue_size_bytes = None - self._remaining_bytes_to_be_synced = None - self._latest_response_code = None - self._latest_error_message = None - self._drop_non_retryable_data = None - self.discriminator = None - - self.id = id - self.name = name - if description is not None: - self.description = description - self.org_id = org_id - self.remote_id = remote_id - self.local_bucket_id = local_bucket_id - if remote_bucket_id is not None: - self.remote_bucket_id = remote_bucket_id - if remote_bucket_name is not None: - self.remote_bucket_name = remote_bucket_name - self.max_queue_size_bytes = max_queue_size_bytes - if current_queue_size_bytes is not None: - self.current_queue_size_bytes = current_queue_size_bytes - if remaining_bytes_to_be_synced is not None: - self.remaining_bytes_to_be_synced = remaining_bytes_to_be_synced - if latest_response_code is not None: - self.latest_response_code = latest_response_code - if latest_error_message is not None: - self.latest_error_message = latest_error_message - if drop_non_retryable_data is not None: - self.drop_non_retryable_data = drop_non_retryable_data - - @property - def id(self): - """Get the id of this Replication. - - :return: The id of this Replication. - :rtype: str - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this Replication. - - :param id: The id of this Replication. - :type: str - """ # noqa: E501 - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 - self._id = id - - @property - def name(self): - """Get the name of this Replication. - - :return: The name of this Replication. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this Replication. - - :param name: The name of this Replication. - :type: str - """ # noqa: E501 - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - self._name = name - - @property - def description(self): - """Get the description of this Replication. - - :return: The description of this Replication. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this Replication. - - :param description: The description of this Replication. - :type: str - """ # noqa: E501 - self._description = description - - @property - def org_id(self): - """Get the org_id of this Replication. - - :return: The org_id of this Replication. - :rtype: str - """ # noqa: E501 - return self._org_id - - @org_id.setter - def org_id(self, org_id): - """Set the org_id of this Replication. - - :param org_id: The org_id of this Replication. - :type: str - """ # noqa: E501 - if org_id is None: - raise ValueError("Invalid value for `org_id`, must not be `None`") # noqa: E501 - self._org_id = org_id - - @property - def remote_id(self): - """Get the remote_id of this Replication. - - :return: The remote_id of this Replication. - :rtype: str - """ # noqa: E501 - return self._remote_id - - @remote_id.setter - def remote_id(self, remote_id): - """Set the remote_id of this Replication. - - :param remote_id: The remote_id of this Replication. - :type: str - """ # noqa: E501 - if remote_id is None: - raise ValueError("Invalid value for `remote_id`, must not be `None`") # noqa: E501 - self._remote_id = remote_id - - @property - def local_bucket_id(self): - """Get the local_bucket_id of this Replication. - - :return: The local_bucket_id of this Replication. - :rtype: str - """ # noqa: E501 - return self._local_bucket_id - - @local_bucket_id.setter - def local_bucket_id(self, local_bucket_id): - """Set the local_bucket_id of this Replication. - - :param local_bucket_id: The local_bucket_id of this Replication. - :type: str - """ # noqa: E501 - if local_bucket_id is None: - raise ValueError("Invalid value for `local_bucket_id`, must not be `None`") # noqa: E501 - self._local_bucket_id = local_bucket_id - - @property - def remote_bucket_id(self): - """Get the remote_bucket_id of this Replication. - - :return: The remote_bucket_id of this Replication. - :rtype: str - """ # noqa: E501 - return self._remote_bucket_id - - @remote_bucket_id.setter - def remote_bucket_id(self, remote_bucket_id): - """Set the remote_bucket_id of this Replication. - - :param remote_bucket_id: The remote_bucket_id of this Replication. - :type: str - """ # noqa: E501 - self._remote_bucket_id = remote_bucket_id - - @property - def remote_bucket_name(self): - """Get the remote_bucket_name of this Replication. - - :return: The remote_bucket_name of this Replication. - :rtype: str - """ # noqa: E501 - return self._remote_bucket_name - - @remote_bucket_name.setter - def remote_bucket_name(self, remote_bucket_name): - """Set the remote_bucket_name of this Replication. - - :param remote_bucket_name: The remote_bucket_name of this Replication. - :type: str - """ # noqa: E501 - self._remote_bucket_name = remote_bucket_name - - @property - def max_queue_size_bytes(self): - """Get the max_queue_size_bytes of this Replication. - - :return: The max_queue_size_bytes of this Replication. - :rtype: int - """ # noqa: E501 - return self._max_queue_size_bytes - - @max_queue_size_bytes.setter - def max_queue_size_bytes(self, max_queue_size_bytes): - """Set the max_queue_size_bytes of this Replication. - - :param max_queue_size_bytes: The max_queue_size_bytes of this Replication. - :type: int - """ # noqa: E501 - if max_queue_size_bytes is None: - raise ValueError("Invalid value for `max_queue_size_bytes`, must not be `None`") # noqa: E501 - self._max_queue_size_bytes = max_queue_size_bytes - - @property - def current_queue_size_bytes(self): - """Get the current_queue_size_bytes of this Replication. - - :return: The current_queue_size_bytes of this Replication. - :rtype: int - """ # noqa: E501 - return self._current_queue_size_bytes - - @current_queue_size_bytes.setter - def current_queue_size_bytes(self, current_queue_size_bytes): - """Set the current_queue_size_bytes of this Replication. - - :param current_queue_size_bytes: The current_queue_size_bytes of this Replication. - :type: int - """ # noqa: E501 - self._current_queue_size_bytes = current_queue_size_bytes - - @property - def remaining_bytes_to_be_synced(self): - """Get the remaining_bytes_to_be_synced of this Replication. - - :return: The remaining_bytes_to_be_synced of this Replication. - :rtype: int - """ # noqa: E501 - return self._remaining_bytes_to_be_synced - - @remaining_bytes_to_be_synced.setter - def remaining_bytes_to_be_synced(self, remaining_bytes_to_be_synced): - """Set the remaining_bytes_to_be_synced of this Replication. - - :param remaining_bytes_to_be_synced: The remaining_bytes_to_be_synced of this Replication. - :type: int - """ # noqa: E501 - self._remaining_bytes_to_be_synced = remaining_bytes_to_be_synced - - @property - def latest_response_code(self): - """Get the latest_response_code of this Replication. - - :return: The latest_response_code of this Replication. - :rtype: int - """ # noqa: E501 - return self._latest_response_code - - @latest_response_code.setter - def latest_response_code(self, latest_response_code): - """Set the latest_response_code of this Replication. - - :param latest_response_code: The latest_response_code of this Replication. - :type: int - """ # noqa: E501 - self._latest_response_code = latest_response_code - - @property - def latest_error_message(self): - """Get the latest_error_message of this Replication. - - :return: The latest_error_message of this Replication. - :rtype: str - """ # noqa: E501 - return self._latest_error_message - - @latest_error_message.setter - def latest_error_message(self, latest_error_message): - """Set the latest_error_message of this Replication. - - :param latest_error_message: The latest_error_message of this Replication. - :type: str - """ # noqa: E501 - self._latest_error_message = latest_error_message - - @property - def drop_non_retryable_data(self): - """Get the drop_non_retryable_data of this Replication. - - :return: The drop_non_retryable_data of this Replication. - :rtype: bool - """ # noqa: E501 - return self._drop_non_retryable_data - - @drop_non_retryable_data.setter - def drop_non_retryable_data(self, drop_non_retryable_data): - """Set the drop_non_retryable_data of this Replication. - - :param drop_non_retryable_data: The drop_non_retryable_data of this Replication. - :type: bool - """ # noqa: E501 - self._drop_non_retryable_data = drop_non_retryable_data - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Replication): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/replication_creation_request.py b/frogpilot/third_party/influxdb_client/domain/replication_creation_request.py deleted file mode 100644 index 946f2c96..00000000 --- a/frogpilot/third_party/influxdb_client/domain/replication_creation_request.py +++ /dev/null @@ -1,324 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class ReplicationCreationRequest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str', - 'description': 'str', - 'org_id': 'str', - 'remote_id': 'str', - 'local_bucket_id': 'str', - 'remote_bucket_id': 'str', - 'remote_bucket_name': 'str', - 'max_queue_size_bytes': 'int', - 'drop_non_retryable_data': 'bool', - 'max_age_seconds': 'int' - } - - attribute_map = { - 'name': 'name', - 'description': 'description', - 'org_id': 'orgID', - 'remote_id': 'remoteID', - 'local_bucket_id': 'localBucketID', - 'remote_bucket_id': 'remoteBucketID', - 'remote_bucket_name': 'remoteBucketName', - 'max_queue_size_bytes': 'maxQueueSizeBytes', - 'drop_non_retryable_data': 'dropNonRetryableData', - 'max_age_seconds': 'maxAgeSeconds' - } - - def __init__(self, name=None, description=None, org_id=None, remote_id=None, local_bucket_id=None, remote_bucket_id=None, remote_bucket_name=None, max_queue_size_bytes=67108860, drop_non_retryable_data=False, max_age_seconds=604800): # noqa: E501,D401,D403 - """ReplicationCreationRequest - a model defined in OpenAPI.""" # noqa: E501 - self._name = None - self._description = None - self._org_id = None - self._remote_id = None - self._local_bucket_id = None - self._remote_bucket_id = None - self._remote_bucket_name = None - self._max_queue_size_bytes = None - self._drop_non_retryable_data = None - self._max_age_seconds = None - self.discriminator = None - - self.name = name - if description is not None: - self.description = description - self.org_id = org_id - self.remote_id = remote_id - self.local_bucket_id = local_bucket_id - if remote_bucket_id is not None: - self.remote_bucket_id = remote_bucket_id - if remote_bucket_name is not None: - self.remote_bucket_name = remote_bucket_name - self.max_queue_size_bytes = max_queue_size_bytes - if drop_non_retryable_data is not None: - self.drop_non_retryable_data = drop_non_retryable_data - self.max_age_seconds = max_age_seconds - - @property - def name(self): - """Get the name of this ReplicationCreationRequest. - - :return: The name of this ReplicationCreationRequest. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this ReplicationCreationRequest. - - :param name: The name of this ReplicationCreationRequest. - :type: str - """ # noqa: E501 - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - self._name = name - - @property - def description(self): - """Get the description of this ReplicationCreationRequest. - - :return: The description of this ReplicationCreationRequest. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this ReplicationCreationRequest. - - :param description: The description of this ReplicationCreationRequest. - :type: str - """ # noqa: E501 - self._description = description - - @property - def org_id(self): - """Get the org_id of this ReplicationCreationRequest. - - :return: The org_id of this ReplicationCreationRequest. - :rtype: str - """ # noqa: E501 - return self._org_id - - @org_id.setter - def org_id(self, org_id): - """Set the org_id of this ReplicationCreationRequest. - - :param org_id: The org_id of this ReplicationCreationRequest. - :type: str - """ # noqa: E501 - if org_id is None: - raise ValueError("Invalid value for `org_id`, must not be `None`") # noqa: E501 - self._org_id = org_id - - @property - def remote_id(self): - """Get the remote_id of this ReplicationCreationRequest. - - :return: The remote_id of this ReplicationCreationRequest. - :rtype: str - """ # noqa: E501 - return self._remote_id - - @remote_id.setter - def remote_id(self, remote_id): - """Set the remote_id of this ReplicationCreationRequest. - - :param remote_id: The remote_id of this ReplicationCreationRequest. - :type: str - """ # noqa: E501 - if remote_id is None: - raise ValueError("Invalid value for `remote_id`, must not be `None`") # noqa: E501 - self._remote_id = remote_id - - @property - def local_bucket_id(self): - """Get the local_bucket_id of this ReplicationCreationRequest. - - :return: The local_bucket_id of this ReplicationCreationRequest. - :rtype: str - """ # noqa: E501 - return self._local_bucket_id - - @local_bucket_id.setter - def local_bucket_id(self, local_bucket_id): - """Set the local_bucket_id of this ReplicationCreationRequest. - - :param local_bucket_id: The local_bucket_id of this ReplicationCreationRequest. - :type: str - """ # noqa: E501 - if local_bucket_id is None: - raise ValueError("Invalid value for `local_bucket_id`, must not be `None`") # noqa: E501 - self._local_bucket_id = local_bucket_id - - @property - def remote_bucket_id(self): - """Get the remote_bucket_id of this ReplicationCreationRequest. - - :return: The remote_bucket_id of this ReplicationCreationRequest. - :rtype: str - """ # noqa: E501 - return self._remote_bucket_id - - @remote_bucket_id.setter - def remote_bucket_id(self, remote_bucket_id): - """Set the remote_bucket_id of this ReplicationCreationRequest. - - :param remote_bucket_id: The remote_bucket_id of this ReplicationCreationRequest. - :type: str - """ # noqa: E501 - self._remote_bucket_id = remote_bucket_id - - @property - def remote_bucket_name(self): - """Get the remote_bucket_name of this ReplicationCreationRequest. - - :return: The remote_bucket_name of this ReplicationCreationRequest. - :rtype: str - """ # noqa: E501 - return self._remote_bucket_name - - @remote_bucket_name.setter - def remote_bucket_name(self, remote_bucket_name): - """Set the remote_bucket_name of this ReplicationCreationRequest. - - :param remote_bucket_name: The remote_bucket_name of this ReplicationCreationRequest. - :type: str - """ # noqa: E501 - self._remote_bucket_name = remote_bucket_name - - @property - def max_queue_size_bytes(self): - """Get the max_queue_size_bytes of this ReplicationCreationRequest. - - :return: The max_queue_size_bytes of this ReplicationCreationRequest. - :rtype: int - """ # noqa: E501 - return self._max_queue_size_bytes - - @max_queue_size_bytes.setter - def max_queue_size_bytes(self, max_queue_size_bytes): - """Set the max_queue_size_bytes of this ReplicationCreationRequest. - - :param max_queue_size_bytes: The max_queue_size_bytes of this ReplicationCreationRequest. - :type: int - """ # noqa: E501 - if max_queue_size_bytes is None: - raise ValueError("Invalid value for `max_queue_size_bytes`, must not be `None`") # noqa: E501 - if max_queue_size_bytes is not None and max_queue_size_bytes < 33554430: # noqa: E501 - raise ValueError("Invalid value for `max_queue_size_bytes`, must be a value greater than or equal to `33554430`") # noqa: E501 - self._max_queue_size_bytes = max_queue_size_bytes - - @property - def drop_non_retryable_data(self): - """Get the drop_non_retryable_data of this ReplicationCreationRequest. - - :return: The drop_non_retryable_data of this ReplicationCreationRequest. - :rtype: bool - """ # noqa: E501 - return self._drop_non_retryable_data - - @drop_non_retryable_data.setter - def drop_non_retryable_data(self, drop_non_retryable_data): - """Set the drop_non_retryable_data of this ReplicationCreationRequest. - - :param drop_non_retryable_data: The drop_non_retryable_data of this ReplicationCreationRequest. - :type: bool - """ # noqa: E501 - self._drop_non_retryable_data = drop_non_retryable_data - - @property - def max_age_seconds(self): - """Get the max_age_seconds of this ReplicationCreationRequest. - - :return: The max_age_seconds of this ReplicationCreationRequest. - :rtype: int - """ # noqa: E501 - return self._max_age_seconds - - @max_age_seconds.setter - def max_age_seconds(self, max_age_seconds): - """Set the max_age_seconds of this ReplicationCreationRequest. - - :param max_age_seconds: The max_age_seconds of this ReplicationCreationRequest. - :type: int - """ # noqa: E501 - if max_age_seconds is None: - raise ValueError("Invalid value for `max_age_seconds`, must not be `None`") # noqa: E501 - if max_age_seconds is not None and max_age_seconds < 0: # noqa: E501 - raise ValueError("Invalid value for `max_age_seconds`, must be a value greater than or equal to `0`") # noqa: E501 - self._max_age_seconds = max_age_seconds - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, ReplicationCreationRequest): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/replication_update_request.py b/frogpilot/third_party/influxdb_client/domain/replication_update_request.py deleted file mode 100644 index 0c40c117..00000000 --- a/frogpilot/third_party/influxdb_client/domain/replication_update_request.py +++ /dev/null @@ -1,272 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class ReplicationUpdateRequest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str', - 'description': 'str', - 'remote_id': 'str', - 'remote_bucket_id': 'str', - 'remote_bucket_name': 'str', - 'max_queue_size_bytes': 'int', - 'drop_non_retryable_data': 'bool', - 'max_age_seconds': 'int' - } - - attribute_map = { - 'name': 'name', - 'description': 'description', - 'remote_id': 'remoteID', - 'remote_bucket_id': 'remoteBucketID', - 'remote_bucket_name': 'remoteBucketName', - 'max_queue_size_bytes': 'maxQueueSizeBytes', - 'drop_non_retryable_data': 'dropNonRetryableData', - 'max_age_seconds': 'maxAgeSeconds' - } - - def __init__(self, name=None, description=None, remote_id=None, remote_bucket_id=None, remote_bucket_name=None, max_queue_size_bytes=None, drop_non_retryable_data=None, max_age_seconds=None): # noqa: E501,D401,D403 - """ReplicationUpdateRequest - a model defined in OpenAPI.""" # noqa: E501 - self._name = None - self._description = None - self._remote_id = None - self._remote_bucket_id = None - self._remote_bucket_name = None - self._max_queue_size_bytes = None - self._drop_non_retryable_data = None - self._max_age_seconds = None - self.discriminator = None - - if name is not None: - self.name = name - if description is not None: - self.description = description - if remote_id is not None: - self.remote_id = remote_id - if remote_bucket_id is not None: - self.remote_bucket_id = remote_bucket_id - if remote_bucket_name is not None: - self.remote_bucket_name = remote_bucket_name - if max_queue_size_bytes is not None: - self.max_queue_size_bytes = max_queue_size_bytes - if drop_non_retryable_data is not None: - self.drop_non_retryable_data = drop_non_retryable_data - if max_age_seconds is not None: - self.max_age_seconds = max_age_seconds - - @property - def name(self): - """Get the name of this ReplicationUpdateRequest. - - :return: The name of this ReplicationUpdateRequest. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this ReplicationUpdateRequest. - - :param name: The name of this ReplicationUpdateRequest. - :type: str - """ # noqa: E501 - self._name = name - - @property - def description(self): - """Get the description of this ReplicationUpdateRequest. - - :return: The description of this ReplicationUpdateRequest. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this ReplicationUpdateRequest. - - :param description: The description of this ReplicationUpdateRequest. - :type: str - """ # noqa: E501 - self._description = description - - @property - def remote_id(self): - """Get the remote_id of this ReplicationUpdateRequest. - - :return: The remote_id of this ReplicationUpdateRequest. - :rtype: str - """ # noqa: E501 - return self._remote_id - - @remote_id.setter - def remote_id(self, remote_id): - """Set the remote_id of this ReplicationUpdateRequest. - - :param remote_id: The remote_id of this ReplicationUpdateRequest. - :type: str - """ # noqa: E501 - self._remote_id = remote_id - - @property - def remote_bucket_id(self): - """Get the remote_bucket_id of this ReplicationUpdateRequest. - - :return: The remote_bucket_id of this ReplicationUpdateRequest. - :rtype: str - """ # noqa: E501 - return self._remote_bucket_id - - @remote_bucket_id.setter - def remote_bucket_id(self, remote_bucket_id): - """Set the remote_bucket_id of this ReplicationUpdateRequest. - - :param remote_bucket_id: The remote_bucket_id of this ReplicationUpdateRequest. - :type: str - """ # noqa: E501 - self._remote_bucket_id = remote_bucket_id - - @property - def remote_bucket_name(self): - """Get the remote_bucket_name of this ReplicationUpdateRequest. - - :return: The remote_bucket_name of this ReplicationUpdateRequest. - :rtype: str - """ # noqa: E501 - return self._remote_bucket_name - - @remote_bucket_name.setter - def remote_bucket_name(self, remote_bucket_name): - """Set the remote_bucket_name of this ReplicationUpdateRequest. - - :param remote_bucket_name: The remote_bucket_name of this ReplicationUpdateRequest. - :type: str - """ # noqa: E501 - self._remote_bucket_name = remote_bucket_name - - @property - def max_queue_size_bytes(self): - """Get the max_queue_size_bytes of this ReplicationUpdateRequest. - - :return: The max_queue_size_bytes of this ReplicationUpdateRequest. - :rtype: int - """ # noqa: E501 - return self._max_queue_size_bytes - - @max_queue_size_bytes.setter - def max_queue_size_bytes(self, max_queue_size_bytes): - """Set the max_queue_size_bytes of this ReplicationUpdateRequest. - - :param max_queue_size_bytes: The max_queue_size_bytes of this ReplicationUpdateRequest. - :type: int - """ # noqa: E501 - if max_queue_size_bytes is not None and max_queue_size_bytes < 33554430: # noqa: E501 - raise ValueError("Invalid value for `max_queue_size_bytes`, must be a value greater than or equal to `33554430`") # noqa: E501 - self._max_queue_size_bytes = max_queue_size_bytes - - @property - def drop_non_retryable_data(self): - """Get the drop_non_retryable_data of this ReplicationUpdateRequest. - - :return: The drop_non_retryable_data of this ReplicationUpdateRequest. - :rtype: bool - """ # noqa: E501 - return self._drop_non_retryable_data - - @drop_non_retryable_data.setter - def drop_non_retryable_data(self, drop_non_retryable_data): - """Set the drop_non_retryable_data of this ReplicationUpdateRequest. - - :param drop_non_retryable_data: The drop_non_retryable_data of this ReplicationUpdateRequest. - :type: bool - """ # noqa: E501 - self._drop_non_retryable_data = drop_non_retryable_data - - @property - def max_age_seconds(self): - """Get the max_age_seconds of this ReplicationUpdateRequest. - - :return: The max_age_seconds of this ReplicationUpdateRequest. - :rtype: int - """ # noqa: E501 - return self._max_age_seconds - - @max_age_seconds.setter - def max_age_seconds(self, max_age_seconds): - """Set the max_age_seconds of this ReplicationUpdateRequest. - - :param max_age_seconds: The max_age_seconds of this ReplicationUpdateRequest. - :type: int - """ # noqa: E501 - if max_age_seconds is not None and max_age_seconds < 0: # noqa: E501 - raise ValueError("Invalid value for `max_age_seconds`, must be a value greater than or equal to `0`") # noqa: E501 - self._max_age_seconds = max_age_seconds - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, ReplicationUpdateRequest): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/replications.py b/frogpilot/third_party/influxdb_client/domain/replications.py deleted file mode 100644 index d81cd453..00000000 --- a/frogpilot/third_party/influxdb_client/domain/replications.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class Replications(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'replications': 'list[Replication]' - } - - attribute_map = { - 'replications': 'replications' - } - - def __init__(self, replications=None): # noqa: E501,D401,D403 - """Replications - a model defined in OpenAPI.""" # noqa: E501 - self._replications = None - self.discriminator = None - - if replications is not None: - self.replications = replications - - @property - def replications(self): - """Get the replications of this Replications. - - :return: The replications of this Replications. - :rtype: list[Replication] - """ # noqa: E501 - return self._replications - - @replications.setter - def replications(self, replications): - """Set the replications of this Replications. - - :param replications: The replications of this Replications. - :type: list[Replication] - """ # noqa: E501 - self._replications = replications - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Replications): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/resource_member.py b/frogpilot/third_party/influxdb_client/domain/resource_member.py deleted file mode 100644 index 26e26d73..00000000 --- a/frogpilot/third_party/influxdb_client/domain/resource_member.py +++ /dev/null @@ -1,119 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.user_response import UserResponse - - -class ResourceMember(UserResponse): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'role': 'str', - 'id': 'str', - 'name': 'str', - 'status': 'str', - 'links': 'UserResponseLinks' - } - - attribute_map = { - 'role': 'role', - 'id': 'id', - 'name': 'name', - 'status': 'status', - 'links': 'links' - } - - def __init__(self, role='member', id=None, name=None, status='active', links=None): # noqa: E501,D401,D403 - """ResourceMember - a model defined in OpenAPI.""" # noqa: E501 - UserResponse.__init__(self, id=id, name=name, status=status, links=links) # noqa: E501 - - self._role = None - self.discriminator = None - - if role is not None: - self.role = role - - @property - def role(self): - """Get the role of this ResourceMember. - - :return: The role of this ResourceMember. - :rtype: str - """ # noqa: E501 - return self._role - - @role.setter - def role(self, role): - """Set the role of this ResourceMember. - - :param role: The role of this ResourceMember. - :type: str - """ # noqa: E501 - self._role = role - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, ResourceMember): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/resource_members.py b/frogpilot/third_party/influxdb_client/domain/resource_members.py deleted file mode 100644 index 5fde29a9..00000000 --- a/frogpilot/third_party/influxdb_client/domain/resource_members.py +++ /dev/null @@ -1,130 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class ResourceMembers(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'links': 'ResourceMembersLinks', - 'users': 'list[ResourceMember]' - } - - attribute_map = { - 'links': 'links', - 'users': 'users' - } - - def __init__(self, links=None, users=None): # noqa: E501,D401,D403 - """ResourceMembers - a model defined in OpenAPI.""" # noqa: E501 - self._links = None - self._users = None - self.discriminator = None - - if links is not None: - self.links = links - if users is not None: - self.users = users - - @property - def links(self): - """Get the links of this ResourceMembers. - - :return: The links of this ResourceMembers. - :rtype: ResourceMembersLinks - """ # noqa: E501 - return self._links - - @links.setter - def links(self, links): - """Set the links of this ResourceMembers. - - :param links: The links of this ResourceMembers. - :type: ResourceMembersLinks - """ # noqa: E501 - self._links = links - - @property - def users(self): - """Get the users of this ResourceMembers. - - :return: The users of this ResourceMembers. - :rtype: list[ResourceMember] - """ # noqa: E501 - return self._users - - @users.setter - def users(self, users): - """Set the users of this ResourceMembers. - - :param users: The users of this ResourceMembers. - :type: list[ResourceMember] - """ # noqa: E501 - self._users = users - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, ResourceMembers): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/resource_members_links.py b/frogpilot/third_party/influxdb_client/domain/resource_members_links.py deleted file mode 100644 index 26820bb5..00000000 --- a/frogpilot/third_party/influxdb_client/domain/resource_members_links.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class ResourceMembersLinks(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - '_self': 'str' - } - - attribute_map = { - '_self': 'self' - } - - def __init__(self, _self=None): # noqa: E501,D401,D403 - """ResourceMembersLinks - a model defined in OpenAPI.""" # noqa: E501 - self.__self = None - self.discriminator = None - - if _self is not None: - self._self = _self - - @property - def _self(self): - """Get the _self of this ResourceMembersLinks. - - :return: The _self of this ResourceMembersLinks. - :rtype: str - """ # noqa: E501 - return self.__self - - @_self.setter - def _self(self, _self): - """Set the _self of this ResourceMembersLinks. - - :param _self: The _self of this ResourceMembersLinks. - :type: str - """ # noqa: E501 - self.__self = _self - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, ResourceMembersLinks): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/resource_owner.py b/frogpilot/third_party/influxdb_client/domain/resource_owner.py deleted file mode 100644 index 2f73cd7b..00000000 --- a/frogpilot/third_party/influxdb_client/domain/resource_owner.py +++ /dev/null @@ -1,119 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.user_response import UserResponse - - -class ResourceOwner(UserResponse): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'role': 'str', - 'id': 'str', - 'name': 'str', - 'status': 'str', - 'links': 'UserResponseLinks' - } - - attribute_map = { - 'role': 'role', - 'id': 'id', - 'name': 'name', - 'status': 'status', - 'links': 'links' - } - - def __init__(self, role='owner', id=None, name=None, status='active', links=None): # noqa: E501,D401,D403 - """ResourceOwner - a model defined in OpenAPI.""" # noqa: E501 - UserResponse.__init__(self, id=id, name=name, status=status, links=links) # noqa: E501 - - self._role = None - self.discriminator = None - - if role is not None: - self.role = role - - @property - def role(self): - """Get the role of this ResourceOwner. - - :return: The role of this ResourceOwner. - :rtype: str - """ # noqa: E501 - return self._role - - @role.setter - def role(self, role): - """Set the role of this ResourceOwner. - - :param role: The role of this ResourceOwner. - :type: str - """ # noqa: E501 - self._role = role - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, ResourceOwner): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/resource_owners.py b/frogpilot/third_party/influxdb_client/domain/resource_owners.py deleted file mode 100644 index 84a85ff6..00000000 --- a/frogpilot/third_party/influxdb_client/domain/resource_owners.py +++ /dev/null @@ -1,130 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class ResourceOwners(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'links': 'ResourceMembersLinks', - 'users': 'list[ResourceOwner]' - } - - attribute_map = { - 'links': 'links', - 'users': 'users' - } - - def __init__(self, links=None, users=None): # noqa: E501,D401,D403 - """ResourceOwners - a model defined in OpenAPI.""" # noqa: E501 - self._links = None - self._users = None - self.discriminator = None - - if links is not None: - self.links = links - if users is not None: - self.users = users - - @property - def links(self): - """Get the links of this ResourceOwners. - - :return: The links of this ResourceOwners. - :rtype: ResourceMembersLinks - """ # noqa: E501 - return self._links - - @links.setter - def links(self, links): - """Set the links of this ResourceOwners. - - :param links: The links of this ResourceOwners. - :type: ResourceMembersLinks - """ # noqa: E501 - self._links = links - - @property - def users(self): - """Get the users of this ResourceOwners. - - :return: The users of this ResourceOwners. - :rtype: list[ResourceOwner] - """ # noqa: E501 - return self._users - - @users.setter - def users(self, users): - """Set the users of this ResourceOwners. - - :param users: The users of this ResourceOwners. - :type: list[ResourceOwner] - """ # noqa: E501 - self._users = users - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, ResourceOwners): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/restored_bucket_mappings.py b/frogpilot/third_party/influxdb_client/domain/restored_bucket_mappings.py deleted file mode 100644 index 2059cbc8..00000000 --- a/frogpilot/third_party/influxdb_client/domain/restored_bucket_mappings.py +++ /dev/null @@ -1,160 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class RestoredBucketMappings(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'str', - 'name': 'str', - 'shard_mappings': 'list[BucketShardMapping]' - } - - attribute_map = { - 'id': 'id', - 'name': 'name', - 'shard_mappings': 'shardMappings' - } - - def __init__(self, id=None, name=None, shard_mappings=None): # noqa: E501,D401,D403 - """RestoredBucketMappings - a model defined in OpenAPI.""" # noqa: E501 - self._id = None - self._name = None - self._shard_mappings = None - self.discriminator = None - - self.id = id - self.name = name - self.shard_mappings = shard_mappings - - @property - def id(self): - """Get the id of this RestoredBucketMappings. - - New ID of the restored bucket - - :return: The id of this RestoredBucketMappings. - :rtype: str - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this RestoredBucketMappings. - - New ID of the restored bucket - - :param id: The id of this RestoredBucketMappings. - :type: str - """ # noqa: E501 - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 - self._id = id - - @property - def name(self): - """Get the name of this RestoredBucketMappings. - - :return: The name of this RestoredBucketMappings. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this RestoredBucketMappings. - - :param name: The name of this RestoredBucketMappings. - :type: str - """ # noqa: E501 - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - self._name = name - - @property - def shard_mappings(self): - """Get the shard_mappings of this RestoredBucketMappings. - - :return: The shard_mappings of this RestoredBucketMappings. - :rtype: list[BucketShardMapping] - """ # noqa: E501 - return self._shard_mappings - - @shard_mappings.setter - def shard_mappings(self, shard_mappings): - """Set the shard_mappings of this RestoredBucketMappings. - - :param shard_mappings: The shard_mappings of this RestoredBucketMappings. - :type: list[BucketShardMapping] - """ # noqa: E501 - if shard_mappings is None: - raise ValueError("Invalid value for `shard_mappings`, must not be `None`") # noqa: E501 - self._shard_mappings = shard_mappings - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, RestoredBucketMappings): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/retention_policy_manifest.py b/frogpilot/third_party/influxdb_client/domain/retention_policy_manifest.py deleted file mode 100644 index a0b314c8..00000000 --- a/frogpilot/third_party/influxdb_client/domain/retention_policy_manifest.py +++ /dev/null @@ -1,228 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class RetentionPolicyManifest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str', - 'replica_n': 'int', - 'duration': 'int', - 'shard_group_duration': 'int', - 'shard_groups': 'list[ShardGroupManifest]', - 'subscriptions': 'list[SubscriptionManifest]' - } - - attribute_map = { - 'name': 'name', - 'replica_n': 'replicaN', - 'duration': 'duration', - 'shard_group_duration': 'shardGroupDuration', - 'shard_groups': 'shardGroups', - 'subscriptions': 'subscriptions' - } - - def __init__(self, name=None, replica_n=None, duration=None, shard_group_duration=None, shard_groups=None, subscriptions=None): # noqa: E501,D401,D403 - """RetentionPolicyManifest - a model defined in OpenAPI.""" # noqa: E501 - self._name = None - self._replica_n = None - self._duration = None - self._shard_group_duration = None - self._shard_groups = None - self._subscriptions = None - self.discriminator = None - - self.name = name - self.replica_n = replica_n - self.duration = duration - self.shard_group_duration = shard_group_duration - self.shard_groups = shard_groups - self.subscriptions = subscriptions - - @property - def name(self): - """Get the name of this RetentionPolicyManifest. - - :return: The name of this RetentionPolicyManifest. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this RetentionPolicyManifest. - - :param name: The name of this RetentionPolicyManifest. - :type: str - """ # noqa: E501 - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - self._name = name - - @property - def replica_n(self): - """Get the replica_n of this RetentionPolicyManifest. - - :return: The replica_n of this RetentionPolicyManifest. - :rtype: int - """ # noqa: E501 - return self._replica_n - - @replica_n.setter - def replica_n(self, replica_n): - """Set the replica_n of this RetentionPolicyManifest. - - :param replica_n: The replica_n of this RetentionPolicyManifest. - :type: int - """ # noqa: E501 - if replica_n is None: - raise ValueError("Invalid value for `replica_n`, must not be `None`") # noqa: E501 - self._replica_n = replica_n - - @property - def duration(self): - """Get the duration of this RetentionPolicyManifest. - - :return: The duration of this RetentionPolicyManifest. - :rtype: int - """ # noqa: E501 - return self._duration - - @duration.setter - def duration(self, duration): - """Set the duration of this RetentionPolicyManifest. - - :param duration: The duration of this RetentionPolicyManifest. - :type: int - """ # noqa: E501 - if duration is None: - raise ValueError("Invalid value for `duration`, must not be `None`") # noqa: E501 - self._duration = duration - - @property - def shard_group_duration(self): - """Get the shard_group_duration of this RetentionPolicyManifest. - - :return: The shard_group_duration of this RetentionPolicyManifest. - :rtype: int - """ # noqa: E501 - return self._shard_group_duration - - @shard_group_duration.setter - def shard_group_duration(self, shard_group_duration): - """Set the shard_group_duration of this RetentionPolicyManifest. - - :param shard_group_duration: The shard_group_duration of this RetentionPolicyManifest. - :type: int - """ # noqa: E501 - if shard_group_duration is None: - raise ValueError("Invalid value for `shard_group_duration`, must not be `None`") # noqa: E501 - self._shard_group_duration = shard_group_duration - - @property - def shard_groups(self): - """Get the shard_groups of this RetentionPolicyManifest. - - :return: The shard_groups of this RetentionPolicyManifest. - :rtype: list[ShardGroupManifest] - """ # noqa: E501 - return self._shard_groups - - @shard_groups.setter - def shard_groups(self, shard_groups): - """Set the shard_groups of this RetentionPolicyManifest. - - :param shard_groups: The shard_groups of this RetentionPolicyManifest. - :type: list[ShardGroupManifest] - """ # noqa: E501 - if shard_groups is None: - raise ValueError("Invalid value for `shard_groups`, must not be `None`") # noqa: E501 - self._shard_groups = shard_groups - - @property - def subscriptions(self): - """Get the subscriptions of this RetentionPolicyManifest. - - :return: The subscriptions of this RetentionPolicyManifest. - :rtype: list[SubscriptionManifest] - """ # noqa: E501 - return self._subscriptions - - @subscriptions.setter - def subscriptions(self, subscriptions): - """Set the subscriptions of this RetentionPolicyManifest. - - :param subscriptions: The subscriptions of this RetentionPolicyManifest. - :type: list[SubscriptionManifest] - """ # noqa: E501 - if subscriptions is None: - raise ValueError("Invalid value for `subscriptions`, must not be `None`") # noqa: E501 - self._subscriptions = subscriptions - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, RetentionPolicyManifest): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/return_statement.py b/frogpilot/third_party/influxdb_client/domain/return_statement.py deleted file mode 100644 index aa4b48d9..00000000 --- a/frogpilot/third_party/influxdb_client/domain/return_statement.py +++ /dev/null @@ -1,138 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.statement import Statement - - -class ReturnStatement(Statement): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'argument': 'Expression' - } - - attribute_map = { - 'type': 'type', - 'argument': 'argument' - } - - def __init__(self, type=None, argument=None): # noqa: E501,D401,D403 - """ReturnStatement - a model defined in OpenAPI.""" # noqa: E501 - Statement.__init__(self) # noqa: E501 - - self._type = None - self._argument = None - self.discriminator = None - - if type is not None: - self.type = type - if argument is not None: - self.argument = argument - - @property - def type(self): - """Get the type of this ReturnStatement. - - Type of AST node - - :return: The type of this ReturnStatement. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this ReturnStatement. - - Type of AST node - - :param type: The type of this ReturnStatement. - :type: str - """ # noqa: E501 - self._type = type - - @property - def argument(self): - """Get the argument of this ReturnStatement. - - :return: The argument of this ReturnStatement. - :rtype: Expression - """ # noqa: E501 - return self._argument - - @argument.setter - def argument(self, argument): - """Set the argument of this ReturnStatement. - - :param argument: The argument of this ReturnStatement. - :type: Expression - """ # noqa: E501 - self._argument = argument - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, ReturnStatement): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/routes.py b/frogpilot/third_party/influxdb_client/domain/routes.py deleted file mode 100644 index 2a7a77e6..00000000 --- a/frogpilot/third_party/influxdb_client/domain/routes.py +++ /dev/null @@ -1,498 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class Routes(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'authorizations': 'str', - 'buckets': 'str', - 'dashboards': 'str', - 'external': 'RoutesExternal', - 'variables': 'str', - 'me': 'str', - 'flags': 'str', - 'orgs': 'str', - 'query': 'RoutesQuery', - 'setup': 'str', - 'signin': 'str', - 'signout': 'str', - 'sources': 'str', - 'system': 'RoutesSystem', - 'tasks': 'str', - 'telegrafs': 'str', - 'users': 'str', - 'write': 'str' - } - - attribute_map = { - 'authorizations': 'authorizations', - 'buckets': 'buckets', - 'dashboards': 'dashboards', - 'external': 'external', - 'variables': 'variables', - 'me': 'me', - 'flags': 'flags', - 'orgs': 'orgs', - 'query': 'query', - 'setup': 'setup', - 'signin': 'signin', - 'signout': 'signout', - 'sources': 'sources', - 'system': 'system', - 'tasks': 'tasks', - 'telegrafs': 'telegrafs', - 'users': 'users', - 'write': 'write' - } - - def __init__(self, authorizations=None, buckets=None, dashboards=None, external=None, variables=None, me=None, flags=None, orgs=None, query=None, setup=None, signin=None, signout=None, sources=None, system=None, tasks=None, telegrafs=None, users=None, write=None): # noqa: E501,D401,D403 - """Routes - a model defined in OpenAPI.""" # noqa: E501 - self._authorizations = None - self._buckets = None - self._dashboards = None - self._external = None - self._variables = None - self._me = None - self._flags = None - self._orgs = None - self._query = None - self._setup = None - self._signin = None - self._signout = None - self._sources = None - self._system = None - self._tasks = None - self._telegrafs = None - self._users = None - self._write = None - self.discriminator = None - - if authorizations is not None: - self.authorizations = authorizations - if buckets is not None: - self.buckets = buckets - if dashboards is not None: - self.dashboards = dashboards - if external is not None: - self.external = external - if variables is not None: - self.variables = variables - if me is not None: - self.me = me - if flags is not None: - self.flags = flags - if orgs is not None: - self.orgs = orgs - if query is not None: - self.query = query - if setup is not None: - self.setup = setup - if signin is not None: - self.signin = signin - if signout is not None: - self.signout = signout - if sources is not None: - self.sources = sources - if system is not None: - self.system = system - if tasks is not None: - self.tasks = tasks - if telegrafs is not None: - self.telegrafs = telegrafs - if users is not None: - self.users = users - if write is not None: - self.write = write - - @property - def authorizations(self): - """Get the authorizations of this Routes. - - :return: The authorizations of this Routes. - :rtype: str - """ # noqa: E501 - return self._authorizations - - @authorizations.setter - def authorizations(self, authorizations): - """Set the authorizations of this Routes. - - :param authorizations: The authorizations of this Routes. - :type: str - """ # noqa: E501 - self._authorizations = authorizations - - @property - def buckets(self): - """Get the buckets of this Routes. - - :return: The buckets of this Routes. - :rtype: str - """ # noqa: E501 - return self._buckets - - @buckets.setter - def buckets(self, buckets): - """Set the buckets of this Routes. - - :param buckets: The buckets of this Routes. - :type: str - """ # noqa: E501 - self._buckets = buckets - - @property - def dashboards(self): - """Get the dashboards of this Routes. - - :return: The dashboards of this Routes. - :rtype: str - """ # noqa: E501 - return self._dashboards - - @dashboards.setter - def dashboards(self, dashboards): - """Set the dashboards of this Routes. - - :param dashboards: The dashboards of this Routes. - :type: str - """ # noqa: E501 - self._dashboards = dashboards - - @property - def external(self): - """Get the external of this Routes. - - :return: The external of this Routes. - :rtype: RoutesExternal - """ # noqa: E501 - return self._external - - @external.setter - def external(self, external): - """Set the external of this Routes. - - :param external: The external of this Routes. - :type: RoutesExternal - """ # noqa: E501 - self._external = external - - @property - def variables(self): - """Get the variables of this Routes. - - :return: The variables of this Routes. - :rtype: str - """ # noqa: E501 - return self._variables - - @variables.setter - def variables(self, variables): - """Set the variables of this Routes. - - :param variables: The variables of this Routes. - :type: str - """ # noqa: E501 - self._variables = variables - - @property - def me(self): - """Get the me of this Routes. - - :return: The me of this Routes. - :rtype: str - """ # noqa: E501 - return self._me - - @me.setter - def me(self, me): - """Set the me of this Routes. - - :param me: The me of this Routes. - :type: str - """ # noqa: E501 - self._me = me - - @property - def flags(self): - """Get the flags of this Routes. - - :return: The flags of this Routes. - :rtype: str - """ # noqa: E501 - return self._flags - - @flags.setter - def flags(self, flags): - """Set the flags of this Routes. - - :param flags: The flags of this Routes. - :type: str - """ # noqa: E501 - self._flags = flags - - @property - def orgs(self): - """Get the orgs of this Routes. - - :return: The orgs of this Routes. - :rtype: str - """ # noqa: E501 - return self._orgs - - @orgs.setter - def orgs(self, orgs): - """Set the orgs of this Routes. - - :param orgs: The orgs of this Routes. - :type: str - """ # noqa: E501 - self._orgs = orgs - - @property - def query(self): - """Get the query of this Routes. - - :return: The query of this Routes. - :rtype: RoutesQuery - """ # noqa: E501 - return self._query - - @query.setter - def query(self, query): - """Set the query of this Routes. - - :param query: The query of this Routes. - :type: RoutesQuery - """ # noqa: E501 - self._query = query - - @property - def setup(self): - """Get the setup of this Routes. - - :return: The setup of this Routes. - :rtype: str - """ # noqa: E501 - return self._setup - - @setup.setter - def setup(self, setup): - """Set the setup of this Routes. - - :param setup: The setup of this Routes. - :type: str - """ # noqa: E501 - self._setup = setup - - @property - def signin(self): - """Get the signin of this Routes. - - :return: The signin of this Routes. - :rtype: str - """ # noqa: E501 - return self._signin - - @signin.setter - def signin(self, signin): - """Set the signin of this Routes. - - :param signin: The signin of this Routes. - :type: str - """ # noqa: E501 - self._signin = signin - - @property - def signout(self): - """Get the signout of this Routes. - - :return: The signout of this Routes. - :rtype: str - """ # noqa: E501 - return self._signout - - @signout.setter - def signout(self, signout): - """Set the signout of this Routes. - - :param signout: The signout of this Routes. - :type: str - """ # noqa: E501 - self._signout = signout - - @property - def sources(self): - """Get the sources of this Routes. - - :return: The sources of this Routes. - :rtype: str - """ # noqa: E501 - return self._sources - - @sources.setter - def sources(self, sources): - """Set the sources of this Routes. - - :param sources: The sources of this Routes. - :type: str - """ # noqa: E501 - self._sources = sources - - @property - def system(self): - """Get the system of this Routes. - - :return: The system of this Routes. - :rtype: RoutesSystem - """ # noqa: E501 - return self._system - - @system.setter - def system(self, system): - """Set the system of this Routes. - - :param system: The system of this Routes. - :type: RoutesSystem - """ # noqa: E501 - self._system = system - - @property - def tasks(self): - """Get the tasks of this Routes. - - :return: The tasks of this Routes. - :rtype: str - """ # noqa: E501 - return self._tasks - - @tasks.setter - def tasks(self, tasks): - """Set the tasks of this Routes. - - :param tasks: The tasks of this Routes. - :type: str - """ # noqa: E501 - self._tasks = tasks - - @property - def telegrafs(self): - """Get the telegrafs of this Routes. - - :return: The telegrafs of this Routes. - :rtype: str - """ # noqa: E501 - return self._telegrafs - - @telegrafs.setter - def telegrafs(self, telegrafs): - """Set the telegrafs of this Routes. - - :param telegrafs: The telegrafs of this Routes. - :type: str - """ # noqa: E501 - self._telegrafs = telegrafs - - @property - def users(self): - """Get the users of this Routes. - - :return: The users of this Routes. - :rtype: str - """ # noqa: E501 - return self._users - - @users.setter - def users(self, users): - """Set the users of this Routes. - - :param users: The users of this Routes. - :type: str - """ # noqa: E501 - self._users = users - - @property - def write(self): - """Get the write of this Routes. - - :return: The write of this Routes. - :rtype: str - """ # noqa: E501 - return self._write - - @write.setter - def write(self, write): - """Set the write of this Routes. - - :param write: The write of this Routes. - :type: str - """ # noqa: E501 - self._write = write - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Routes): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/routes_external.py b/frogpilot/third_party/influxdb_client/domain/routes_external.py deleted file mode 100644 index 87c49f98..00000000 --- a/frogpilot/third_party/influxdb_client/domain/routes_external.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class RoutesExternal(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'status_feed': 'str' - } - - attribute_map = { - 'status_feed': 'statusFeed' - } - - def __init__(self, status_feed=None): # noqa: E501,D401,D403 - """RoutesExternal - a model defined in OpenAPI.""" # noqa: E501 - self._status_feed = None - self.discriminator = None - - if status_feed is not None: - self.status_feed = status_feed - - @property - def status_feed(self): - """Get the status_feed of this RoutesExternal. - - :return: The status_feed of this RoutesExternal. - :rtype: str - """ # noqa: E501 - return self._status_feed - - @status_feed.setter - def status_feed(self, status_feed): - """Set the status_feed of this RoutesExternal. - - :param status_feed: The status_feed of this RoutesExternal. - :type: str - """ # noqa: E501 - self._status_feed = status_feed - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, RoutesExternal): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/routes_query.py b/frogpilot/third_party/influxdb_client/domain/routes_query.py deleted file mode 100644 index 82ae34e1..00000000 --- a/frogpilot/third_party/influxdb_client/domain/routes_query.py +++ /dev/null @@ -1,176 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class RoutesQuery(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - '_self': 'str', - 'ast': 'str', - 'analyze': 'str', - 'suggestions': 'str' - } - - attribute_map = { - '_self': 'self', - 'ast': 'ast', - 'analyze': 'analyze', - 'suggestions': 'suggestions' - } - - def __init__(self, _self=None, ast=None, analyze=None, suggestions=None): # noqa: E501,D401,D403 - """RoutesQuery - a model defined in OpenAPI.""" # noqa: E501 - self.__self = None - self._ast = None - self._analyze = None - self._suggestions = None - self.discriminator = None - - if _self is not None: - self._self = _self - if ast is not None: - self.ast = ast - if analyze is not None: - self.analyze = analyze - if suggestions is not None: - self.suggestions = suggestions - - @property - def _self(self): - """Get the _self of this RoutesQuery. - - :return: The _self of this RoutesQuery. - :rtype: str - """ # noqa: E501 - return self.__self - - @_self.setter - def _self(self, _self): - """Set the _self of this RoutesQuery. - - :param _self: The _self of this RoutesQuery. - :type: str - """ # noqa: E501 - self.__self = _self - - @property - def ast(self): - """Get the ast of this RoutesQuery. - - :return: The ast of this RoutesQuery. - :rtype: str - """ # noqa: E501 - return self._ast - - @ast.setter - def ast(self, ast): - """Set the ast of this RoutesQuery. - - :param ast: The ast of this RoutesQuery. - :type: str - """ # noqa: E501 - self._ast = ast - - @property - def analyze(self): - """Get the analyze of this RoutesQuery. - - :return: The analyze of this RoutesQuery. - :rtype: str - """ # noqa: E501 - return self._analyze - - @analyze.setter - def analyze(self, analyze): - """Set the analyze of this RoutesQuery. - - :param analyze: The analyze of this RoutesQuery. - :type: str - """ # noqa: E501 - self._analyze = analyze - - @property - def suggestions(self): - """Get the suggestions of this RoutesQuery. - - :return: The suggestions of this RoutesQuery. - :rtype: str - """ # noqa: E501 - return self._suggestions - - @suggestions.setter - def suggestions(self, suggestions): - """Set the suggestions of this RoutesQuery. - - :param suggestions: The suggestions of this RoutesQuery. - :type: str - """ # noqa: E501 - self._suggestions = suggestions - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, RoutesQuery): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/routes_system.py b/frogpilot/third_party/influxdb_client/domain/routes_system.py deleted file mode 100644 index 73ac677b..00000000 --- a/frogpilot/third_party/influxdb_client/domain/routes_system.py +++ /dev/null @@ -1,153 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class RoutesSystem(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'metrics': 'str', - 'debug': 'str', - 'health': 'str' - } - - attribute_map = { - 'metrics': 'metrics', - 'debug': 'debug', - 'health': 'health' - } - - def __init__(self, metrics=None, debug=None, health=None): # noqa: E501,D401,D403 - """RoutesSystem - a model defined in OpenAPI.""" # noqa: E501 - self._metrics = None - self._debug = None - self._health = None - self.discriminator = None - - if metrics is not None: - self.metrics = metrics - if debug is not None: - self.debug = debug - if health is not None: - self.health = health - - @property - def metrics(self): - """Get the metrics of this RoutesSystem. - - :return: The metrics of this RoutesSystem. - :rtype: str - """ # noqa: E501 - return self._metrics - - @metrics.setter - def metrics(self, metrics): - """Set the metrics of this RoutesSystem. - - :param metrics: The metrics of this RoutesSystem. - :type: str - """ # noqa: E501 - self._metrics = metrics - - @property - def debug(self): - """Get the debug of this RoutesSystem. - - :return: The debug of this RoutesSystem. - :rtype: str - """ # noqa: E501 - return self._debug - - @debug.setter - def debug(self, debug): - """Set the debug of this RoutesSystem. - - :param debug: The debug of this RoutesSystem. - :type: str - """ # noqa: E501 - self._debug = debug - - @property - def health(self): - """Get the health of this RoutesSystem. - - :return: The health of this RoutesSystem. - :rtype: str - """ # noqa: E501 - return self._health - - @health.setter - def health(self, health): - """Set the health of this RoutesSystem. - - :param health: The health of this RoutesSystem. - :type: str - """ # noqa: E501 - self._health = health - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, RoutesSystem): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/rule_status_level.py b/frogpilot/third_party/influxdb_client/domain/rule_status_level.py deleted file mode 100644 index 9d9f4249..00000000 --- a/frogpilot/third_party/influxdb_client/domain/rule_status_level.py +++ /dev/null @@ -1,92 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class RuleStatusLevel(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - allowed enum values - """ - UNKNOWN = "UNKNOWN" - OK = "OK" - INFO = "INFO" - CRIT = "CRIT" - WARN = "WARN" - ANY = "ANY" - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501,D401,D403 - """RuleStatusLevel - a model defined in OpenAPI.""" # noqa: E501 self.discriminator = None - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, RuleStatusLevel): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/run.py b/frogpilot/third_party/influxdb_client/domain/run.py deleted file mode 100644 index 32634aca..00000000 --- a/frogpilot/third_party/influxdb_client/domain/run.py +++ /dev/null @@ -1,338 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class Run(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'str', - 'task_id': 'str', - 'status': 'str', - 'scheduled_for': 'datetime', - 'log': 'list[LogEvent]', - 'flux': 'str', - 'started_at': 'datetime', - 'finished_at': 'datetime', - 'requested_at': 'datetime', - 'links': 'RunLinks' - } - - attribute_map = { - 'id': 'id', - 'task_id': 'taskID', - 'status': 'status', - 'scheduled_for': 'scheduledFor', - 'log': 'log', - 'flux': 'flux', - 'started_at': 'startedAt', - 'finished_at': 'finishedAt', - 'requested_at': 'requestedAt', - 'links': 'links' - } - - def __init__(self, id=None, task_id=None, status=None, scheduled_for=None, log=None, flux=None, started_at=None, finished_at=None, requested_at=None, links=None): # noqa: E501,D401,D403 - """Run - a model defined in OpenAPI.""" # noqa: E501 - self._id = None - self._task_id = None - self._status = None - self._scheduled_for = None - self._log = None - self._flux = None - self._started_at = None - self._finished_at = None - self._requested_at = None - self._links = None - self.discriminator = None - - if id is not None: - self.id = id - if task_id is not None: - self.task_id = task_id - if status is not None: - self.status = status - if scheduled_for is not None: - self.scheduled_for = scheduled_for - if log is not None: - self.log = log - if flux is not None: - self.flux = flux - if started_at is not None: - self.started_at = started_at - if finished_at is not None: - self.finished_at = finished_at - if requested_at is not None: - self.requested_at = requested_at - if links is not None: - self.links = links - - @property - def id(self): - """Get the id of this Run. - - :return: The id of this Run. - :rtype: str - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this Run. - - :param id: The id of this Run. - :type: str - """ # noqa: E501 - self._id = id - - @property - def task_id(self): - """Get the task_id of this Run. - - :return: The task_id of this Run. - :rtype: str - """ # noqa: E501 - return self._task_id - - @task_id.setter - def task_id(self, task_id): - """Set the task_id of this Run. - - :param task_id: The task_id of this Run. - :type: str - """ # noqa: E501 - self._task_id = task_id - - @property - def status(self): - """Get the status of this Run. - - :return: The status of this Run. - :rtype: str - """ # noqa: E501 - return self._status - - @status.setter - def status(self, status): - """Set the status of this Run. - - :param status: The status of this Run. - :type: str - """ # noqa: E501 - self._status = status - - @property - def scheduled_for(self): - """Get the scheduled_for of this Run. - - The time [RFC3339 date/time format](https://docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339-timestamp) used for the run's `now` option. - - :return: The scheduled_for of this Run. - :rtype: datetime - """ # noqa: E501 - return self._scheduled_for - - @scheduled_for.setter - def scheduled_for(self, scheduled_for): - """Set the scheduled_for of this Run. - - The time [RFC3339 date/time format](https://docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339-timestamp) used for the run's `now` option. - - :param scheduled_for: The scheduled_for of this Run. - :type: datetime - """ # noqa: E501 - self._scheduled_for = scheduled_for - - @property - def log(self): - """Get the log of this Run. - - An array of logs associated with the run. - - :return: The log of this Run. - :rtype: list[LogEvent] - """ # noqa: E501 - return self._log - - @log.setter - def log(self, log): - """Set the log of this Run. - - An array of logs associated with the run. - - :param log: The log of this Run. - :type: list[LogEvent] - """ # noqa: E501 - self._log = log - - @property - def flux(self): - """Get the flux of this Run. - - Flux used for the task - - :return: The flux of this Run. - :rtype: str - """ # noqa: E501 - return self._flux - - @flux.setter - def flux(self, flux): - """Set the flux of this Run. - - Flux used for the task - - :param flux: The flux of this Run. - :type: str - """ # noqa: E501 - self._flux = flux - - @property - def started_at(self): - """Get the started_at of this Run. - - The time ([RFC3339Nano date/time format](https://go.dev/src/time/format.go)) the run started executing. - - :return: The started_at of this Run. - :rtype: datetime - """ # noqa: E501 - return self._started_at - - @started_at.setter - def started_at(self, started_at): - """Set the started_at of this Run. - - The time ([RFC3339Nano date/time format](https://go.dev/src/time/format.go)) the run started executing. - - :param started_at: The started_at of this Run. - :type: datetime - """ # noqa: E501 - self._started_at = started_at - - @property - def finished_at(self): - """Get the finished_at of this Run. - - The time ([RFC3339Nano date/time format](https://go.dev/src/time/format.go)) the run finished executing. - - :return: The finished_at of this Run. - :rtype: datetime - """ # noqa: E501 - return self._finished_at - - @finished_at.setter - def finished_at(self, finished_at): - """Set the finished_at of this Run. - - The time ([RFC3339Nano date/time format](https://go.dev/src/time/format.go)) the run finished executing. - - :param finished_at: The finished_at of this Run. - :type: datetime - """ # noqa: E501 - self._finished_at = finished_at - - @property - def requested_at(self): - """Get the requested_at of this Run. - - The time ([RFC3339Nano date/time format](https://docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339nano-timestamp)) the run was manually requested. - - :return: The requested_at of this Run. - :rtype: datetime - """ # noqa: E501 - return self._requested_at - - @requested_at.setter - def requested_at(self, requested_at): - """Set the requested_at of this Run. - - The time ([RFC3339Nano date/time format](https://docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339nano-timestamp)) the run was manually requested. - - :param requested_at: The requested_at of this Run. - :type: datetime - """ # noqa: E501 - self._requested_at = requested_at - - @property - def links(self): - """Get the links of this Run. - - :return: The links of this Run. - :rtype: RunLinks - """ # noqa: E501 - return self._links - - @links.setter - def links(self, links): - """Set the links of this Run. - - :param links: The links of this Run. - :type: RunLinks - """ # noqa: E501 - self._links = links - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Run): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/run_links.py b/frogpilot/third_party/influxdb_client/domain/run_links.py deleted file mode 100644 index 08c0533f..00000000 --- a/frogpilot/third_party/influxdb_client/domain/run_links.py +++ /dev/null @@ -1,153 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class RunLinks(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - '_self': 'str', - 'task': 'str', - 'retry': 'str' - } - - attribute_map = { - '_self': 'self', - 'task': 'task', - 'retry': 'retry' - } - - def __init__(self, _self=None, task=None, retry=None): # noqa: E501,D401,D403 - """RunLinks - a model defined in OpenAPI.""" # noqa: E501 - self.__self = None - self._task = None - self._retry = None - self.discriminator = None - - if _self is not None: - self._self = _self - if task is not None: - self.task = task - if retry is not None: - self.retry = retry - - @property - def _self(self): - """Get the _self of this RunLinks. - - :return: The _self of this RunLinks. - :rtype: str - """ # noqa: E501 - return self.__self - - @_self.setter - def _self(self, _self): - """Set the _self of this RunLinks. - - :param _self: The _self of this RunLinks. - :type: str - """ # noqa: E501 - self.__self = _self - - @property - def task(self): - """Get the task of this RunLinks. - - :return: The task of this RunLinks. - :rtype: str - """ # noqa: E501 - return self._task - - @task.setter - def task(self, task): - """Set the task of this RunLinks. - - :param task: The task of this RunLinks. - :type: str - """ # noqa: E501 - self._task = task - - @property - def retry(self): - """Get the retry of this RunLinks. - - :return: The retry of this RunLinks. - :rtype: str - """ # noqa: E501 - return self._retry - - @retry.setter - def retry(self, retry): - """Set the retry of this RunLinks. - - :param retry: The retry of this RunLinks. - :type: str - """ # noqa: E501 - self._retry = retry - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, RunLinks): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/run_manually.py b/frogpilot/third_party/influxdb_client/domain/run_manually.py deleted file mode 100644 index c3260831..00000000 --- a/frogpilot/third_party/influxdb_client/domain/run_manually.py +++ /dev/null @@ -1,110 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class RunManually(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'scheduled_for': 'datetime' - } - - attribute_map = { - 'scheduled_for': 'scheduledFor' - } - - def __init__(self, scheduled_for=None): # noqa: E501,D401,D403 - """RunManually - a model defined in OpenAPI.""" # noqa: E501 - self._scheduled_for = None - self.discriminator = None - - self.scheduled_for = scheduled_for - - @property - def scheduled_for(self): - """Get the scheduled_for of this RunManually. - - The time [RFC3339 date/time format](https://docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339-timestamp) used for the run's `now` option. Default is the server _now_ time. - - :return: The scheduled_for of this RunManually. - :rtype: datetime - """ # noqa: E501 - return self._scheduled_for - - @scheduled_for.setter - def scheduled_for(self, scheduled_for): - """Set the scheduled_for of this RunManually. - - The time [RFC3339 date/time format](https://docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339-timestamp) used for the run's `now` option. Default is the server _now_ time. - - :param scheduled_for: The scheduled_for of this RunManually. - :type: datetime - """ # noqa: E501 - self._scheduled_for = scheduled_for - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, RunManually): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/runs.py b/frogpilot/third_party/influxdb_client/domain/runs.py deleted file mode 100644 index 5f926301..00000000 --- a/frogpilot/third_party/influxdb_client/domain/runs.py +++ /dev/null @@ -1,130 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class Runs(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'links': 'Links', - 'runs': 'list[Run]' - } - - attribute_map = { - 'links': 'links', - 'runs': 'runs' - } - - def __init__(self, links=None, runs=None): # noqa: E501,D401,D403 - """Runs - a model defined in OpenAPI.""" # noqa: E501 - self._links = None - self._runs = None - self.discriminator = None - - if links is not None: - self.links = links - if runs is not None: - self.runs = runs - - @property - def links(self): - """Get the links of this Runs. - - :return: The links of this Runs. - :rtype: Links - """ # noqa: E501 - return self._links - - @links.setter - def links(self, links): - """Set the links of this Runs. - - :param links: The links of this Runs. - :type: Links - """ # noqa: E501 - self._links = links - - @property - def runs(self): - """Get the runs of this Runs. - - :return: The runs of this Runs. - :rtype: list[Run] - """ # noqa: E501 - return self._runs - - @runs.setter - def runs(self, runs): - """Set the runs of this Runs. - - :param runs: The runs of this Runs. - :type: list[Run] - """ # noqa: E501 - self._runs = runs - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Runs): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/scatter_view_properties.py b/frogpilot/third_party/influxdb_client/domain/scatter_view_properties.py deleted file mode 100644 index 783a87cb..00000000 --- a/frogpilot/third_party/influxdb_client/domain/scatter_view_properties.py +++ /dev/null @@ -1,850 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.view_properties import ViewProperties - - -class ScatterViewProperties(ViewProperties): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'adaptive_zoom_hide': 'bool', - 'time_format': 'str', - 'type': 'str', - 'queries': 'list[DashboardQuery]', - 'colors': 'list[str]', - 'shape': 'str', - 'note': 'str', - 'show_note_when_empty': 'bool', - 'x_column': 'str', - 'generate_x_axis_ticks': 'list[str]', - 'x_total_ticks': 'int', - 'x_tick_start': 'float', - 'x_tick_step': 'float', - 'y_column': 'str', - 'generate_y_axis_ticks': 'list[str]', - 'y_total_ticks': 'int', - 'y_tick_start': 'float', - 'y_tick_step': 'float', - 'fill_columns': 'list[str]', - 'symbol_columns': 'list[str]', - 'x_domain': 'list[float]', - 'y_domain': 'list[float]', - 'x_axis_label': 'str', - 'y_axis_label': 'str', - 'x_prefix': 'str', - 'x_suffix': 'str', - 'y_prefix': 'str', - 'y_suffix': 'str', - 'legend_colorize_rows': 'bool', - 'legend_hide': 'bool', - 'legend_opacity': 'float', - 'legend_orientation_threshold': 'int' - } - - attribute_map = { - 'adaptive_zoom_hide': 'adaptiveZoomHide', - 'time_format': 'timeFormat', - 'type': 'type', - 'queries': 'queries', - 'colors': 'colors', - 'shape': 'shape', - 'note': 'note', - 'show_note_when_empty': 'showNoteWhenEmpty', - 'x_column': 'xColumn', - 'generate_x_axis_ticks': 'generateXAxisTicks', - 'x_total_ticks': 'xTotalTicks', - 'x_tick_start': 'xTickStart', - 'x_tick_step': 'xTickStep', - 'y_column': 'yColumn', - 'generate_y_axis_ticks': 'generateYAxisTicks', - 'y_total_ticks': 'yTotalTicks', - 'y_tick_start': 'yTickStart', - 'y_tick_step': 'yTickStep', - 'fill_columns': 'fillColumns', - 'symbol_columns': 'symbolColumns', - 'x_domain': 'xDomain', - 'y_domain': 'yDomain', - 'x_axis_label': 'xAxisLabel', - 'y_axis_label': 'yAxisLabel', - 'x_prefix': 'xPrefix', - 'x_suffix': 'xSuffix', - 'y_prefix': 'yPrefix', - 'y_suffix': 'ySuffix', - 'legend_colorize_rows': 'legendColorizeRows', - 'legend_hide': 'legendHide', - 'legend_opacity': 'legendOpacity', - 'legend_orientation_threshold': 'legendOrientationThreshold' - } - - def __init__(self, adaptive_zoom_hide=None, time_format=None, type=None, queries=None, colors=None, shape=None, note=None, show_note_when_empty=None, x_column=None, generate_x_axis_ticks=None, x_total_ticks=None, x_tick_start=None, x_tick_step=None, y_column=None, generate_y_axis_ticks=None, y_total_ticks=None, y_tick_start=None, y_tick_step=None, fill_columns=None, symbol_columns=None, x_domain=None, y_domain=None, x_axis_label=None, y_axis_label=None, x_prefix=None, x_suffix=None, y_prefix=None, y_suffix=None, legend_colorize_rows=None, legend_hide=None, legend_opacity=None, legend_orientation_threshold=None): # noqa: E501,D401,D403 - """ScatterViewProperties - a model defined in OpenAPI.""" # noqa: E501 - ViewProperties.__init__(self) # noqa: E501 - - self._adaptive_zoom_hide = None - self._time_format = None - self._type = None - self._queries = None - self._colors = None - self._shape = None - self._note = None - self._show_note_when_empty = None - self._x_column = None - self._generate_x_axis_ticks = None - self._x_total_ticks = None - self._x_tick_start = None - self._x_tick_step = None - self._y_column = None - self._generate_y_axis_ticks = None - self._y_total_ticks = None - self._y_tick_start = None - self._y_tick_step = None - self._fill_columns = None - self._symbol_columns = None - self._x_domain = None - self._y_domain = None - self._x_axis_label = None - self._y_axis_label = None - self._x_prefix = None - self._x_suffix = None - self._y_prefix = None - self._y_suffix = None - self._legend_colorize_rows = None - self._legend_hide = None - self._legend_opacity = None - self._legend_orientation_threshold = None - self.discriminator = None - - if adaptive_zoom_hide is not None: - self.adaptive_zoom_hide = adaptive_zoom_hide - if time_format is not None: - self.time_format = time_format - self.type = type - self.queries = queries - self.colors = colors - self.shape = shape - self.note = note - self.show_note_when_empty = show_note_when_empty - self.x_column = x_column - if generate_x_axis_ticks is not None: - self.generate_x_axis_ticks = generate_x_axis_ticks - if x_total_ticks is not None: - self.x_total_ticks = x_total_ticks - if x_tick_start is not None: - self.x_tick_start = x_tick_start - if x_tick_step is not None: - self.x_tick_step = x_tick_step - self.y_column = y_column - if generate_y_axis_ticks is not None: - self.generate_y_axis_ticks = generate_y_axis_ticks - if y_total_ticks is not None: - self.y_total_ticks = y_total_ticks - if y_tick_start is not None: - self.y_tick_start = y_tick_start - if y_tick_step is not None: - self.y_tick_step = y_tick_step - self.fill_columns = fill_columns - self.symbol_columns = symbol_columns - self.x_domain = x_domain - self.y_domain = y_domain - self.x_axis_label = x_axis_label - self.y_axis_label = y_axis_label - self.x_prefix = x_prefix - self.x_suffix = x_suffix - self.y_prefix = y_prefix - self.y_suffix = y_suffix - if legend_colorize_rows is not None: - self.legend_colorize_rows = legend_colorize_rows - if legend_hide is not None: - self.legend_hide = legend_hide - if legend_opacity is not None: - self.legend_opacity = legend_opacity - if legend_orientation_threshold is not None: - self.legend_orientation_threshold = legend_orientation_threshold - - @property - def adaptive_zoom_hide(self): - """Get the adaptive_zoom_hide of this ScatterViewProperties. - - :return: The adaptive_zoom_hide of this ScatterViewProperties. - :rtype: bool - """ # noqa: E501 - return self._adaptive_zoom_hide - - @adaptive_zoom_hide.setter - def adaptive_zoom_hide(self, adaptive_zoom_hide): - """Set the adaptive_zoom_hide of this ScatterViewProperties. - - :param adaptive_zoom_hide: The adaptive_zoom_hide of this ScatterViewProperties. - :type: bool - """ # noqa: E501 - self._adaptive_zoom_hide = adaptive_zoom_hide - - @property - def time_format(self): - """Get the time_format of this ScatterViewProperties. - - :return: The time_format of this ScatterViewProperties. - :rtype: str - """ # noqa: E501 - return self._time_format - - @time_format.setter - def time_format(self, time_format): - """Set the time_format of this ScatterViewProperties. - - :param time_format: The time_format of this ScatterViewProperties. - :type: str - """ # noqa: E501 - self._time_format = time_format - - @property - def type(self): - """Get the type of this ScatterViewProperties. - - :return: The type of this ScatterViewProperties. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this ScatterViewProperties. - - :param type: The type of this ScatterViewProperties. - :type: str - """ # noqa: E501 - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - self._type = type - - @property - def queries(self): - """Get the queries of this ScatterViewProperties. - - :return: The queries of this ScatterViewProperties. - :rtype: list[DashboardQuery] - """ # noqa: E501 - return self._queries - - @queries.setter - def queries(self, queries): - """Set the queries of this ScatterViewProperties. - - :param queries: The queries of this ScatterViewProperties. - :type: list[DashboardQuery] - """ # noqa: E501 - if queries is None: - raise ValueError("Invalid value for `queries`, must not be `None`") # noqa: E501 - self._queries = queries - - @property - def colors(self): - """Get the colors of this ScatterViewProperties. - - Colors define color encoding of data into a visualization - - :return: The colors of this ScatterViewProperties. - :rtype: list[str] - """ # noqa: E501 - return self._colors - - @colors.setter - def colors(self, colors): - """Set the colors of this ScatterViewProperties. - - Colors define color encoding of data into a visualization - - :param colors: The colors of this ScatterViewProperties. - :type: list[str] - """ # noqa: E501 - if colors is None: - raise ValueError("Invalid value for `colors`, must not be `None`") # noqa: E501 - self._colors = colors - - @property - def shape(self): - """Get the shape of this ScatterViewProperties. - - :return: The shape of this ScatterViewProperties. - :rtype: str - """ # noqa: E501 - return self._shape - - @shape.setter - def shape(self, shape): - """Set the shape of this ScatterViewProperties. - - :param shape: The shape of this ScatterViewProperties. - :type: str - """ # noqa: E501 - if shape is None: - raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 - self._shape = shape - - @property - def note(self): - """Get the note of this ScatterViewProperties. - - :return: The note of this ScatterViewProperties. - :rtype: str - """ # noqa: E501 - return self._note - - @note.setter - def note(self, note): - """Set the note of this ScatterViewProperties. - - :param note: The note of this ScatterViewProperties. - :type: str - """ # noqa: E501 - if note is None: - raise ValueError("Invalid value for `note`, must not be `None`") # noqa: E501 - self._note = note - - @property - def show_note_when_empty(self): - """Get the show_note_when_empty of this ScatterViewProperties. - - If true, will display note when empty - - :return: The show_note_when_empty of this ScatterViewProperties. - :rtype: bool - """ # noqa: E501 - return self._show_note_when_empty - - @show_note_when_empty.setter - def show_note_when_empty(self, show_note_when_empty): - """Set the show_note_when_empty of this ScatterViewProperties. - - If true, will display note when empty - - :param show_note_when_empty: The show_note_when_empty of this ScatterViewProperties. - :type: bool - """ # noqa: E501 - if show_note_when_empty is None: - raise ValueError("Invalid value for `show_note_when_empty`, must not be `None`") # noqa: E501 - self._show_note_when_empty = show_note_when_empty - - @property - def x_column(self): - """Get the x_column of this ScatterViewProperties. - - :return: The x_column of this ScatterViewProperties. - :rtype: str - """ # noqa: E501 - return self._x_column - - @x_column.setter - def x_column(self, x_column): - """Set the x_column of this ScatterViewProperties. - - :param x_column: The x_column of this ScatterViewProperties. - :type: str - """ # noqa: E501 - if x_column is None: - raise ValueError("Invalid value for `x_column`, must not be `None`") # noqa: E501 - self._x_column = x_column - - @property - def generate_x_axis_ticks(self): - """Get the generate_x_axis_ticks of this ScatterViewProperties. - - :return: The generate_x_axis_ticks of this ScatterViewProperties. - :rtype: list[str] - """ # noqa: E501 - return self._generate_x_axis_ticks - - @generate_x_axis_ticks.setter - def generate_x_axis_ticks(self, generate_x_axis_ticks): - """Set the generate_x_axis_ticks of this ScatterViewProperties. - - :param generate_x_axis_ticks: The generate_x_axis_ticks of this ScatterViewProperties. - :type: list[str] - """ # noqa: E501 - self._generate_x_axis_ticks = generate_x_axis_ticks - - @property - def x_total_ticks(self): - """Get the x_total_ticks of this ScatterViewProperties. - - :return: The x_total_ticks of this ScatterViewProperties. - :rtype: int - """ # noqa: E501 - return self._x_total_ticks - - @x_total_ticks.setter - def x_total_ticks(self, x_total_ticks): - """Set the x_total_ticks of this ScatterViewProperties. - - :param x_total_ticks: The x_total_ticks of this ScatterViewProperties. - :type: int - """ # noqa: E501 - self._x_total_ticks = x_total_ticks - - @property - def x_tick_start(self): - """Get the x_tick_start of this ScatterViewProperties. - - :return: The x_tick_start of this ScatterViewProperties. - :rtype: float - """ # noqa: E501 - return self._x_tick_start - - @x_tick_start.setter - def x_tick_start(self, x_tick_start): - """Set the x_tick_start of this ScatterViewProperties. - - :param x_tick_start: The x_tick_start of this ScatterViewProperties. - :type: float - """ # noqa: E501 - self._x_tick_start = x_tick_start - - @property - def x_tick_step(self): - """Get the x_tick_step of this ScatterViewProperties. - - :return: The x_tick_step of this ScatterViewProperties. - :rtype: float - """ # noqa: E501 - return self._x_tick_step - - @x_tick_step.setter - def x_tick_step(self, x_tick_step): - """Set the x_tick_step of this ScatterViewProperties. - - :param x_tick_step: The x_tick_step of this ScatterViewProperties. - :type: float - """ # noqa: E501 - self._x_tick_step = x_tick_step - - @property - def y_column(self): - """Get the y_column of this ScatterViewProperties. - - :return: The y_column of this ScatterViewProperties. - :rtype: str - """ # noqa: E501 - return self._y_column - - @y_column.setter - def y_column(self, y_column): - """Set the y_column of this ScatterViewProperties. - - :param y_column: The y_column of this ScatterViewProperties. - :type: str - """ # noqa: E501 - if y_column is None: - raise ValueError("Invalid value for `y_column`, must not be `None`") # noqa: E501 - self._y_column = y_column - - @property - def generate_y_axis_ticks(self): - """Get the generate_y_axis_ticks of this ScatterViewProperties. - - :return: The generate_y_axis_ticks of this ScatterViewProperties. - :rtype: list[str] - """ # noqa: E501 - return self._generate_y_axis_ticks - - @generate_y_axis_ticks.setter - def generate_y_axis_ticks(self, generate_y_axis_ticks): - """Set the generate_y_axis_ticks of this ScatterViewProperties. - - :param generate_y_axis_ticks: The generate_y_axis_ticks of this ScatterViewProperties. - :type: list[str] - """ # noqa: E501 - self._generate_y_axis_ticks = generate_y_axis_ticks - - @property - def y_total_ticks(self): - """Get the y_total_ticks of this ScatterViewProperties. - - :return: The y_total_ticks of this ScatterViewProperties. - :rtype: int - """ # noqa: E501 - return self._y_total_ticks - - @y_total_ticks.setter - def y_total_ticks(self, y_total_ticks): - """Set the y_total_ticks of this ScatterViewProperties. - - :param y_total_ticks: The y_total_ticks of this ScatterViewProperties. - :type: int - """ # noqa: E501 - self._y_total_ticks = y_total_ticks - - @property - def y_tick_start(self): - """Get the y_tick_start of this ScatterViewProperties. - - :return: The y_tick_start of this ScatterViewProperties. - :rtype: float - """ # noqa: E501 - return self._y_tick_start - - @y_tick_start.setter - def y_tick_start(self, y_tick_start): - """Set the y_tick_start of this ScatterViewProperties. - - :param y_tick_start: The y_tick_start of this ScatterViewProperties. - :type: float - """ # noqa: E501 - self._y_tick_start = y_tick_start - - @property - def y_tick_step(self): - """Get the y_tick_step of this ScatterViewProperties. - - :return: The y_tick_step of this ScatterViewProperties. - :rtype: float - """ # noqa: E501 - return self._y_tick_step - - @y_tick_step.setter - def y_tick_step(self, y_tick_step): - """Set the y_tick_step of this ScatterViewProperties. - - :param y_tick_step: The y_tick_step of this ScatterViewProperties. - :type: float - """ # noqa: E501 - self._y_tick_step = y_tick_step - - @property - def fill_columns(self): - """Get the fill_columns of this ScatterViewProperties. - - :return: The fill_columns of this ScatterViewProperties. - :rtype: list[str] - """ # noqa: E501 - return self._fill_columns - - @fill_columns.setter - def fill_columns(self, fill_columns): - """Set the fill_columns of this ScatterViewProperties. - - :param fill_columns: The fill_columns of this ScatterViewProperties. - :type: list[str] - """ # noqa: E501 - if fill_columns is None: - raise ValueError("Invalid value for `fill_columns`, must not be `None`") # noqa: E501 - self._fill_columns = fill_columns - - @property - def symbol_columns(self): - """Get the symbol_columns of this ScatterViewProperties. - - :return: The symbol_columns of this ScatterViewProperties. - :rtype: list[str] - """ # noqa: E501 - return self._symbol_columns - - @symbol_columns.setter - def symbol_columns(self, symbol_columns): - """Set the symbol_columns of this ScatterViewProperties. - - :param symbol_columns: The symbol_columns of this ScatterViewProperties. - :type: list[str] - """ # noqa: E501 - if symbol_columns is None: - raise ValueError("Invalid value for `symbol_columns`, must not be `None`") # noqa: E501 - self._symbol_columns = symbol_columns - - @property - def x_domain(self): - """Get the x_domain of this ScatterViewProperties. - - :return: The x_domain of this ScatterViewProperties. - :rtype: list[float] - """ # noqa: E501 - return self._x_domain - - @x_domain.setter - def x_domain(self, x_domain): - """Set the x_domain of this ScatterViewProperties. - - :param x_domain: The x_domain of this ScatterViewProperties. - :type: list[float] - """ # noqa: E501 - if x_domain is None: - raise ValueError("Invalid value for `x_domain`, must not be `None`") # noqa: E501 - self._x_domain = x_domain - - @property - def y_domain(self): - """Get the y_domain of this ScatterViewProperties. - - :return: The y_domain of this ScatterViewProperties. - :rtype: list[float] - """ # noqa: E501 - return self._y_domain - - @y_domain.setter - def y_domain(self, y_domain): - """Set the y_domain of this ScatterViewProperties. - - :param y_domain: The y_domain of this ScatterViewProperties. - :type: list[float] - """ # noqa: E501 - if y_domain is None: - raise ValueError("Invalid value for `y_domain`, must not be `None`") # noqa: E501 - self._y_domain = y_domain - - @property - def x_axis_label(self): - """Get the x_axis_label of this ScatterViewProperties. - - :return: The x_axis_label of this ScatterViewProperties. - :rtype: str - """ # noqa: E501 - return self._x_axis_label - - @x_axis_label.setter - def x_axis_label(self, x_axis_label): - """Set the x_axis_label of this ScatterViewProperties. - - :param x_axis_label: The x_axis_label of this ScatterViewProperties. - :type: str - """ # noqa: E501 - if x_axis_label is None: - raise ValueError("Invalid value for `x_axis_label`, must not be `None`") # noqa: E501 - self._x_axis_label = x_axis_label - - @property - def y_axis_label(self): - """Get the y_axis_label of this ScatterViewProperties. - - :return: The y_axis_label of this ScatterViewProperties. - :rtype: str - """ # noqa: E501 - return self._y_axis_label - - @y_axis_label.setter - def y_axis_label(self, y_axis_label): - """Set the y_axis_label of this ScatterViewProperties. - - :param y_axis_label: The y_axis_label of this ScatterViewProperties. - :type: str - """ # noqa: E501 - if y_axis_label is None: - raise ValueError("Invalid value for `y_axis_label`, must not be `None`") # noqa: E501 - self._y_axis_label = y_axis_label - - @property - def x_prefix(self): - """Get the x_prefix of this ScatterViewProperties. - - :return: The x_prefix of this ScatterViewProperties. - :rtype: str - """ # noqa: E501 - return self._x_prefix - - @x_prefix.setter - def x_prefix(self, x_prefix): - """Set the x_prefix of this ScatterViewProperties. - - :param x_prefix: The x_prefix of this ScatterViewProperties. - :type: str - """ # noqa: E501 - if x_prefix is None: - raise ValueError("Invalid value for `x_prefix`, must not be `None`") # noqa: E501 - self._x_prefix = x_prefix - - @property - def x_suffix(self): - """Get the x_suffix of this ScatterViewProperties. - - :return: The x_suffix of this ScatterViewProperties. - :rtype: str - """ # noqa: E501 - return self._x_suffix - - @x_suffix.setter - def x_suffix(self, x_suffix): - """Set the x_suffix of this ScatterViewProperties. - - :param x_suffix: The x_suffix of this ScatterViewProperties. - :type: str - """ # noqa: E501 - if x_suffix is None: - raise ValueError("Invalid value for `x_suffix`, must not be `None`") # noqa: E501 - self._x_suffix = x_suffix - - @property - def y_prefix(self): - """Get the y_prefix of this ScatterViewProperties. - - :return: The y_prefix of this ScatterViewProperties. - :rtype: str - """ # noqa: E501 - return self._y_prefix - - @y_prefix.setter - def y_prefix(self, y_prefix): - """Set the y_prefix of this ScatterViewProperties. - - :param y_prefix: The y_prefix of this ScatterViewProperties. - :type: str - """ # noqa: E501 - if y_prefix is None: - raise ValueError("Invalid value for `y_prefix`, must not be `None`") # noqa: E501 - self._y_prefix = y_prefix - - @property - def y_suffix(self): - """Get the y_suffix of this ScatterViewProperties. - - :return: The y_suffix of this ScatterViewProperties. - :rtype: str - """ # noqa: E501 - return self._y_suffix - - @y_suffix.setter - def y_suffix(self, y_suffix): - """Set the y_suffix of this ScatterViewProperties. - - :param y_suffix: The y_suffix of this ScatterViewProperties. - :type: str - """ # noqa: E501 - if y_suffix is None: - raise ValueError("Invalid value for `y_suffix`, must not be `None`") # noqa: E501 - self._y_suffix = y_suffix - - @property - def legend_colorize_rows(self): - """Get the legend_colorize_rows of this ScatterViewProperties. - - :return: The legend_colorize_rows of this ScatterViewProperties. - :rtype: bool - """ # noqa: E501 - return self._legend_colorize_rows - - @legend_colorize_rows.setter - def legend_colorize_rows(self, legend_colorize_rows): - """Set the legend_colorize_rows of this ScatterViewProperties. - - :param legend_colorize_rows: The legend_colorize_rows of this ScatterViewProperties. - :type: bool - """ # noqa: E501 - self._legend_colorize_rows = legend_colorize_rows - - @property - def legend_hide(self): - """Get the legend_hide of this ScatterViewProperties. - - :return: The legend_hide of this ScatterViewProperties. - :rtype: bool - """ # noqa: E501 - return self._legend_hide - - @legend_hide.setter - def legend_hide(self, legend_hide): - """Set the legend_hide of this ScatterViewProperties. - - :param legend_hide: The legend_hide of this ScatterViewProperties. - :type: bool - """ # noqa: E501 - self._legend_hide = legend_hide - - @property - def legend_opacity(self): - """Get the legend_opacity of this ScatterViewProperties. - - :return: The legend_opacity of this ScatterViewProperties. - :rtype: float - """ # noqa: E501 - return self._legend_opacity - - @legend_opacity.setter - def legend_opacity(self, legend_opacity): - """Set the legend_opacity of this ScatterViewProperties. - - :param legend_opacity: The legend_opacity of this ScatterViewProperties. - :type: float - """ # noqa: E501 - self._legend_opacity = legend_opacity - - @property - def legend_orientation_threshold(self): - """Get the legend_orientation_threshold of this ScatterViewProperties. - - :return: The legend_orientation_threshold of this ScatterViewProperties. - :rtype: int - """ # noqa: E501 - return self._legend_orientation_threshold - - @legend_orientation_threshold.setter - def legend_orientation_threshold(self, legend_orientation_threshold): - """Set the legend_orientation_threshold of this ScatterViewProperties. - - :param legend_orientation_threshold: The legend_orientation_threshold of this ScatterViewProperties. - :type: int - """ # noqa: E501 - self._legend_orientation_threshold = legend_orientation_threshold - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, ScatterViewProperties): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/schema_type.py b/frogpilot/third_party/influxdb_client/domain/schema_type.py deleted file mode 100644 index c8612b55..00000000 --- a/frogpilot/third_party/influxdb_client/domain/schema_type.py +++ /dev/null @@ -1,88 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class SchemaType(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - allowed enum values - """ - IMPLICIT = "implicit" - EXPLICIT = "explicit" - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501,D401,D403 - """SchemaType - a model defined in OpenAPI.""" # noqa: E501 self.discriminator = None - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, SchemaType): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/scraper_target_request.py b/frogpilot/third_party/influxdb_client/domain/scraper_target_request.py deleted file mode 100644 index ae960678..00000000 --- a/frogpilot/third_party/influxdb_client/domain/scraper_target_request.py +++ /dev/null @@ -1,246 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class ScraperTargetRequest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str', - 'type': 'str', - 'url': 'str', - 'org_id': 'str', - 'bucket_id': 'str', - 'allow_insecure': 'bool' - } - - attribute_map = { - 'name': 'name', - 'type': 'type', - 'url': 'url', - 'org_id': 'orgID', - 'bucket_id': 'bucketID', - 'allow_insecure': 'allowInsecure' - } - - def __init__(self, name=None, type=None, url=None, org_id=None, bucket_id=None, allow_insecure=False): # noqa: E501,D401,D403 - """ScraperTargetRequest - a model defined in OpenAPI.""" # noqa: E501 - self._name = None - self._type = None - self._url = None - self._org_id = None - self._bucket_id = None - self._allow_insecure = None - self.discriminator = None - - if name is not None: - self.name = name - if type is not None: - self.type = type - if url is not None: - self.url = url - if org_id is not None: - self.org_id = org_id - if bucket_id is not None: - self.bucket_id = bucket_id - if allow_insecure is not None: - self.allow_insecure = allow_insecure - - @property - def name(self): - """Get the name of this ScraperTargetRequest. - - The name of the scraper target. - - :return: The name of this ScraperTargetRequest. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this ScraperTargetRequest. - - The name of the scraper target. - - :param name: The name of this ScraperTargetRequest. - :type: str - """ # noqa: E501 - self._name = name - - @property - def type(self): - """Get the type of this ScraperTargetRequest. - - The type of the metrics to be parsed. - - :return: The type of this ScraperTargetRequest. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this ScraperTargetRequest. - - The type of the metrics to be parsed. - - :param type: The type of this ScraperTargetRequest. - :type: str - """ # noqa: E501 - self._type = type - - @property - def url(self): - """Get the url of this ScraperTargetRequest. - - The URL of the metrics endpoint. - - :return: The url of this ScraperTargetRequest. - :rtype: str - """ # noqa: E501 - return self._url - - @url.setter - def url(self, url): - """Set the url of this ScraperTargetRequest. - - The URL of the metrics endpoint. - - :param url: The url of this ScraperTargetRequest. - :type: str - """ # noqa: E501 - self._url = url - - @property - def org_id(self): - """Get the org_id of this ScraperTargetRequest. - - The organization ID. - - :return: The org_id of this ScraperTargetRequest. - :rtype: str - """ # noqa: E501 - return self._org_id - - @org_id.setter - def org_id(self, org_id): - """Set the org_id of this ScraperTargetRequest. - - The organization ID. - - :param org_id: The org_id of this ScraperTargetRequest. - :type: str - """ # noqa: E501 - self._org_id = org_id - - @property - def bucket_id(self): - """Get the bucket_id of this ScraperTargetRequest. - - The ID of the bucket to write to. - - :return: The bucket_id of this ScraperTargetRequest. - :rtype: str - """ # noqa: E501 - return self._bucket_id - - @bucket_id.setter - def bucket_id(self, bucket_id): - """Set the bucket_id of this ScraperTargetRequest. - - The ID of the bucket to write to. - - :param bucket_id: The bucket_id of this ScraperTargetRequest. - :type: str - """ # noqa: E501 - self._bucket_id = bucket_id - - @property - def allow_insecure(self): - """Get the allow_insecure of this ScraperTargetRequest. - - Skip TLS verification on endpoint. - - :return: The allow_insecure of this ScraperTargetRequest. - :rtype: bool - """ # noqa: E501 - return self._allow_insecure - - @allow_insecure.setter - def allow_insecure(self, allow_insecure): - """Set the allow_insecure of this ScraperTargetRequest. - - Skip TLS verification on endpoint. - - :param allow_insecure: The allow_insecure of this ScraperTargetRequest. - :type: bool - """ # noqa: E501 - self._allow_insecure = allow_insecure - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, ScraperTargetRequest): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/scraper_target_response.py b/frogpilot/third_party/influxdb_client/domain/scraper_target_response.py deleted file mode 100644 index 8f40ae0d..00000000 --- a/frogpilot/third_party/influxdb_client/domain/scraper_target_response.py +++ /dev/null @@ -1,200 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.scraper_target_request import ScraperTargetRequest - - -class ScraperTargetResponse(ScraperTargetRequest): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'str', - 'org': 'str', - 'bucket': 'str', - 'links': 'object', - 'name': 'str', - 'type': 'str', - 'url': 'str', - 'org_id': 'str', - 'bucket_id': 'str', - 'allow_insecure': 'bool' - } - - attribute_map = { - 'id': 'id', - 'org': 'org', - 'bucket': 'bucket', - 'links': 'links', - 'name': 'name', - 'type': 'type', - 'url': 'url', - 'org_id': 'orgID', - 'bucket_id': 'bucketID', - 'allow_insecure': 'allowInsecure' - } - - def __init__(self, id=None, org=None, bucket=None, links=None, name=None, type=None, url=None, org_id=None, bucket_id=None, allow_insecure=False): # noqa: E501,D401,D403 - """ScraperTargetResponse - a model defined in OpenAPI.""" # noqa: E501 - ScraperTargetRequest.__init__(self, name=name, type=type, url=url, org_id=org_id, bucket_id=bucket_id, allow_insecure=allow_insecure) # noqa: E501 - - self._id = None - self._org = None - self._bucket = None - self._links = None - self.discriminator = None - - if id is not None: - self.id = id - if org is not None: - self.org = org - if bucket is not None: - self.bucket = bucket - if links is not None: - self.links = links - - @property - def id(self): - """Get the id of this ScraperTargetResponse. - - :return: The id of this ScraperTargetResponse. - :rtype: str - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this ScraperTargetResponse. - - :param id: The id of this ScraperTargetResponse. - :type: str - """ # noqa: E501 - self._id = id - - @property - def org(self): - """Get the org of this ScraperTargetResponse. - - The name of the organization. - - :return: The org of this ScraperTargetResponse. - :rtype: str - """ # noqa: E501 - return self._org - - @org.setter - def org(self, org): - """Set the org of this ScraperTargetResponse. - - The name of the organization. - - :param org: The org of this ScraperTargetResponse. - :type: str - """ # noqa: E501 - self._org = org - - @property - def bucket(self): - """Get the bucket of this ScraperTargetResponse. - - The bucket name. - - :return: The bucket of this ScraperTargetResponse. - :rtype: str - """ # noqa: E501 - return self._bucket - - @bucket.setter - def bucket(self, bucket): - """Set the bucket of this ScraperTargetResponse. - - The bucket name. - - :param bucket: The bucket of this ScraperTargetResponse. - :type: str - """ # noqa: E501 - self._bucket = bucket - - @property - def links(self): - """Get the links of this ScraperTargetResponse. - - :return: The links of this ScraperTargetResponse. - :rtype: object - """ # noqa: E501 - return self._links - - @links.setter - def links(self, links): - """Set the links of this ScraperTargetResponse. - - :param links: The links of this ScraperTargetResponse. - :type: object - """ # noqa: E501 - self._links = links - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, ScraperTargetResponse): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/scraper_target_responses.py b/frogpilot/third_party/influxdb_client/domain/scraper_target_responses.py deleted file mode 100644 index 7e4e477e..00000000 --- a/frogpilot/third_party/influxdb_client/domain/scraper_target_responses.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class ScraperTargetResponses(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'configurations': 'list[ScraperTargetResponse]' - } - - attribute_map = { - 'configurations': 'configurations' - } - - def __init__(self, configurations=None): # noqa: E501,D401,D403 - """ScraperTargetResponses - a model defined in OpenAPI.""" # noqa: E501 - self._configurations = None - self.discriminator = None - - if configurations is not None: - self.configurations = configurations - - @property - def configurations(self): - """Get the configurations of this ScraperTargetResponses. - - :return: The configurations of this ScraperTargetResponses. - :rtype: list[ScraperTargetResponse] - """ # noqa: E501 - return self._configurations - - @configurations.setter - def configurations(self, configurations): - """Set the configurations of this ScraperTargetResponses. - - :param configurations: The configurations of this ScraperTargetResponses. - :type: list[ScraperTargetResponse] - """ # noqa: E501 - self._configurations = configurations - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, ScraperTargetResponses): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/script.py b/frogpilot/third_party/influxdb_client/domain/script.py deleted file mode 100644 index ea2296f7..00000000 --- a/frogpilot/third_party/influxdb_client/domain/script.py +++ /dev/null @@ -1,302 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class Script(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'str', - 'name': 'str', - 'description': 'str', - 'org_id': 'str', - 'script': 'str', - 'language': 'ScriptLanguage', - 'url': 'str', - 'created_at': 'datetime', - 'updated_at': 'datetime' - } - - attribute_map = { - 'id': 'id', - 'name': 'name', - 'description': 'description', - 'org_id': 'orgID', - 'script': 'script', - 'language': 'language', - 'url': 'url', - 'created_at': 'createdAt', - 'updated_at': 'updatedAt' - } - - def __init__(self, id=None, name=None, description=None, org_id=None, script=None, language=None, url=None, created_at=None, updated_at=None): # noqa: E501,D401,D403 - """Script - a model defined in OpenAPI.""" # noqa: E501 - self._id = None - self._name = None - self._description = None - self._org_id = None - self._script = None - self._language = None - self._url = None - self._created_at = None - self._updated_at = None - self.discriminator = None - - if id is not None: - self.id = id - self.name = name - if description is not None: - self.description = description - self.org_id = org_id - self.script = script - if language is not None: - self.language = language - if url is not None: - self.url = url - if created_at is not None: - self.created_at = created_at - if updated_at is not None: - self.updated_at = updated_at - - @property - def id(self): - """Get the id of this Script. - - :return: The id of this Script. - :rtype: str - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this Script. - - :param id: The id of this Script. - :type: str - """ # noqa: E501 - self._id = id - - @property - def name(self): - """Get the name of this Script. - - :return: The name of this Script. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this Script. - - :param name: The name of this Script. - :type: str - """ # noqa: E501 - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - self._name = name - - @property - def description(self): - """Get the description of this Script. - - :return: The description of this Script. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this Script. - - :param description: The description of this Script. - :type: str - """ # noqa: E501 - self._description = description - - @property - def org_id(self): - """Get the org_id of this Script. - - :return: The org_id of this Script. - :rtype: str - """ # noqa: E501 - return self._org_id - - @org_id.setter - def org_id(self, org_id): - """Set the org_id of this Script. - - :param org_id: The org_id of this Script. - :type: str - """ # noqa: E501 - if org_id is None: - raise ValueError("Invalid value for `org_id`, must not be `None`") # noqa: E501 - self._org_id = org_id - - @property - def script(self): - """Get the script of this Script. - - The script to execute. - - :return: The script of this Script. - :rtype: str - """ # noqa: E501 - return self._script - - @script.setter - def script(self, script): - """Set the script of this Script. - - The script to execute. - - :param script: The script of this Script. - :type: str - """ # noqa: E501 - if script is None: - raise ValueError("Invalid value for `script`, must not be `None`") # noqa: E501 - self._script = script - - @property - def language(self): - """Get the language of this Script. - - :return: The language of this Script. - :rtype: ScriptLanguage - """ # noqa: E501 - return self._language - - @language.setter - def language(self, language): - """Set the language of this Script. - - :param language: The language of this Script. - :type: ScriptLanguage - """ # noqa: E501 - self._language = language - - @property - def url(self): - """Get the url of this Script. - - The invocation endpoint address. - - :return: The url of this Script. - :rtype: str - """ # noqa: E501 - return self._url - - @url.setter - def url(self, url): - """Set the url of this Script. - - The invocation endpoint address. - - :param url: The url of this Script. - :type: str - """ # noqa: E501 - self._url = url - - @property - def created_at(self): - """Get the created_at of this Script. - - :return: The created_at of this Script. - :rtype: datetime - """ # noqa: E501 - return self._created_at - - @created_at.setter - def created_at(self, created_at): - """Set the created_at of this Script. - - :param created_at: The created_at of this Script. - :type: datetime - """ # noqa: E501 - self._created_at = created_at - - @property - def updated_at(self): - """Get the updated_at of this Script. - - :return: The updated_at of this Script. - :rtype: datetime - """ # noqa: E501 - return self._updated_at - - @updated_at.setter - def updated_at(self, updated_at): - """Set the updated_at of this Script. - - :param updated_at: The updated_at of this Script. - :type: datetime - """ # noqa: E501 - self._updated_at = updated_at - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Script): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/script_create_request.py b/frogpilot/third_party/influxdb_client/domain/script_create_request.py deleted file mode 100644 index 5af2b5d1..00000000 --- a/frogpilot/third_party/influxdb_client/domain/script_create_request.py +++ /dev/null @@ -1,192 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class ScriptCreateRequest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str', - 'description': 'str', - 'script': 'str', - 'language': 'ScriptLanguage' - } - - attribute_map = { - 'name': 'name', - 'description': 'description', - 'script': 'script', - 'language': 'language' - } - - def __init__(self, name=None, description=None, script=None, language=None): # noqa: E501,D401,D403 - """ScriptCreateRequest - a model defined in OpenAPI.""" # noqa: E501 - self._name = None - self._description = None - self._script = None - self._language = None - self.discriminator = None - - self.name = name - self.description = description - self.script = script - self.language = language - - @property - def name(self): - """Get the name of this ScriptCreateRequest. - - Script name. The name must be unique within the organization. - - :return: The name of this ScriptCreateRequest. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this ScriptCreateRequest. - - Script name. The name must be unique within the organization. - - :param name: The name of this ScriptCreateRequest. - :type: str - """ # noqa: E501 - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - self._name = name - - @property - def description(self): - """Get the description of this ScriptCreateRequest. - - Script description. A description of the script. - - :return: The description of this ScriptCreateRequest. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this ScriptCreateRequest. - - Script description. A description of the script. - - :param description: The description of this ScriptCreateRequest. - :type: str - """ # noqa: E501 - if description is None: - raise ValueError("Invalid value for `description`, must not be `None`") # noqa: E501 - self._description = description - - @property - def script(self): - """Get the script of this ScriptCreateRequest. - - The script to execute. - - :return: The script of this ScriptCreateRequest. - :rtype: str - """ # noqa: E501 - return self._script - - @script.setter - def script(self, script): - """Set the script of this ScriptCreateRequest. - - The script to execute. - - :param script: The script of this ScriptCreateRequest. - :type: str - """ # noqa: E501 - if script is None: - raise ValueError("Invalid value for `script`, must not be `None`") # noqa: E501 - self._script = script - - @property - def language(self): - """Get the language of this ScriptCreateRequest. - - :return: The language of this ScriptCreateRequest. - :rtype: ScriptLanguage - """ # noqa: E501 - return self._language - - @language.setter - def language(self, language): - """Set the language of this ScriptCreateRequest. - - :param language: The language of this ScriptCreateRequest. - :type: ScriptLanguage - """ # noqa: E501 - if language is None: - raise ValueError("Invalid value for `language`, must not be `None`") # noqa: E501 - self._language = language - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, ScriptCreateRequest): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/script_invocation_params.py b/frogpilot/third_party/influxdb_client/domain/script_invocation_params.py deleted file mode 100644 index 1849280f..00000000 --- a/frogpilot/third_party/influxdb_client/domain/script_invocation_params.py +++ /dev/null @@ -1,111 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class ScriptInvocationParams(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'params': 'dict(str, object)' - } - - attribute_map = { - 'params': 'params' - } - - def __init__(self, params=None): # noqa: E501,D401,D403 - """ScriptInvocationParams - a model defined in OpenAPI.""" # noqa: E501 - self._params = None - self.discriminator = None - - if params is not None: - self.params = params - - @property - def params(self): - """Get the params of this ScriptInvocationParams. - - The script parameters. `params` contains key-value pairs that map values to the **params.keys** in a script. When you invoke a script with `params`, InfluxDB passes the values as invocation parameters to the script. - - :return: The params of this ScriptInvocationParams. - :rtype: dict(str, object) - """ # noqa: E501 - return self._params - - @params.setter - def params(self, params): - """Set the params of this ScriptInvocationParams. - - The script parameters. `params` contains key-value pairs that map values to the **params.keys** in a script. When you invoke a script with `params`, InfluxDB passes the values as invocation parameters to the script. - - :param params: The params of this ScriptInvocationParams. - :type: dict(str, object) - """ # noqa: E501 - self._params = params - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, ScriptInvocationParams): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/script_language.py b/frogpilot/third_party/influxdb_client/domain/script_language.py deleted file mode 100644 index 473055e0..00000000 --- a/frogpilot/third_party/influxdb_client/domain/script_language.py +++ /dev/null @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class ScriptLanguage(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - allowed enum values - """ - FLUX = "flux" - SQL = "sql" - INFLUXQL = "influxql" - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501,D401,D403 - """ScriptLanguage - a model defined in OpenAPI.""" # noqa: E501 self.discriminator = None - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, ScriptLanguage): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/script_update_request.py b/frogpilot/third_party/influxdb_client/domain/script_update_request.py deleted file mode 100644 index 36444c71..00000000 --- a/frogpilot/third_party/influxdb_client/domain/script_update_request.py +++ /dev/null @@ -1,138 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class ScriptUpdateRequest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'description': 'str', - 'script': 'str' - } - - attribute_map = { - 'description': 'description', - 'script': 'script' - } - - def __init__(self, description=None, script=None): # noqa: E501,D401,D403 - """ScriptUpdateRequest - a model defined in OpenAPI.""" # noqa: E501 - self._description = None - self._script = None - self.discriminator = None - - if description is not None: - self.description = description - if script is not None: - self.script = script - - @property - def description(self): - """Get the description of this ScriptUpdateRequest. - - A description of the script. - - :return: The description of this ScriptUpdateRequest. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this ScriptUpdateRequest. - - A description of the script. - - :param description: The description of this ScriptUpdateRequest. - :type: str - """ # noqa: E501 - self._description = description - - @property - def script(self): - """Get the script of this ScriptUpdateRequest. - - The script to execute. - - :return: The script of this ScriptUpdateRequest. - :rtype: str - """ # noqa: E501 - return self._script - - @script.setter - def script(self, script): - """Set the script of this ScriptUpdateRequest. - - The script to execute. - - :param script: The script of this ScriptUpdateRequest. - :type: str - """ # noqa: E501 - self._script = script - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, ScriptUpdateRequest): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/scripts.py b/frogpilot/third_party/influxdb_client/domain/scripts.py deleted file mode 100644 index 03ca492b..00000000 --- a/frogpilot/third_party/influxdb_client/domain/scripts.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class Scripts(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'scripts': 'list[Script]' - } - - attribute_map = { - 'scripts': 'scripts' - } - - def __init__(self, scripts=None): # noqa: E501,D401,D403 - """Scripts - a model defined in OpenAPI.""" # noqa: E501 - self._scripts = None - self.discriminator = None - - if scripts is not None: - self.scripts = scripts - - @property - def scripts(self): - """Get the scripts of this Scripts. - - :return: The scripts of this Scripts. - :rtype: list[Script] - """ # noqa: E501 - return self._scripts - - @scripts.setter - def scripts(self, scripts): - """Set the scripts of this Scripts. - - :param scripts: The scripts of this Scripts. - :type: list[Script] - """ # noqa: E501 - self._scripts = scripts - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Scripts): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/secret_keys.py b/frogpilot/third_party/influxdb_client/domain/secret_keys.py deleted file mode 100644 index b935a61f..00000000 --- a/frogpilot/third_party/influxdb_client/domain/secret_keys.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class SecretKeys(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'secrets': 'list[str]' - } - - attribute_map = { - 'secrets': 'secrets' - } - - def __init__(self, secrets=None): # noqa: E501,D401,D403 - """SecretKeys - a model defined in OpenAPI.""" # noqa: E501 - self._secrets = None - self.discriminator = None - - if secrets is not None: - self.secrets = secrets - - @property - def secrets(self): - """Get the secrets of this SecretKeys. - - :return: The secrets of this SecretKeys. - :rtype: list[str] - """ # noqa: E501 - return self._secrets - - @secrets.setter - def secrets(self, secrets): - """Set the secrets of this SecretKeys. - - :param secrets: The secrets of this SecretKeys. - :type: list[str] - """ # noqa: E501 - self._secrets = secrets - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, SecretKeys): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/secret_keys_response.py b/frogpilot/third_party/influxdb_client/domain/secret_keys_response.py deleted file mode 100644 index c9686cf3..00000000 --- a/frogpilot/third_party/influxdb_client/domain/secret_keys_response.py +++ /dev/null @@ -1,113 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.secret_keys import SecretKeys - - -class SecretKeysResponse(SecretKeys): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'links': 'object', - 'secrets': 'list[str]' - } - - attribute_map = { - 'links': 'links', - 'secrets': 'secrets' - } - - def __init__(self, links=None, secrets=None): # noqa: E501,D401,D403 - """SecretKeysResponse - a model defined in OpenAPI.""" # noqa: E501 - SecretKeys.__init__(self, secrets=secrets) # noqa: E501 - - self._links = None - self.discriminator = None - - if links is not None: - self.links = links - - @property - def links(self): - """Get the links of this SecretKeysResponse. - - :return: The links of this SecretKeysResponse. - :rtype: object - """ # noqa: E501 - return self._links - - @links.setter - def links(self, links): - """Set the links of this SecretKeysResponse. - - :param links: The links of this SecretKeysResponse. - :type: object - """ # noqa: E501 - self._links = links - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, SecretKeysResponse): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/shard_group_manifest.py b/frogpilot/third_party/influxdb_client/domain/shard_group_manifest.py deleted file mode 100644 index cd644444..00000000 --- a/frogpilot/third_party/influxdb_client/domain/shard_group_manifest.py +++ /dev/null @@ -1,226 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class ShardGroupManifest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'int', - 'start_time': 'datetime', - 'end_time': 'datetime', - 'deleted_at': 'datetime', - 'truncated_at': 'datetime', - 'shards': 'list[ShardManifest]' - } - - attribute_map = { - 'id': 'id', - 'start_time': 'startTime', - 'end_time': 'endTime', - 'deleted_at': 'deletedAt', - 'truncated_at': 'truncatedAt', - 'shards': 'shards' - } - - def __init__(self, id=None, start_time=None, end_time=None, deleted_at=None, truncated_at=None, shards=None): # noqa: E501,D401,D403 - """ShardGroupManifest - a model defined in OpenAPI.""" # noqa: E501 - self._id = None - self._start_time = None - self._end_time = None - self._deleted_at = None - self._truncated_at = None - self._shards = None - self.discriminator = None - - self.id = id - self.start_time = start_time - self.end_time = end_time - if deleted_at is not None: - self.deleted_at = deleted_at - if truncated_at is not None: - self.truncated_at = truncated_at - self.shards = shards - - @property - def id(self): - """Get the id of this ShardGroupManifest. - - :return: The id of this ShardGroupManifest. - :rtype: int - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this ShardGroupManifest. - - :param id: The id of this ShardGroupManifest. - :type: int - """ # noqa: E501 - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 - self._id = id - - @property - def start_time(self): - """Get the start_time of this ShardGroupManifest. - - :return: The start_time of this ShardGroupManifest. - :rtype: datetime - """ # noqa: E501 - return self._start_time - - @start_time.setter - def start_time(self, start_time): - """Set the start_time of this ShardGroupManifest. - - :param start_time: The start_time of this ShardGroupManifest. - :type: datetime - """ # noqa: E501 - if start_time is None: - raise ValueError("Invalid value for `start_time`, must not be `None`") # noqa: E501 - self._start_time = start_time - - @property - def end_time(self): - """Get the end_time of this ShardGroupManifest. - - :return: The end_time of this ShardGroupManifest. - :rtype: datetime - """ # noqa: E501 - return self._end_time - - @end_time.setter - def end_time(self, end_time): - """Set the end_time of this ShardGroupManifest. - - :param end_time: The end_time of this ShardGroupManifest. - :type: datetime - """ # noqa: E501 - if end_time is None: - raise ValueError("Invalid value for `end_time`, must not be `None`") # noqa: E501 - self._end_time = end_time - - @property - def deleted_at(self): - """Get the deleted_at of this ShardGroupManifest. - - :return: The deleted_at of this ShardGroupManifest. - :rtype: datetime - """ # noqa: E501 - return self._deleted_at - - @deleted_at.setter - def deleted_at(self, deleted_at): - """Set the deleted_at of this ShardGroupManifest. - - :param deleted_at: The deleted_at of this ShardGroupManifest. - :type: datetime - """ # noqa: E501 - self._deleted_at = deleted_at - - @property - def truncated_at(self): - """Get the truncated_at of this ShardGroupManifest. - - :return: The truncated_at of this ShardGroupManifest. - :rtype: datetime - """ # noqa: E501 - return self._truncated_at - - @truncated_at.setter - def truncated_at(self, truncated_at): - """Set the truncated_at of this ShardGroupManifest. - - :param truncated_at: The truncated_at of this ShardGroupManifest. - :type: datetime - """ # noqa: E501 - self._truncated_at = truncated_at - - @property - def shards(self): - """Get the shards of this ShardGroupManifest. - - :return: The shards of this ShardGroupManifest. - :rtype: list[ShardManifest] - """ # noqa: E501 - return self._shards - - @shards.setter - def shards(self, shards): - """Set the shards of this ShardGroupManifest. - - :param shards: The shards of this ShardGroupManifest. - :type: list[ShardManifest] - """ # noqa: E501 - if shards is None: - raise ValueError("Invalid value for `shards`, must not be `None`") # noqa: E501 - self._shards = shards - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, ShardGroupManifest): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/shard_manifest.py b/frogpilot/third_party/influxdb_client/domain/shard_manifest.py deleted file mode 100644 index 1d183465..00000000 --- a/frogpilot/third_party/influxdb_client/domain/shard_manifest.py +++ /dev/null @@ -1,132 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class ShardManifest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'int', - 'shard_owners': 'list[ShardOwner]' - } - - attribute_map = { - 'id': 'id', - 'shard_owners': 'shardOwners' - } - - def __init__(self, id=None, shard_owners=None): # noqa: E501,D401,D403 - """ShardManifest - a model defined in OpenAPI.""" # noqa: E501 - self._id = None - self._shard_owners = None - self.discriminator = None - - self.id = id - self.shard_owners = shard_owners - - @property - def id(self): - """Get the id of this ShardManifest. - - :return: The id of this ShardManifest. - :rtype: int - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this ShardManifest. - - :param id: The id of this ShardManifest. - :type: int - """ # noqa: E501 - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 - self._id = id - - @property - def shard_owners(self): - """Get the shard_owners of this ShardManifest. - - :return: The shard_owners of this ShardManifest. - :rtype: list[ShardOwner] - """ # noqa: E501 - return self._shard_owners - - @shard_owners.setter - def shard_owners(self, shard_owners): - """Set the shard_owners of this ShardManifest. - - :param shard_owners: The shard_owners of this ShardManifest. - :type: list[ShardOwner] - """ # noqa: E501 - if shard_owners is None: - raise ValueError("Invalid value for `shard_owners`, must not be `None`") # noqa: E501 - self._shard_owners = shard_owners - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, ShardManifest): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/shard_owner.py b/frogpilot/third_party/influxdb_client/domain/shard_owner.py deleted file mode 100644 index 3c8232a2..00000000 --- a/frogpilot/third_party/influxdb_client/domain/shard_owner.py +++ /dev/null @@ -1,112 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class ShardOwner(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'node_id': 'int' - } - - attribute_map = { - 'node_id': 'nodeID' - } - - def __init__(self, node_id=None): # noqa: E501,D401,D403 - """ShardOwner - a model defined in OpenAPI.""" # noqa: E501 - self._node_id = None - self.discriminator = None - - self.node_id = node_id - - @property - def node_id(self): - """Get the node_id of this ShardOwner. - - The ID of the node that owns the shard. - - :return: The node_id of this ShardOwner. - :rtype: int - """ # noqa: E501 - return self._node_id - - @node_id.setter - def node_id(self, node_id): - """Set the node_id of this ShardOwner. - - The ID of the node that owns the shard. - - :param node_id: The node_id of this ShardOwner. - :type: int - """ # noqa: E501 - if node_id is None: - raise ValueError("Invalid value for `node_id`, must not be `None`") # noqa: E501 - self._node_id = node_id - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, ShardOwner): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/simple_table_view_properties.py b/frogpilot/third_party/influxdb_client/domain/simple_table_view_properties.py deleted file mode 100644 index 670be209..00000000 --- a/frogpilot/third_party/influxdb_client/domain/simple_table_view_properties.py +++ /dev/null @@ -1,236 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.view_properties import ViewProperties - - -class SimpleTableViewProperties(ViewProperties): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'show_all': 'bool', - 'queries': 'list[DashboardQuery]', - 'shape': 'str', - 'note': 'str', - 'show_note_when_empty': 'bool' - } - - attribute_map = { - 'type': 'type', - 'show_all': 'showAll', - 'queries': 'queries', - 'shape': 'shape', - 'note': 'note', - 'show_note_when_empty': 'showNoteWhenEmpty' - } - - def __init__(self, type=None, show_all=None, queries=None, shape=None, note=None, show_note_when_empty=None): # noqa: E501,D401,D403 - """SimpleTableViewProperties - a model defined in OpenAPI.""" # noqa: E501 - ViewProperties.__init__(self) # noqa: E501 - - self._type = None - self._show_all = None - self._queries = None - self._shape = None - self._note = None - self._show_note_when_empty = None - self.discriminator = None - - self.type = type - self.show_all = show_all - self.queries = queries - self.shape = shape - self.note = note - self.show_note_when_empty = show_note_when_empty - - @property - def type(self): - """Get the type of this SimpleTableViewProperties. - - :return: The type of this SimpleTableViewProperties. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this SimpleTableViewProperties. - - :param type: The type of this SimpleTableViewProperties. - :type: str - """ # noqa: E501 - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - self._type = type - - @property - def show_all(self): - """Get the show_all of this SimpleTableViewProperties. - - :return: The show_all of this SimpleTableViewProperties. - :rtype: bool - """ # noqa: E501 - return self._show_all - - @show_all.setter - def show_all(self, show_all): - """Set the show_all of this SimpleTableViewProperties. - - :param show_all: The show_all of this SimpleTableViewProperties. - :type: bool - """ # noqa: E501 - if show_all is None: - raise ValueError("Invalid value for `show_all`, must not be `None`") # noqa: E501 - self._show_all = show_all - - @property - def queries(self): - """Get the queries of this SimpleTableViewProperties. - - :return: The queries of this SimpleTableViewProperties. - :rtype: list[DashboardQuery] - """ # noqa: E501 - return self._queries - - @queries.setter - def queries(self, queries): - """Set the queries of this SimpleTableViewProperties. - - :param queries: The queries of this SimpleTableViewProperties. - :type: list[DashboardQuery] - """ # noqa: E501 - if queries is None: - raise ValueError("Invalid value for `queries`, must not be `None`") # noqa: E501 - self._queries = queries - - @property - def shape(self): - """Get the shape of this SimpleTableViewProperties. - - :return: The shape of this SimpleTableViewProperties. - :rtype: str - """ # noqa: E501 - return self._shape - - @shape.setter - def shape(self, shape): - """Set the shape of this SimpleTableViewProperties. - - :param shape: The shape of this SimpleTableViewProperties. - :type: str - """ # noqa: E501 - if shape is None: - raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 - self._shape = shape - - @property - def note(self): - """Get the note of this SimpleTableViewProperties. - - :return: The note of this SimpleTableViewProperties. - :rtype: str - """ # noqa: E501 - return self._note - - @note.setter - def note(self, note): - """Set the note of this SimpleTableViewProperties. - - :param note: The note of this SimpleTableViewProperties. - :type: str - """ # noqa: E501 - if note is None: - raise ValueError("Invalid value for `note`, must not be `None`") # noqa: E501 - self._note = note - - @property - def show_note_when_empty(self): - """Get the show_note_when_empty of this SimpleTableViewProperties. - - If true, will display note when empty - - :return: The show_note_when_empty of this SimpleTableViewProperties. - :rtype: bool - """ # noqa: E501 - return self._show_note_when_empty - - @show_note_when_empty.setter - def show_note_when_empty(self, show_note_when_empty): - """Set the show_note_when_empty of this SimpleTableViewProperties. - - If true, will display note when empty - - :param show_note_when_empty: The show_note_when_empty of this SimpleTableViewProperties. - :type: bool - """ # noqa: E501 - if show_note_when_empty is None: - raise ValueError("Invalid value for `show_note_when_empty`, must not be `None`") # noqa: E501 - self._show_note_when_empty = show_note_when_empty - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, SimpleTableViewProperties): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/single_stat_view_properties.py b/frogpilot/third_party/influxdb_client/domain/single_stat_view_properties.py deleted file mode 100644 index cc46240f..00000000 --- a/frogpilot/third_party/influxdb_client/domain/single_stat_view_properties.py +++ /dev/null @@ -1,383 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.view_properties import ViewProperties - - -class SingleStatViewProperties(ViewProperties): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'queries': 'list[DashboardQuery]', - 'colors': 'list[DashboardColor]', - 'shape': 'str', - 'note': 'str', - 'show_note_when_empty': 'bool', - 'prefix': 'str', - 'tick_prefix': 'str', - 'suffix': 'str', - 'tick_suffix': 'str', - 'static_legend': 'StaticLegend', - 'decimal_places': 'DecimalPlaces' - } - - attribute_map = { - 'type': 'type', - 'queries': 'queries', - 'colors': 'colors', - 'shape': 'shape', - 'note': 'note', - 'show_note_when_empty': 'showNoteWhenEmpty', - 'prefix': 'prefix', - 'tick_prefix': 'tickPrefix', - 'suffix': 'suffix', - 'tick_suffix': 'tickSuffix', - 'static_legend': 'staticLegend', - 'decimal_places': 'decimalPlaces' - } - - def __init__(self, type=None, queries=None, colors=None, shape=None, note=None, show_note_when_empty=None, prefix=None, tick_prefix=None, suffix=None, tick_suffix=None, static_legend=None, decimal_places=None): # noqa: E501,D401,D403 - """SingleStatViewProperties - a model defined in OpenAPI.""" # noqa: E501 - ViewProperties.__init__(self) # noqa: E501 - - self._type = None - self._queries = None - self._colors = None - self._shape = None - self._note = None - self._show_note_when_empty = None - self._prefix = None - self._tick_prefix = None - self._suffix = None - self._tick_suffix = None - self._static_legend = None - self._decimal_places = None - self.discriminator = None - - self.type = type - self.queries = queries - self.colors = colors - self.shape = shape - self.note = note - self.show_note_when_empty = show_note_when_empty - self.prefix = prefix - self.tick_prefix = tick_prefix - self.suffix = suffix - self.tick_suffix = tick_suffix - if static_legend is not None: - self.static_legend = static_legend - self.decimal_places = decimal_places - - @property - def type(self): - """Get the type of this SingleStatViewProperties. - - :return: The type of this SingleStatViewProperties. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this SingleStatViewProperties. - - :param type: The type of this SingleStatViewProperties. - :type: str - """ # noqa: E501 - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - self._type = type - - @property - def queries(self): - """Get the queries of this SingleStatViewProperties. - - :return: The queries of this SingleStatViewProperties. - :rtype: list[DashboardQuery] - """ # noqa: E501 - return self._queries - - @queries.setter - def queries(self, queries): - """Set the queries of this SingleStatViewProperties. - - :param queries: The queries of this SingleStatViewProperties. - :type: list[DashboardQuery] - """ # noqa: E501 - if queries is None: - raise ValueError("Invalid value for `queries`, must not be `None`") # noqa: E501 - self._queries = queries - - @property - def colors(self): - """Get the colors of this SingleStatViewProperties. - - Colors define color encoding of data into a visualization - - :return: The colors of this SingleStatViewProperties. - :rtype: list[DashboardColor] - """ # noqa: E501 - return self._colors - - @colors.setter - def colors(self, colors): - """Set the colors of this SingleStatViewProperties. - - Colors define color encoding of data into a visualization - - :param colors: The colors of this SingleStatViewProperties. - :type: list[DashboardColor] - """ # noqa: E501 - if colors is None: - raise ValueError("Invalid value for `colors`, must not be `None`") # noqa: E501 - self._colors = colors - - @property - def shape(self): - """Get the shape of this SingleStatViewProperties. - - :return: The shape of this SingleStatViewProperties. - :rtype: str - """ # noqa: E501 - return self._shape - - @shape.setter - def shape(self, shape): - """Set the shape of this SingleStatViewProperties. - - :param shape: The shape of this SingleStatViewProperties. - :type: str - """ # noqa: E501 - if shape is None: - raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 - self._shape = shape - - @property - def note(self): - """Get the note of this SingleStatViewProperties. - - :return: The note of this SingleStatViewProperties. - :rtype: str - """ # noqa: E501 - return self._note - - @note.setter - def note(self, note): - """Set the note of this SingleStatViewProperties. - - :param note: The note of this SingleStatViewProperties. - :type: str - """ # noqa: E501 - if note is None: - raise ValueError("Invalid value for `note`, must not be `None`") # noqa: E501 - self._note = note - - @property - def show_note_when_empty(self): - """Get the show_note_when_empty of this SingleStatViewProperties. - - If true, will display note when empty - - :return: The show_note_when_empty of this SingleStatViewProperties. - :rtype: bool - """ # noqa: E501 - return self._show_note_when_empty - - @show_note_when_empty.setter - def show_note_when_empty(self, show_note_when_empty): - """Set the show_note_when_empty of this SingleStatViewProperties. - - If true, will display note when empty - - :param show_note_when_empty: The show_note_when_empty of this SingleStatViewProperties. - :type: bool - """ # noqa: E501 - if show_note_when_empty is None: - raise ValueError("Invalid value for `show_note_when_empty`, must not be `None`") # noqa: E501 - self._show_note_when_empty = show_note_when_empty - - @property - def prefix(self): - """Get the prefix of this SingleStatViewProperties. - - :return: The prefix of this SingleStatViewProperties. - :rtype: str - """ # noqa: E501 - return self._prefix - - @prefix.setter - def prefix(self, prefix): - """Set the prefix of this SingleStatViewProperties. - - :param prefix: The prefix of this SingleStatViewProperties. - :type: str - """ # noqa: E501 - if prefix is None: - raise ValueError("Invalid value for `prefix`, must not be `None`") # noqa: E501 - self._prefix = prefix - - @property - def tick_prefix(self): - """Get the tick_prefix of this SingleStatViewProperties. - - :return: The tick_prefix of this SingleStatViewProperties. - :rtype: str - """ # noqa: E501 - return self._tick_prefix - - @tick_prefix.setter - def tick_prefix(self, tick_prefix): - """Set the tick_prefix of this SingleStatViewProperties. - - :param tick_prefix: The tick_prefix of this SingleStatViewProperties. - :type: str - """ # noqa: E501 - if tick_prefix is None: - raise ValueError("Invalid value for `tick_prefix`, must not be `None`") # noqa: E501 - self._tick_prefix = tick_prefix - - @property - def suffix(self): - """Get the suffix of this SingleStatViewProperties. - - :return: The suffix of this SingleStatViewProperties. - :rtype: str - """ # noqa: E501 - return self._suffix - - @suffix.setter - def suffix(self, suffix): - """Set the suffix of this SingleStatViewProperties. - - :param suffix: The suffix of this SingleStatViewProperties. - :type: str - """ # noqa: E501 - if suffix is None: - raise ValueError("Invalid value for `suffix`, must not be `None`") # noqa: E501 - self._suffix = suffix - - @property - def tick_suffix(self): - """Get the tick_suffix of this SingleStatViewProperties. - - :return: The tick_suffix of this SingleStatViewProperties. - :rtype: str - """ # noqa: E501 - return self._tick_suffix - - @tick_suffix.setter - def tick_suffix(self, tick_suffix): - """Set the tick_suffix of this SingleStatViewProperties. - - :param tick_suffix: The tick_suffix of this SingleStatViewProperties. - :type: str - """ # noqa: E501 - if tick_suffix is None: - raise ValueError("Invalid value for `tick_suffix`, must not be `None`") # noqa: E501 - self._tick_suffix = tick_suffix - - @property - def static_legend(self): - """Get the static_legend of this SingleStatViewProperties. - - :return: The static_legend of this SingleStatViewProperties. - :rtype: StaticLegend - """ # noqa: E501 - return self._static_legend - - @static_legend.setter - def static_legend(self, static_legend): - """Set the static_legend of this SingleStatViewProperties. - - :param static_legend: The static_legend of this SingleStatViewProperties. - :type: StaticLegend - """ # noqa: E501 - self._static_legend = static_legend - - @property - def decimal_places(self): - """Get the decimal_places of this SingleStatViewProperties. - - :return: The decimal_places of this SingleStatViewProperties. - :rtype: DecimalPlaces - """ # noqa: E501 - return self._decimal_places - - @decimal_places.setter - def decimal_places(self, decimal_places): - """Set the decimal_places of this SingleStatViewProperties. - - :param decimal_places: The decimal_places of this SingleStatViewProperties. - :type: DecimalPlaces - """ # noqa: E501 - if decimal_places is None: - raise ValueError("Invalid value for `decimal_places`, must not be `None`") # noqa: E501 - self._decimal_places = decimal_places - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, SingleStatViewProperties): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/slack_notification_endpoint.py b/frogpilot/third_party/influxdb_client/domain/slack_notification_endpoint.py deleted file mode 100644 index d619a4c8..00000000 --- a/frogpilot/third_party/influxdb_client/domain/slack_notification_endpoint.py +++ /dev/null @@ -1,164 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.notification_endpoint_discriminator import NotificationEndpointDiscriminator - - -class SlackNotificationEndpoint(NotificationEndpointDiscriminator): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'url': 'str', - 'token': 'str', - 'id': 'str', - 'org_id': 'str', - 'user_id': 'str', - 'created_at': 'datetime', - 'updated_at': 'datetime', - 'description': 'str', - 'name': 'str', - 'status': 'str', - 'labels': 'list[Label]', - 'links': 'NotificationEndpointBaseLinks', - 'type': 'NotificationEndpointType' - } - - attribute_map = { - 'url': 'url', - 'token': 'token', - 'id': 'id', - 'org_id': 'orgID', - 'user_id': 'userID', - 'created_at': 'createdAt', - 'updated_at': 'updatedAt', - 'description': 'description', - 'name': 'name', - 'status': 'status', - 'labels': 'labels', - 'links': 'links', - 'type': 'type' - } - - def __init__(self, url=None, token=None, id=None, org_id=None, user_id=None, created_at=None, updated_at=None, description=None, name=None, status='active', labels=None, links=None, type="slack"): # noqa: E501,D401,D403 - """SlackNotificationEndpoint - a model defined in OpenAPI.""" # noqa: E501 - NotificationEndpointDiscriminator.__init__(self, id=id, org_id=org_id, user_id=user_id, created_at=created_at, updated_at=updated_at, description=description, name=name, status=status, labels=labels, links=links, type=type) # noqa: E501 - - self._url = None - self._token = None - self.discriminator = None - - if url is not None: - self.url = url - if token is not None: - self.token = token - - @property - def url(self): - """Get the url of this SlackNotificationEndpoint. - - Specifies the URL of the Slack endpoint. Specify either `URL` or `Token`. - - :return: The url of this SlackNotificationEndpoint. - :rtype: str - """ # noqa: E501 - return self._url - - @url.setter - def url(self, url): - """Set the url of this SlackNotificationEndpoint. - - Specifies the URL of the Slack endpoint. Specify either `URL` or `Token`. - - :param url: The url of this SlackNotificationEndpoint. - :type: str - """ # noqa: E501 - self._url = url - - @property - def token(self): - """Get the token of this SlackNotificationEndpoint. - - Specifies the API token string. Specify either `URL` or `Token`. - - :return: The token of this SlackNotificationEndpoint. - :rtype: str - """ # noqa: E501 - return self._token - - @token.setter - def token(self, token): - """Set the token of this SlackNotificationEndpoint. - - Specifies the API token string. Specify either `URL` or `Token`. - - :param token: The token of this SlackNotificationEndpoint. - :type: str - """ # noqa: E501 - self._token = token - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, SlackNotificationEndpoint): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/slack_notification_rule.py b/frogpilot/third_party/influxdb_client/domain/slack_notification_rule.py deleted file mode 100644 index c7cd5b29..00000000 --- a/frogpilot/third_party/influxdb_client/domain/slack_notification_rule.py +++ /dev/null @@ -1,138 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.slack_notification_rule_base import SlackNotificationRuleBase - - -class SlackNotificationRule(SlackNotificationRuleBase): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'channel': 'str', - 'message_template': 'str', - 'latest_completed': 'datetime', - 'last_run_status': 'str', - 'last_run_error': 'str', - 'id': 'str', - 'endpoint_id': 'str', - 'org_id': 'str', - 'task_id': 'str', - 'owner_id': 'str', - 'created_at': 'datetime', - 'updated_at': 'datetime', - 'status': 'TaskStatusType', - 'name': 'str', - 'sleep_until': 'str', - 'every': 'str', - 'offset': 'str', - 'runbook_link': 'str', - 'limit_every': 'int', - 'limit': 'int', - 'tag_rules': 'list[TagRule]', - 'description': 'str', - 'status_rules': 'list[StatusRule]', - 'labels': 'list[Label]', - 'links': 'NotificationRuleBaseLinks' - } - - attribute_map = { - 'type': 'type', - 'channel': 'channel', - 'message_template': 'messageTemplate', - 'latest_completed': 'latestCompleted', - 'last_run_status': 'lastRunStatus', - 'last_run_error': 'lastRunError', - 'id': 'id', - 'endpoint_id': 'endpointID', - 'org_id': 'orgID', - 'task_id': 'taskID', - 'owner_id': 'ownerID', - 'created_at': 'createdAt', - 'updated_at': 'updatedAt', - 'status': 'status', - 'name': 'name', - 'sleep_until': 'sleepUntil', - 'every': 'every', - 'offset': 'offset', - 'runbook_link': 'runbookLink', - 'limit_every': 'limitEvery', - 'limit': 'limit', - 'tag_rules': 'tagRules', - 'description': 'description', - 'status_rules': 'statusRules', - 'labels': 'labels', - 'links': 'links' - } - - def __init__(self, type="slack", channel=None, message_template=None, latest_completed=None, last_run_status=None, last_run_error=None, id=None, endpoint_id=None, org_id=None, task_id=None, owner_id=None, created_at=None, updated_at=None, status=None, name=None, sleep_until=None, every=None, offset=None, runbook_link=None, limit_every=None, limit=None, tag_rules=None, description=None, status_rules=None, labels=None, links=None): # noqa: E501,D401,D403 - """SlackNotificationRule - a model defined in OpenAPI.""" # noqa: E501 - SlackNotificationRuleBase.__init__(self, type=type, channel=channel, message_template=message_template, latest_completed=latest_completed, last_run_status=last_run_status, last_run_error=last_run_error, id=id, endpoint_id=endpoint_id, org_id=org_id, task_id=task_id, owner_id=owner_id, created_at=created_at, updated_at=updated_at, status=status, name=name, sleep_until=sleep_until, every=every, offset=offset, runbook_link=runbook_link, limit_every=limit_every, limit=limit, tag_rules=tag_rules, description=description, status_rules=status_rules, labels=labels, links=links) # noqa: E501 - self.discriminator = None - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, SlackNotificationRule): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/slack_notification_rule_base.py b/frogpilot/third_party/influxdb_client/domain/slack_notification_rule_base.py deleted file mode 100644 index 923a5dfe..00000000 --- a/frogpilot/third_party/influxdb_client/domain/slack_notification_rule_base.py +++ /dev/null @@ -1,205 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.notification_rule_discriminator import NotificationRuleDiscriminator - - -class SlackNotificationRuleBase(NotificationRuleDiscriminator): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'channel': 'str', - 'message_template': 'str', - 'latest_completed': 'datetime', - 'last_run_status': 'str', - 'last_run_error': 'str', - 'id': 'str', - 'endpoint_id': 'str', - 'org_id': 'str', - 'task_id': 'str', - 'owner_id': 'str', - 'created_at': 'datetime', - 'updated_at': 'datetime', - 'status': 'TaskStatusType', - 'name': 'str', - 'sleep_until': 'str', - 'every': 'str', - 'offset': 'str', - 'runbook_link': 'str', - 'limit_every': 'int', - 'limit': 'int', - 'tag_rules': 'list[TagRule]', - 'description': 'str', - 'status_rules': 'list[StatusRule]', - 'labels': 'list[Label]', - 'links': 'NotificationRuleBaseLinks' - } - - attribute_map = { - 'type': 'type', - 'channel': 'channel', - 'message_template': 'messageTemplate', - 'latest_completed': 'latestCompleted', - 'last_run_status': 'lastRunStatus', - 'last_run_error': 'lastRunError', - 'id': 'id', - 'endpoint_id': 'endpointID', - 'org_id': 'orgID', - 'task_id': 'taskID', - 'owner_id': 'ownerID', - 'created_at': 'createdAt', - 'updated_at': 'updatedAt', - 'status': 'status', - 'name': 'name', - 'sleep_until': 'sleepUntil', - 'every': 'every', - 'offset': 'offset', - 'runbook_link': 'runbookLink', - 'limit_every': 'limitEvery', - 'limit': 'limit', - 'tag_rules': 'tagRules', - 'description': 'description', - 'status_rules': 'statusRules', - 'labels': 'labels', - 'links': 'links' - } - - def __init__(self, type=None, channel=None, message_template=None, latest_completed=None, last_run_status=None, last_run_error=None, id=None, endpoint_id=None, org_id=None, task_id=None, owner_id=None, created_at=None, updated_at=None, status=None, name=None, sleep_until=None, every=None, offset=None, runbook_link=None, limit_every=None, limit=None, tag_rules=None, description=None, status_rules=None, labels=None, links=None): # noqa: E501,D401,D403 - """SlackNotificationRuleBase - a model defined in OpenAPI.""" # noqa: E501 - NotificationRuleDiscriminator.__init__(self, latest_completed=latest_completed, last_run_status=last_run_status, last_run_error=last_run_error, id=id, endpoint_id=endpoint_id, org_id=org_id, task_id=task_id, owner_id=owner_id, created_at=created_at, updated_at=updated_at, status=status, name=name, sleep_until=sleep_until, every=every, offset=offset, runbook_link=runbook_link, limit_every=limit_every, limit=limit, tag_rules=tag_rules, description=description, status_rules=status_rules, labels=labels, links=links) # noqa: E501 - - self._type = None - self._channel = None - self._message_template = None - self.discriminator = None - - self.type = type - if channel is not None: - self.channel = channel - self.message_template = message_template - - @property - def type(self): - """Get the type of this SlackNotificationRuleBase. - - :return: The type of this SlackNotificationRuleBase. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this SlackNotificationRuleBase. - - :param type: The type of this SlackNotificationRuleBase. - :type: str - """ # noqa: E501 - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - self._type = type - - @property - def channel(self): - """Get the channel of this SlackNotificationRuleBase. - - :return: The channel of this SlackNotificationRuleBase. - :rtype: str - """ # noqa: E501 - return self._channel - - @channel.setter - def channel(self, channel): - """Set the channel of this SlackNotificationRuleBase. - - :param channel: The channel of this SlackNotificationRuleBase. - :type: str - """ # noqa: E501 - self._channel = channel - - @property - def message_template(self): - """Get the message_template of this SlackNotificationRuleBase. - - :return: The message_template of this SlackNotificationRuleBase. - :rtype: str - """ # noqa: E501 - return self._message_template - - @message_template.setter - def message_template(self, message_template): - """Set the message_template of this SlackNotificationRuleBase. - - :param message_template: The message_template of this SlackNotificationRuleBase. - :type: str - """ # noqa: E501 - if message_template is None: - raise ValueError("Invalid value for `message_template`, must not be `None`") # noqa: E501 - self._message_template = message_template - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, SlackNotificationRuleBase): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/smtp_notification_rule.py b/frogpilot/third_party/influxdb_client/domain/smtp_notification_rule.py deleted file mode 100644 index d9107327..00000000 --- a/frogpilot/third_party/influxdb_client/domain/smtp_notification_rule.py +++ /dev/null @@ -1,140 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.smtp_notification_rule_base import SMTPNotificationRuleBase - - -class SMTPNotificationRule(SMTPNotificationRuleBase): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'subject_template': 'str', - 'body_template': 'str', - 'to': 'str', - 'latest_completed': 'datetime', - 'last_run_status': 'str', - 'last_run_error': 'str', - 'id': 'str', - 'endpoint_id': 'str', - 'org_id': 'str', - 'task_id': 'str', - 'owner_id': 'str', - 'created_at': 'datetime', - 'updated_at': 'datetime', - 'status': 'TaskStatusType', - 'name': 'str', - 'sleep_until': 'str', - 'every': 'str', - 'offset': 'str', - 'runbook_link': 'str', - 'limit_every': 'int', - 'limit': 'int', - 'tag_rules': 'list[TagRule]', - 'description': 'str', - 'status_rules': 'list[StatusRule]', - 'labels': 'list[Label]', - 'links': 'NotificationRuleBaseLinks' - } - - attribute_map = { - 'type': 'type', - 'subject_template': 'subjectTemplate', - 'body_template': 'bodyTemplate', - 'to': 'to', - 'latest_completed': 'latestCompleted', - 'last_run_status': 'lastRunStatus', - 'last_run_error': 'lastRunError', - 'id': 'id', - 'endpoint_id': 'endpointID', - 'org_id': 'orgID', - 'task_id': 'taskID', - 'owner_id': 'ownerID', - 'created_at': 'createdAt', - 'updated_at': 'updatedAt', - 'status': 'status', - 'name': 'name', - 'sleep_until': 'sleepUntil', - 'every': 'every', - 'offset': 'offset', - 'runbook_link': 'runbookLink', - 'limit_every': 'limitEvery', - 'limit': 'limit', - 'tag_rules': 'tagRules', - 'description': 'description', - 'status_rules': 'statusRules', - 'labels': 'labels', - 'links': 'links' - } - - def __init__(self, type="smtp", subject_template=None, body_template=None, to=None, latest_completed=None, last_run_status=None, last_run_error=None, id=None, endpoint_id=None, org_id=None, task_id=None, owner_id=None, created_at=None, updated_at=None, status=None, name=None, sleep_until=None, every=None, offset=None, runbook_link=None, limit_every=None, limit=None, tag_rules=None, description=None, status_rules=None, labels=None, links=None): # noqa: E501,D401,D403 - """SMTPNotificationRule - a model defined in OpenAPI.""" # noqa: E501 - SMTPNotificationRuleBase.__init__(self, type=type, subject_template=subject_template, body_template=body_template, to=to, latest_completed=latest_completed, last_run_status=last_run_status, last_run_error=last_run_error, id=id, endpoint_id=endpoint_id, org_id=org_id, task_id=task_id, owner_id=owner_id, created_at=created_at, updated_at=updated_at, status=status, name=name, sleep_until=sleep_until, every=every, offset=offset, runbook_link=runbook_link, limit_every=limit_every, limit=limit, tag_rules=tag_rules, description=description, status_rules=status_rules, labels=labels, links=links) # noqa: E501 - self.discriminator = None - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, SMTPNotificationRule): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/smtp_notification_rule_base.py b/frogpilot/third_party/influxdb_client/domain/smtp_notification_rule_base.py deleted file mode 100644 index 18cbae11..00000000 --- a/frogpilot/third_party/influxdb_client/domain/smtp_notification_rule_base.py +++ /dev/null @@ -1,229 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.notification_rule_discriminator import NotificationRuleDiscriminator - - -class SMTPNotificationRuleBase(NotificationRuleDiscriminator): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'subject_template': 'str', - 'body_template': 'str', - 'to': 'str', - 'latest_completed': 'datetime', - 'last_run_status': 'str', - 'last_run_error': 'str', - 'id': 'str', - 'endpoint_id': 'str', - 'org_id': 'str', - 'task_id': 'str', - 'owner_id': 'str', - 'created_at': 'datetime', - 'updated_at': 'datetime', - 'status': 'TaskStatusType', - 'name': 'str', - 'sleep_until': 'str', - 'every': 'str', - 'offset': 'str', - 'runbook_link': 'str', - 'limit_every': 'int', - 'limit': 'int', - 'tag_rules': 'list[TagRule]', - 'description': 'str', - 'status_rules': 'list[StatusRule]', - 'labels': 'list[Label]', - 'links': 'NotificationRuleBaseLinks' - } - - attribute_map = { - 'type': 'type', - 'subject_template': 'subjectTemplate', - 'body_template': 'bodyTemplate', - 'to': 'to', - 'latest_completed': 'latestCompleted', - 'last_run_status': 'lastRunStatus', - 'last_run_error': 'lastRunError', - 'id': 'id', - 'endpoint_id': 'endpointID', - 'org_id': 'orgID', - 'task_id': 'taskID', - 'owner_id': 'ownerID', - 'created_at': 'createdAt', - 'updated_at': 'updatedAt', - 'status': 'status', - 'name': 'name', - 'sleep_until': 'sleepUntil', - 'every': 'every', - 'offset': 'offset', - 'runbook_link': 'runbookLink', - 'limit_every': 'limitEvery', - 'limit': 'limit', - 'tag_rules': 'tagRules', - 'description': 'description', - 'status_rules': 'statusRules', - 'labels': 'labels', - 'links': 'links' - } - - def __init__(self, type=None, subject_template=None, body_template=None, to=None, latest_completed=None, last_run_status=None, last_run_error=None, id=None, endpoint_id=None, org_id=None, task_id=None, owner_id=None, created_at=None, updated_at=None, status=None, name=None, sleep_until=None, every=None, offset=None, runbook_link=None, limit_every=None, limit=None, tag_rules=None, description=None, status_rules=None, labels=None, links=None): # noqa: E501,D401,D403 - """SMTPNotificationRuleBase - a model defined in OpenAPI.""" # noqa: E501 - NotificationRuleDiscriminator.__init__(self, latest_completed=latest_completed, last_run_status=last_run_status, last_run_error=last_run_error, id=id, endpoint_id=endpoint_id, org_id=org_id, task_id=task_id, owner_id=owner_id, created_at=created_at, updated_at=updated_at, status=status, name=name, sleep_until=sleep_until, every=every, offset=offset, runbook_link=runbook_link, limit_every=limit_every, limit=limit, tag_rules=tag_rules, description=description, status_rules=status_rules, labels=labels, links=links) # noqa: E501 - - self._type = None - self._subject_template = None - self._body_template = None - self._to = None - self.discriminator = None - - self.type = type - self.subject_template = subject_template - if body_template is not None: - self.body_template = body_template - self.to = to - - @property - def type(self): - """Get the type of this SMTPNotificationRuleBase. - - :return: The type of this SMTPNotificationRuleBase. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this SMTPNotificationRuleBase. - - :param type: The type of this SMTPNotificationRuleBase. - :type: str - """ # noqa: E501 - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - self._type = type - - @property - def subject_template(self): - """Get the subject_template of this SMTPNotificationRuleBase. - - :return: The subject_template of this SMTPNotificationRuleBase. - :rtype: str - """ # noqa: E501 - return self._subject_template - - @subject_template.setter - def subject_template(self, subject_template): - """Set the subject_template of this SMTPNotificationRuleBase. - - :param subject_template: The subject_template of this SMTPNotificationRuleBase. - :type: str - """ # noqa: E501 - if subject_template is None: - raise ValueError("Invalid value for `subject_template`, must not be `None`") # noqa: E501 - self._subject_template = subject_template - - @property - def body_template(self): - """Get the body_template of this SMTPNotificationRuleBase. - - :return: The body_template of this SMTPNotificationRuleBase. - :rtype: str - """ # noqa: E501 - return self._body_template - - @body_template.setter - def body_template(self, body_template): - """Set the body_template of this SMTPNotificationRuleBase. - - :param body_template: The body_template of this SMTPNotificationRuleBase. - :type: str - """ # noqa: E501 - self._body_template = body_template - - @property - def to(self): - """Get the to of this SMTPNotificationRuleBase. - - :return: The to of this SMTPNotificationRuleBase. - :rtype: str - """ # noqa: E501 - return self._to - - @to.setter - def to(self, to): - """Set the to of this SMTPNotificationRuleBase. - - :param to: The to of this SMTPNotificationRuleBase. - :type: str - """ # noqa: E501 - if to is None: - raise ValueError("Invalid value for `to`, must not be `None`") # noqa: E501 - self._to = to - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, SMTPNotificationRuleBase): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/source.py b/frogpilot/third_party/influxdb_client/domain/source.py deleted file mode 100644 index c45cb12a..00000000 --- a/frogpilot/third_party/influxdb_client/domain/source.py +++ /dev/null @@ -1,459 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class Source(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'links': 'SourceLinks', - 'id': 'str', - 'org_id': 'str', - 'default': 'bool', - 'name': 'str', - 'type': 'str', - 'url': 'str', - 'insecure_skip_verify': 'bool', - 'telegraf': 'str', - 'token': 'str', - 'username': 'str', - 'password': 'str', - 'shared_secret': 'str', - 'meta_url': 'str', - 'default_rp': 'str', - 'languages': 'list[str]' - } - - attribute_map = { - 'links': 'links', - 'id': 'id', - 'org_id': 'orgID', - 'default': 'default', - 'name': 'name', - 'type': 'type', - 'url': 'url', - 'insecure_skip_verify': 'insecureSkipVerify', - 'telegraf': 'telegraf', - 'token': 'token', - 'username': 'username', - 'password': 'password', - 'shared_secret': 'sharedSecret', - 'meta_url': 'metaUrl', - 'default_rp': 'defaultRP', - 'languages': 'languages' - } - - def __init__(self, links=None, id=None, org_id=None, default=None, name=None, type=None, url=None, insecure_skip_verify=None, telegraf=None, token=None, username=None, password=None, shared_secret=None, meta_url=None, default_rp=None, languages=None): # noqa: E501,D401,D403 - """Source - a model defined in OpenAPI.""" # noqa: E501 - self._links = None - self._id = None - self._org_id = None - self._default = None - self._name = None - self._type = None - self._url = None - self._insecure_skip_verify = None - self._telegraf = None - self._token = None - self._username = None - self._password = None - self._shared_secret = None - self._meta_url = None - self._default_rp = None - self._languages = None - self.discriminator = None - - if links is not None: - self.links = links - if id is not None: - self.id = id - if org_id is not None: - self.org_id = org_id - if default is not None: - self.default = default - if name is not None: - self.name = name - if type is not None: - self.type = type - if url is not None: - self.url = url - if insecure_skip_verify is not None: - self.insecure_skip_verify = insecure_skip_verify - if telegraf is not None: - self.telegraf = telegraf - if token is not None: - self.token = token - if username is not None: - self.username = username - if password is not None: - self.password = password - if shared_secret is not None: - self.shared_secret = shared_secret - if meta_url is not None: - self.meta_url = meta_url - if default_rp is not None: - self.default_rp = default_rp - if languages is not None: - self.languages = languages - - @property - def links(self): - """Get the links of this Source. - - :return: The links of this Source. - :rtype: SourceLinks - """ # noqa: E501 - return self._links - - @links.setter - def links(self, links): - """Set the links of this Source. - - :param links: The links of this Source. - :type: SourceLinks - """ # noqa: E501 - self._links = links - - @property - def id(self): - """Get the id of this Source. - - :return: The id of this Source. - :rtype: str - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this Source. - - :param id: The id of this Source. - :type: str - """ # noqa: E501 - self._id = id - - @property - def org_id(self): - """Get the org_id of this Source. - - :return: The org_id of this Source. - :rtype: str - """ # noqa: E501 - return self._org_id - - @org_id.setter - def org_id(self, org_id): - """Set the org_id of this Source. - - :param org_id: The org_id of this Source. - :type: str - """ # noqa: E501 - self._org_id = org_id - - @property - def default(self): - """Get the default of this Source. - - :return: The default of this Source. - :rtype: bool - """ # noqa: E501 - return self._default - - @default.setter - def default(self, default): - """Set the default of this Source. - - :param default: The default of this Source. - :type: bool - """ # noqa: E501 - self._default = default - - @property - def name(self): - """Get the name of this Source. - - :return: The name of this Source. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this Source. - - :param name: The name of this Source. - :type: str - """ # noqa: E501 - self._name = name - - @property - def type(self): - """Get the type of this Source. - - :return: The type of this Source. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this Source. - - :param type: The type of this Source. - :type: str - """ # noqa: E501 - self._type = type - - @property - def url(self): - """Get the url of this Source. - - :return: The url of this Source. - :rtype: str - """ # noqa: E501 - return self._url - - @url.setter - def url(self, url): - """Set the url of this Source. - - :param url: The url of this Source. - :type: str - """ # noqa: E501 - self._url = url - - @property - def insecure_skip_verify(self): - """Get the insecure_skip_verify of this Source. - - :return: The insecure_skip_verify of this Source. - :rtype: bool - """ # noqa: E501 - return self._insecure_skip_verify - - @insecure_skip_verify.setter - def insecure_skip_verify(self, insecure_skip_verify): - """Set the insecure_skip_verify of this Source. - - :param insecure_skip_verify: The insecure_skip_verify of this Source. - :type: bool - """ # noqa: E501 - self._insecure_skip_verify = insecure_skip_verify - - @property - def telegraf(self): - """Get the telegraf of this Source. - - :return: The telegraf of this Source. - :rtype: str - """ # noqa: E501 - return self._telegraf - - @telegraf.setter - def telegraf(self, telegraf): - """Set the telegraf of this Source. - - :param telegraf: The telegraf of this Source. - :type: str - """ # noqa: E501 - self._telegraf = telegraf - - @property - def token(self): - """Get the token of this Source. - - :return: The token of this Source. - :rtype: str - """ # noqa: E501 - return self._token - - @token.setter - def token(self, token): - """Set the token of this Source. - - :param token: The token of this Source. - :type: str - """ # noqa: E501 - self._token = token - - @property - def username(self): - """Get the username of this Source. - - :return: The username of this Source. - :rtype: str - """ # noqa: E501 - return self._username - - @username.setter - def username(self, username): - """Set the username of this Source. - - :param username: The username of this Source. - :type: str - """ # noqa: E501 - self._username = username - - @property - def password(self): - """Get the password of this Source. - - :return: The password of this Source. - :rtype: str - """ # noqa: E501 - return self._password - - @password.setter - def password(self, password): - """Set the password of this Source. - - :param password: The password of this Source. - :type: str - """ # noqa: E501 - self._password = password - - @property - def shared_secret(self): - """Get the shared_secret of this Source. - - :return: The shared_secret of this Source. - :rtype: str - """ # noqa: E501 - return self._shared_secret - - @shared_secret.setter - def shared_secret(self, shared_secret): - """Set the shared_secret of this Source. - - :param shared_secret: The shared_secret of this Source. - :type: str - """ # noqa: E501 - self._shared_secret = shared_secret - - @property - def meta_url(self): - """Get the meta_url of this Source. - - :return: The meta_url of this Source. - :rtype: str - """ # noqa: E501 - return self._meta_url - - @meta_url.setter - def meta_url(self, meta_url): - """Set the meta_url of this Source. - - :param meta_url: The meta_url of this Source. - :type: str - """ # noqa: E501 - self._meta_url = meta_url - - @property - def default_rp(self): - """Get the default_rp of this Source. - - :return: The default_rp of this Source. - :rtype: str - """ # noqa: E501 - return self._default_rp - - @default_rp.setter - def default_rp(self, default_rp): - """Set the default_rp of this Source. - - :param default_rp: The default_rp of this Source. - :type: str - """ # noqa: E501 - self._default_rp = default_rp - - @property - def languages(self): - """Get the languages of this Source. - - :return: The languages of this Source. - :rtype: list[str] - """ # noqa: E501 - return self._languages - - @languages.setter - def languages(self, languages): - """Set the languages of this Source. - - :param languages: The languages of this Source. - :type: list[str] - """ # noqa: E501 - allowed_values = ["flux", "influxql"] # noqa: E501 - if not set(languages).issubset(set(allowed_values)): - raise ValueError( - "Invalid values for `languages` [{0}], must be a subset of [{1}]" # noqa: E501 - .format(", ".join(map(str, set(languages) - set(allowed_values))), # noqa: E501 - ", ".join(map(str, allowed_values))) - ) - self._languages = languages - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Source): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/source_links.py b/frogpilot/third_party/influxdb_client/domain/source_links.py deleted file mode 100644 index baffe913..00000000 --- a/frogpilot/third_party/influxdb_client/domain/source_links.py +++ /dev/null @@ -1,176 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class SourceLinks(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - '_self': 'str', - 'query': 'str', - 'health': 'str', - 'buckets': 'str' - } - - attribute_map = { - '_self': 'self', - 'query': 'query', - 'health': 'health', - 'buckets': 'buckets' - } - - def __init__(self, _self=None, query=None, health=None, buckets=None): # noqa: E501,D401,D403 - """SourceLinks - a model defined in OpenAPI.""" # noqa: E501 - self.__self = None - self._query = None - self._health = None - self._buckets = None - self.discriminator = None - - if _self is not None: - self._self = _self - if query is not None: - self.query = query - if health is not None: - self.health = health - if buckets is not None: - self.buckets = buckets - - @property - def _self(self): - """Get the _self of this SourceLinks. - - :return: The _self of this SourceLinks. - :rtype: str - """ # noqa: E501 - return self.__self - - @_self.setter - def _self(self, _self): - """Set the _self of this SourceLinks. - - :param _self: The _self of this SourceLinks. - :type: str - """ # noqa: E501 - self.__self = _self - - @property - def query(self): - """Get the query of this SourceLinks. - - :return: The query of this SourceLinks. - :rtype: str - """ # noqa: E501 - return self._query - - @query.setter - def query(self, query): - """Set the query of this SourceLinks. - - :param query: The query of this SourceLinks. - :type: str - """ # noqa: E501 - self._query = query - - @property - def health(self): - """Get the health of this SourceLinks. - - :return: The health of this SourceLinks. - :rtype: str - """ # noqa: E501 - return self._health - - @health.setter - def health(self, health): - """Set the health of this SourceLinks. - - :param health: The health of this SourceLinks. - :type: str - """ # noqa: E501 - self._health = health - - @property - def buckets(self): - """Get the buckets of this SourceLinks. - - :return: The buckets of this SourceLinks. - :rtype: str - """ # noqa: E501 - return self._buckets - - @buckets.setter - def buckets(self, buckets): - """Set the buckets of this SourceLinks. - - :param buckets: The buckets of this SourceLinks. - :type: str - """ # noqa: E501 - self._buckets = buckets - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, SourceLinks): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/sources.py b/frogpilot/third_party/influxdb_client/domain/sources.py deleted file mode 100644 index c368f13d..00000000 --- a/frogpilot/third_party/influxdb_client/domain/sources.py +++ /dev/null @@ -1,130 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class Sources(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'links': 'ResourceMembersLinks', - 'sources': 'list[Source]' - } - - attribute_map = { - 'links': 'links', - 'sources': 'sources' - } - - def __init__(self, links=None, sources=None): # noqa: E501,D401,D403 - """Sources - a model defined in OpenAPI.""" # noqa: E501 - self._links = None - self._sources = None - self.discriminator = None - - if links is not None: - self.links = links - if sources is not None: - self.sources = sources - - @property - def links(self): - """Get the links of this Sources. - - :return: The links of this Sources. - :rtype: ResourceMembersLinks - """ # noqa: E501 - return self._links - - @links.setter - def links(self, links): - """Set the links of this Sources. - - :param links: The links of this Sources. - :type: ResourceMembersLinks - """ # noqa: E501 - self._links = links - - @property - def sources(self): - """Get the sources of this Sources. - - :return: The sources of this Sources. - :rtype: list[Source] - """ # noqa: E501 - return self._sources - - @sources.setter - def sources(self, sources): - """Set the sources of this Sources. - - :param sources: The sources of this Sources. - :type: list[Source] - """ # noqa: E501 - self._sources = sources - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Sources): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/stack.py b/frogpilot/third_party/influxdb_client/domain/stack.py deleted file mode 100644 index cdae5a35..00000000 --- a/frogpilot/third_party/influxdb_client/domain/stack.py +++ /dev/null @@ -1,176 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class Stack(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'str', - 'org_id': 'str', - 'created_at': 'datetime', - 'events': 'list[StackEvents]' - } - - attribute_map = { - 'id': 'id', - 'org_id': 'orgID', - 'created_at': 'createdAt', - 'events': 'events' - } - - def __init__(self, id=None, org_id=None, created_at=None, events=None): # noqa: E501,D401,D403 - """Stack - a model defined in OpenAPI.""" # noqa: E501 - self._id = None - self._org_id = None - self._created_at = None - self._events = None - self.discriminator = None - - if id is not None: - self.id = id - if org_id is not None: - self.org_id = org_id - if created_at is not None: - self.created_at = created_at - if events is not None: - self.events = events - - @property - def id(self): - """Get the id of this Stack. - - :return: The id of this Stack. - :rtype: str - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this Stack. - - :param id: The id of this Stack. - :type: str - """ # noqa: E501 - self._id = id - - @property - def org_id(self): - """Get the org_id of this Stack. - - :return: The org_id of this Stack. - :rtype: str - """ # noqa: E501 - return self._org_id - - @org_id.setter - def org_id(self, org_id): - """Set the org_id of this Stack. - - :param org_id: The org_id of this Stack. - :type: str - """ # noqa: E501 - self._org_id = org_id - - @property - def created_at(self): - """Get the created_at of this Stack. - - :return: The created_at of this Stack. - :rtype: datetime - """ # noqa: E501 - return self._created_at - - @created_at.setter - def created_at(self, created_at): - """Set the created_at of this Stack. - - :param created_at: The created_at of this Stack. - :type: datetime - """ # noqa: E501 - self._created_at = created_at - - @property - def events(self): - """Get the events of this Stack. - - :return: The events of this Stack. - :rtype: list[StackEvents] - """ # noqa: E501 - return self._events - - @events.setter - def events(self, events): - """Set the events of this Stack. - - :param events: The events of this Stack. - :type: list[StackEvents] - """ # noqa: E501 - self._events = events - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Stack): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/stack_associations.py b/frogpilot/third_party/influxdb_client/domain/stack_associations.py deleted file mode 100644 index 7e3191b3..00000000 --- a/frogpilot/third_party/influxdb_client/domain/stack_associations.py +++ /dev/null @@ -1,130 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class StackAssociations(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'kind': 'TemplateKind', - 'meta_name': 'str' - } - - attribute_map = { - 'kind': 'kind', - 'meta_name': 'metaName' - } - - def __init__(self, kind=None, meta_name=None): # noqa: E501,D401,D403 - """StackAssociations - a model defined in OpenAPI.""" # noqa: E501 - self._kind = None - self._meta_name = None - self.discriminator = None - - if kind is not None: - self.kind = kind - if meta_name is not None: - self.meta_name = meta_name - - @property - def kind(self): - """Get the kind of this StackAssociations. - - :return: The kind of this StackAssociations. - :rtype: TemplateKind - """ # noqa: E501 - return self._kind - - @kind.setter - def kind(self, kind): - """Set the kind of this StackAssociations. - - :param kind: The kind of this StackAssociations. - :type: TemplateKind - """ # noqa: E501 - self._kind = kind - - @property - def meta_name(self): - """Get the meta_name of this StackAssociations. - - :return: The meta_name of this StackAssociations. - :rtype: str - """ # noqa: E501 - return self._meta_name - - @meta_name.setter - def meta_name(self, meta_name): - """Set the meta_name of this StackAssociations. - - :param meta_name: The meta_name of this StackAssociations. - :type: str - """ # noqa: E501 - self._meta_name = meta_name - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, StackAssociations): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/stack_events.py b/frogpilot/third_party/influxdb_client/domain/stack_events.py deleted file mode 100644 index 854a3ab4..00000000 --- a/frogpilot/third_party/influxdb_client/domain/stack_events.py +++ /dev/null @@ -1,245 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class StackEvents(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'event_type': 'str', - 'name': 'str', - 'description': 'str', - 'sources': 'list[str]', - 'resources': 'list[StackResources]', - 'urls': 'list[str]', - 'updated_at': 'datetime' - } - - attribute_map = { - 'event_type': 'eventType', - 'name': 'name', - 'description': 'description', - 'sources': 'sources', - 'resources': 'resources', - 'urls': 'urls', - 'updated_at': 'updatedAt' - } - - def __init__(self, event_type=None, name=None, description=None, sources=None, resources=None, urls=None, updated_at=None): # noqa: E501,D401,D403 - """StackEvents - a model defined in OpenAPI.""" # noqa: E501 - self._event_type = None - self._name = None - self._description = None - self._sources = None - self._resources = None - self._urls = None - self._updated_at = None - self.discriminator = None - - if event_type is not None: - self.event_type = event_type - if name is not None: - self.name = name - if description is not None: - self.description = description - if sources is not None: - self.sources = sources - if resources is not None: - self.resources = resources - if urls is not None: - self.urls = urls - if updated_at is not None: - self.updated_at = updated_at - - @property - def event_type(self): - """Get the event_type of this StackEvents. - - :return: The event_type of this StackEvents. - :rtype: str - """ # noqa: E501 - return self._event_type - - @event_type.setter - def event_type(self, event_type): - """Set the event_type of this StackEvents. - - :param event_type: The event_type of this StackEvents. - :type: str - """ # noqa: E501 - self._event_type = event_type - - @property - def name(self): - """Get the name of this StackEvents. - - :return: The name of this StackEvents. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this StackEvents. - - :param name: The name of this StackEvents. - :type: str - """ # noqa: E501 - self._name = name - - @property - def description(self): - """Get the description of this StackEvents. - - :return: The description of this StackEvents. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this StackEvents. - - :param description: The description of this StackEvents. - :type: str - """ # noqa: E501 - self._description = description - - @property - def sources(self): - """Get the sources of this StackEvents. - - :return: The sources of this StackEvents. - :rtype: list[str] - """ # noqa: E501 - return self._sources - - @sources.setter - def sources(self, sources): - """Set the sources of this StackEvents. - - :param sources: The sources of this StackEvents. - :type: list[str] - """ # noqa: E501 - self._sources = sources - - @property - def resources(self): - """Get the resources of this StackEvents. - - :return: The resources of this StackEvents. - :rtype: list[StackResources] - """ # noqa: E501 - return self._resources - - @resources.setter - def resources(self, resources): - """Set the resources of this StackEvents. - - :param resources: The resources of this StackEvents. - :type: list[StackResources] - """ # noqa: E501 - self._resources = resources - - @property - def urls(self): - """Get the urls of this StackEvents. - - :return: The urls of this StackEvents. - :rtype: list[str] - """ # noqa: E501 - return self._urls - - @urls.setter - def urls(self, urls): - """Set the urls of this StackEvents. - - :param urls: The urls of this StackEvents. - :type: list[str] - """ # noqa: E501 - self._urls = urls - - @property - def updated_at(self): - """Get the updated_at of this StackEvents. - - :return: The updated_at of this StackEvents. - :rtype: datetime - """ # noqa: E501 - return self._updated_at - - @updated_at.setter - def updated_at(self, updated_at): - """Set the updated_at of this StackEvents. - - :param updated_at: The updated_at of this StackEvents. - :type: datetime - """ # noqa: E501 - self._updated_at = updated_at - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, StackEvents): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/stack_links.py b/frogpilot/third_party/influxdb_client/domain/stack_links.py deleted file mode 100644 index f3c73354..00000000 --- a/frogpilot/third_party/influxdb_client/domain/stack_links.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class StackLinks(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - '_self': 'str' - } - - attribute_map = { - '_self': 'self' - } - - def __init__(self, _self=None): # noqa: E501,D401,D403 - """StackLinks - a model defined in OpenAPI.""" # noqa: E501 - self.__self = None - self.discriminator = None - - if _self is not None: - self._self = _self - - @property - def _self(self): - """Get the _self of this StackLinks. - - :return: The _self of this StackLinks. - :rtype: str - """ # noqa: E501 - return self.__self - - @_self.setter - def _self(self, _self): - """Set the _self of this StackLinks. - - :param _self: The _self of this StackLinks. - :type: str - """ # noqa: E501 - self.__self = _self - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, StackLinks): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/stack_resources.py b/frogpilot/third_party/influxdb_client/domain/stack_resources.py deleted file mode 100644 index 3cd5f989..00000000 --- a/frogpilot/third_party/influxdb_client/domain/stack_resources.py +++ /dev/null @@ -1,222 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class StackResources(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'api_version': 'str', - 'resource_id': 'str', - 'kind': 'TemplateKind', - 'template_meta_name': 'str', - 'associations': 'list[StackAssociations]', - 'links': 'StackLinks' - } - - attribute_map = { - 'api_version': 'apiVersion', - 'resource_id': 'resourceID', - 'kind': 'kind', - 'template_meta_name': 'templateMetaName', - 'associations': 'associations', - 'links': 'links' - } - - def __init__(self, api_version=None, resource_id=None, kind=None, template_meta_name=None, associations=None, links=None): # noqa: E501,D401,D403 - """StackResources - a model defined in OpenAPI.""" # noqa: E501 - self._api_version = None - self._resource_id = None - self._kind = None - self._template_meta_name = None - self._associations = None - self._links = None - self.discriminator = None - - if api_version is not None: - self.api_version = api_version - if resource_id is not None: - self.resource_id = resource_id - if kind is not None: - self.kind = kind - if template_meta_name is not None: - self.template_meta_name = template_meta_name - if associations is not None: - self.associations = associations - if links is not None: - self.links = links - - @property - def api_version(self): - """Get the api_version of this StackResources. - - :return: The api_version of this StackResources. - :rtype: str - """ # noqa: E501 - return self._api_version - - @api_version.setter - def api_version(self, api_version): - """Set the api_version of this StackResources. - - :param api_version: The api_version of this StackResources. - :type: str - """ # noqa: E501 - self._api_version = api_version - - @property - def resource_id(self): - """Get the resource_id of this StackResources. - - :return: The resource_id of this StackResources. - :rtype: str - """ # noqa: E501 - return self._resource_id - - @resource_id.setter - def resource_id(self, resource_id): - """Set the resource_id of this StackResources. - - :param resource_id: The resource_id of this StackResources. - :type: str - """ # noqa: E501 - self._resource_id = resource_id - - @property - def kind(self): - """Get the kind of this StackResources. - - :return: The kind of this StackResources. - :rtype: TemplateKind - """ # noqa: E501 - return self._kind - - @kind.setter - def kind(self, kind): - """Set the kind of this StackResources. - - :param kind: The kind of this StackResources. - :type: TemplateKind - """ # noqa: E501 - self._kind = kind - - @property - def template_meta_name(self): - """Get the template_meta_name of this StackResources. - - :return: The template_meta_name of this StackResources. - :rtype: str - """ # noqa: E501 - return self._template_meta_name - - @template_meta_name.setter - def template_meta_name(self, template_meta_name): - """Set the template_meta_name of this StackResources. - - :param template_meta_name: The template_meta_name of this StackResources. - :type: str - """ # noqa: E501 - self._template_meta_name = template_meta_name - - @property - def associations(self): - """Get the associations of this StackResources. - - :return: The associations of this StackResources. - :rtype: list[StackAssociations] - """ # noqa: E501 - return self._associations - - @associations.setter - def associations(self, associations): - """Set the associations of this StackResources. - - :param associations: The associations of this StackResources. - :type: list[StackAssociations] - """ # noqa: E501 - self._associations = associations - - @property - def links(self): - """Get the links of this StackResources. - - :return: The links of this StackResources. - :rtype: StackLinks - """ # noqa: E501 - return self._links - - @links.setter - def links(self, links): - """Set the links of this StackResources. - - :param links: The links of this StackResources. - :type: StackLinks - """ # noqa: E501 - self._links = links - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, StackResources): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/statement.py b/frogpilot/third_party/influxdb_client/domain/statement.py deleted file mode 100644 index bb19fc35..00000000 --- a/frogpilot/third_party/influxdb_client/domain/statement.py +++ /dev/null @@ -1,82 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class Statement(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501,D401,D403 - """Statement - a model defined in OpenAPI.""" # noqa: E501 self.discriminator = None - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Statement): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/static_legend.py b/frogpilot/third_party/influxdb_client/domain/static_legend.py deleted file mode 100644 index cff69439..00000000 --- a/frogpilot/third_party/influxdb_client/domain/static_legend.py +++ /dev/null @@ -1,245 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class StaticLegend(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'colorize_rows': 'bool', - 'height_ratio': 'float', - 'show': 'bool', - 'opacity': 'float', - 'orientation_threshold': 'int', - 'value_axis': 'str', - 'width_ratio': 'float' - } - - attribute_map = { - 'colorize_rows': 'colorizeRows', - 'height_ratio': 'heightRatio', - 'show': 'show', - 'opacity': 'opacity', - 'orientation_threshold': 'orientationThreshold', - 'value_axis': 'valueAxis', - 'width_ratio': 'widthRatio' - } - - def __init__(self, colorize_rows=None, height_ratio=None, show=None, opacity=None, orientation_threshold=None, value_axis=None, width_ratio=None): # noqa: E501,D401,D403 - """StaticLegend - a model defined in OpenAPI.""" # noqa: E501 - self._colorize_rows = None - self._height_ratio = None - self._show = None - self._opacity = None - self._orientation_threshold = None - self._value_axis = None - self._width_ratio = None - self.discriminator = None - - if colorize_rows is not None: - self.colorize_rows = colorize_rows - if height_ratio is not None: - self.height_ratio = height_ratio - if show is not None: - self.show = show - if opacity is not None: - self.opacity = opacity - if orientation_threshold is not None: - self.orientation_threshold = orientation_threshold - if value_axis is not None: - self.value_axis = value_axis - if width_ratio is not None: - self.width_ratio = width_ratio - - @property - def colorize_rows(self): - """Get the colorize_rows of this StaticLegend. - - :return: The colorize_rows of this StaticLegend. - :rtype: bool - """ # noqa: E501 - return self._colorize_rows - - @colorize_rows.setter - def colorize_rows(self, colorize_rows): - """Set the colorize_rows of this StaticLegend. - - :param colorize_rows: The colorize_rows of this StaticLegend. - :type: bool - """ # noqa: E501 - self._colorize_rows = colorize_rows - - @property - def height_ratio(self): - """Get the height_ratio of this StaticLegend. - - :return: The height_ratio of this StaticLegend. - :rtype: float - """ # noqa: E501 - return self._height_ratio - - @height_ratio.setter - def height_ratio(self, height_ratio): - """Set the height_ratio of this StaticLegend. - - :param height_ratio: The height_ratio of this StaticLegend. - :type: float - """ # noqa: E501 - self._height_ratio = height_ratio - - @property - def show(self): - """Get the show of this StaticLegend. - - :return: The show of this StaticLegend. - :rtype: bool - """ # noqa: E501 - return self._show - - @show.setter - def show(self, show): - """Set the show of this StaticLegend. - - :param show: The show of this StaticLegend. - :type: bool - """ # noqa: E501 - self._show = show - - @property - def opacity(self): - """Get the opacity of this StaticLegend. - - :return: The opacity of this StaticLegend. - :rtype: float - """ # noqa: E501 - return self._opacity - - @opacity.setter - def opacity(self, opacity): - """Set the opacity of this StaticLegend. - - :param opacity: The opacity of this StaticLegend. - :type: float - """ # noqa: E501 - self._opacity = opacity - - @property - def orientation_threshold(self): - """Get the orientation_threshold of this StaticLegend. - - :return: The orientation_threshold of this StaticLegend. - :rtype: int - """ # noqa: E501 - return self._orientation_threshold - - @orientation_threshold.setter - def orientation_threshold(self, orientation_threshold): - """Set the orientation_threshold of this StaticLegend. - - :param orientation_threshold: The orientation_threshold of this StaticLegend. - :type: int - """ # noqa: E501 - self._orientation_threshold = orientation_threshold - - @property - def value_axis(self): - """Get the value_axis of this StaticLegend. - - :return: The value_axis of this StaticLegend. - :rtype: str - """ # noqa: E501 - return self._value_axis - - @value_axis.setter - def value_axis(self, value_axis): - """Set the value_axis of this StaticLegend. - - :param value_axis: The value_axis of this StaticLegend. - :type: str - """ # noqa: E501 - self._value_axis = value_axis - - @property - def width_ratio(self): - """Get the width_ratio of this StaticLegend. - - :return: The width_ratio of this StaticLegend. - :rtype: float - """ # noqa: E501 - return self._width_ratio - - @width_ratio.setter - def width_ratio(self, width_ratio): - """Set the width_ratio of this StaticLegend. - - :param width_ratio: The width_ratio of this StaticLegend. - :type: float - """ # noqa: E501 - self._width_ratio = width_ratio - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, StaticLegend): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/status_rule.py b/frogpilot/third_party/influxdb_client/domain/status_rule.py deleted file mode 100644 index bac05845..00000000 --- a/frogpilot/third_party/influxdb_client/domain/status_rule.py +++ /dev/null @@ -1,176 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class StatusRule(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'current_level': 'RuleStatusLevel', - 'previous_level': 'RuleStatusLevel', - 'count': 'int', - 'period': 'str' - } - - attribute_map = { - 'current_level': 'currentLevel', - 'previous_level': 'previousLevel', - 'count': 'count', - 'period': 'period' - } - - def __init__(self, current_level=None, previous_level=None, count=None, period=None): # noqa: E501,D401,D403 - """StatusRule - a model defined in OpenAPI.""" # noqa: E501 - self._current_level = None - self._previous_level = None - self._count = None - self._period = None - self.discriminator = None - - if current_level is not None: - self.current_level = current_level - if previous_level is not None: - self.previous_level = previous_level - if count is not None: - self.count = count - if period is not None: - self.period = period - - @property - def current_level(self): - """Get the current_level of this StatusRule. - - :return: The current_level of this StatusRule. - :rtype: RuleStatusLevel - """ # noqa: E501 - return self._current_level - - @current_level.setter - def current_level(self, current_level): - """Set the current_level of this StatusRule. - - :param current_level: The current_level of this StatusRule. - :type: RuleStatusLevel - """ # noqa: E501 - self._current_level = current_level - - @property - def previous_level(self): - """Get the previous_level of this StatusRule. - - :return: The previous_level of this StatusRule. - :rtype: RuleStatusLevel - """ # noqa: E501 - return self._previous_level - - @previous_level.setter - def previous_level(self, previous_level): - """Set the previous_level of this StatusRule. - - :param previous_level: The previous_level of this StatusRule. - :type: RuleStatusLevel - """ # noqa: E501 - self._previous_level = previous_level - - @property - def count(self): - """Get the count of this StatusRule. - - :return: The count of this StatusRule. - :rtype: int - """ # noqa: E501 - return self._count - - @count.setter - def count(self, count): - """Set the count of this StatusRule. - - :param count: The count of this StatusRule. - :type: int - """ # noqa: E501 - self._count = count - - @property - def period(self): - """Get the period of this StatusRule. - - :return: The period of this StatusRule. - :rtype: str - """ # noqa: E501 - return self._period - - @period.setter - def period(self, period): - """Set the period of this StatusRule. - - :param period: The period of this StatusRule. - :type: str - """ # noqa: E501 - self._period = period - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, StatusRule): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/string_literal.py b/frogpilot/third_party/influxdb_client/domain/string_literal.py deleted file mode 100644 index 643ca425..00000000 --- a/frogpilot/third_party/influxdb_client/domain/string_literal.py +++ /dev/null @@ -1,138 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.property_key import PropertyKey - - -class StringLiteral(PropertyKey): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'value': 'str' - } - - attribute_map = { - 'type': 'type', - 'value': 'value' - } - - def __init__(self, type=None, value=None): # noqa: E501,D401,D403 - """StringLiteral - a model defined in OpenAPI.""" # noqa: E501 - PropertyKey.__init__(self) # noqa: E501 - - self._type = None - self._value = None - self.discriminator = None - - if type is not None: - self.type = type - if value is not None: - self.value = value - - @property - def type(self): - """Get the type of this StringLiteral. - - Type of AST node - - :return: The type of this StringLiteral. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this StringLiteral. - - Type of AST node - - :param type: The type of this StringLiteral. - :type: str - """ # noqa: E501 - self._type = type - - @property - def value(self): - """Get the value of this StringLiteral. - - :return: The value of this StringLiteral. - :rtype: str - """ # noqa: E501 - return self._value - - @value.setter - def value(self, value): - """Set the value of this StringLiteral. - - :param value: The value of this StringLiteral. - :type: str - """ # noqa: E501 - self._value = value - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, StringLiteral): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/subscription_manifest.py b/frogpilot/third_party/influxdb_client/domain/subscription_manifest.py deleted file mode 100644 index 7366561e..00000000 --- a/frogpilot/third_party/influxdb_client/domain/subscription_manifest.py +++ /dev/null @@ -1,156 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class SubscriptionManifest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str', - 'mode': 'str', - 'destinations': 'list[str]' - } - - attribute_map = { - 'name': 'name', - 'mode': 'mode', - 'destinations': 'destinations' - } - - def __init__(self, name=None, mode=None, destinations=None): # noqa: E501,D401,D403 - """SubscriptionManifest - a model defined in OpenAPI.""" # noqa: E501 - self._name = None - self._mode = None - self._destinations = None - self.discriminator = None - - self.name = name - self.mode = mode - self.destinations = destinations - - @property - def name(self): - """Get the name of this SubscriptionManifest. - - :return: The name of this SubscriptionManifest. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this SubscriptionManifest. - - :param name: The name of this SubscriptionManifest. - :type: str - """ # noqa: E501 - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - self._name = name - - @property - def mode(self): - """Get the mode of this SubscriptionManifest. - - :return: The mode of this SubscriptionManifest. - :rtype: str - """ # noqa: E501 - return self._mode - - @mode.setter - def mode(self, mode): - """Set the mode of this SubscriptionManifest. - - :param mode: The mode of this SubscriptionManifest. - :type: str - """ # noqa: E501 - if mode is None: - raise ValueError("Invalid value for `mode`, must not be `None`") # noqa: E501 - self._mode = mode - - @property - def destinations(self): - """Get the destinations of this SubscriptionManifest. - - :return: The destinations of this SubscriptionManifest. - :rtype: list[str] - """ # noqa: E501 - return self._destinations - - @destinations.setter - def destinations(self, destinations): - """Set the destinations of this SubscriptionManifest. - - :param destinations: The destinations of this SubscriptionManifest. - :type: list[str] - """ # noqa: E501 - if destinations is None: - raise ValueError("Invalid value for `destinations`, must not be `None`") # noqa: E501 - self._destinations = destinations - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, SubscriptionManifest): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/table_view_properties.py b/frogpilot/third_party/influxdb_client/domain/table_view_properties.py deleted file mode 100644 index bd8ec0d9..00000000 --- a/frogpilot/third_party/influxdb_client/domain/table_view_properties.py +++ /dev/null @@ -1,344 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.view_properties import ViewProperties - - -class TableViewProperties(ViewProperties): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'queries': 'list[DashboardQuery]', - 'colors': 'list[DashboardColor]', - 'shape': 'str', - 'note': 'str', - 'show_note_when_empty': 'bool', - 'table_options': 'TableViewPropertiesTableOptions', - 'field_options': 'list[RenamableField]', - 'time_format': 'str', - 'decimal_places': 'DecimalPlaces' - } - - attribute_map = { - 'type': 'type', - 'queries': 'queries', - 'colors': 'colors', - 'shape': 'shape', - 'note': 'note', - 'show_note_when_empty': 'showNoteWhenEmpty', - 'table_options': 'tableOptions', - 'field_options': 'fieldOptions', - 'time_format': 'timeFormat', - 'decimal_places': 'decimalPlaces' - } - - def __init__(self, type=None, queries=None, colors=None, shape=None, note=None, show_note_when_empty=None, table_options=None, field_options=None, time_format=None, decimal_places=None): # noqa: E501,D401,D403 - """TableViewProperties - a model defined in OpenAPI.""" # noqa: E501 - ViewProperties.__init__(self) # noqa: E501 - - self._type = None - self._queries = None - self._colors = None - self._shape = None - self._note = None - self._show_note_when_empty = None - self._table_options = None - self._field_options = None - self._time_format = None - self._decimal_places = None - self.discriminator = None - - self.type = type - self.queries = queries - self.colors = colors - self.shape = shape - self.note = note - self.show_note_when_empty = show_note_when_empty - self.table_options = table_options - self.field_options = field_options - self.time_format = time_format - self.decimal_places = decimal_places - - @property - def type(self): - """Get the type of this TableViewProperties. - - :return: The type of this TableViewProperties. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this TableViewProperties. - - :param type: The type of this TableViewProperties. - :type: str - """ # noqa: E501 - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - self._type = type - - @property - def queries(self): - """Get the queries of this TableViewProperties. - - :return: The queries of this TableViewProperties. - :rtype: list[DashboardQuery] - """ # noqa: E501 - return self._queries - - @queries.setter - def queries(self, queries): - """Set the queries of this TableViewProperties. - - :param queries: The queries of this TableViewProperties. - :type: list[DashboardQuery] - """ # noqa: E501 - if queries is None: - raise ValueError("Invalid value for `queries`, must not be `None`") # noqa: E501 - self._queries = queries - - @property - def colors(self): - """Get the colors of this TableViewProperties. - - Colors define color encoding of data into a visualization - - :return: The colors of this TableViewProperties. - :rtype: list[DashboardColor] - """ # noqa: E501 - return self._colors - - @colors.setter - def colors(self, colors): - """Set the colors of this TableViewProperties. - - Colors define color encoding of data into a visualization - - :param colors: The colors of this TableViewProperties. - :type: list[DashboardColor] - """ # noqa: E501 - if colors is None: - raise ValueError("Invalid value for `colors`, must not be `None`") # noqa: E501 - self._colors = colors - - @property - def shape(self): - """Get the shape of this TableViewProperties. - - :return: The shape of this TableViewProperties. - :rtype: str - """ # noqa: E501 - return self._shape - - @shape.setter - def shape(self, shape): - """Set the shape of this TableViewProperties. - - :param shape: The shape of this TableViewProperties. - :type: str - """ # noqa: E501 - if shape is None: - raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 - self._shape = shape - - @property - def note(self): - """Get the note of this TableViewProperties. - - :return: The note of this TableViewProperties. - :rtype: str - """ # noqa: E501 - return self._note - - @note.setter - def note(self, note): - """Set the note of this TableViewProperties. - - :param note: The note of this TableViewProperties. - :type: str - """ # noqa: E501 - if note is None: - raise ValueError("Invalid value for `note`, must not be `None`") # noqa: E501 - self._note = note - - @property - def show_note_when_empty(self): - """Get the show_note_when_empty of this TableViewProperties. - - If true, will display note when empty - - :return: The show_note_when_empty of this TableViewProperties. - :rtype: bool - """ # noqa: E501 - return self._show_note_when_empty - - @show_note_when_empty.setter - def show_note_when_empty(self, show_note_when_empty): - """Set the show_note_when_empty of this TableViewProperties. - - If true, will display note when empty - - :param show_note_when_empty: The show_note_when_empty of this TableViewProperties. - :type: bool - """ # noqa: E501 - if show_note_when_empty is None: - raise ValueError("Invalid value for `show_note_when_empty`, must not be `None`") # noqa: E501 - self._show_note_when_empty = show_note_when_empty - - @property - def table_options(self): - """Get the table_options of this TableViewProperties. - - :return: The table_options of this TableViewProperties. - :rtype: TableViewPropertiesTableOptions - """ # noqa: E501 - return self._table_options - - @table_options.setter - def table_options(self, table_options): - """Set the table_options of this TableViewProperties. - - :param table_options: The table_options of this TableViewProperties. - :type: TableViewPropertiesTableOptions - """ # noqa: E501 - if table_options is None: - raise ValueError("Invalid value for `table_options`, must not be `None`") # noqa: E501 - self._table_options = table_options - - @property - def field_options(self): - """Get the field_options of this TableViewProperties. - - fieldOptions represent the fields retrieved by the query with customization options - - :return: The field_options of this TableViewProperties. - :rtype: list[RenamableField] - """ # noqa: E501 - return self._field_options - - @field_options.setter - def field_options(self, field_options): - """Set the field_options of this TableViewProperties. - - fieldOptions represent the fields retrieved by the query with customization options - - :param field_options: The field_options of this TableViewProperties. - :type: list[RenamableField] - """ # noqa: E501 - if field_options is None: - raise ValueError("Invalid value for `field_options`, must not be `None`") # noqa: E501 - self._field_options = field_options - - @property - def time_format(self): - """Get the time_format of this TableViewProperties. - - timeFormat describes the display format for time values according to moment.js date formatting - - :return: The time_format of this TableViewProperties. - :rtype: str - """ # noqa: E501 - return self._time_format - - @time_format.setter - def time_format(self, time_format): - """Set the time_format of this TableViewProperties. - - timeFormat describes the display format for time values according to moment.js date formatting - - :param time_format: The time_format of this TableViewProperties. - :type: str - """ # noqa: E501 - if time_format is None: - raise ValueError("Invalid value for `time_format`, must not be `None`") # noqa: E501 - self._time_format = time_format - - @property - def decimal_places(self): - """Get the decimal_places of this TableViewProperties. - - :return: The decimal_places of this TableViewProperties. - :rtype: DecimalPlaces - """ # noqa: E501 - return self._decimal_places - - @decimal_places.setter - def decimal_places(self, decimal_places): - """Set the decimal_places of this TableViewProperties. - - :param decimal_places: The decimal_places of this TableViewProperties. - :type: DecimalPlaces - """ # noqa: E501 - if decimal_places is None: - raise ValueError("Invalid value for `decimal_places`, must not be `None`") # noqa: E501 - self._decimal_places = decimal_places - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TableViewProperties): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/table_view_properties_table_options.py b/frogpilot/third_party/influxdb_client/domain/table_view_properties_table_options.py deleted file mode 100644 index 71193ca9..00000000 --- a/frogpilot/third_party/influxdb_client/domain/table_view_properties_table_options.py +++ /dev/null @@ -1,188 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TableViewPropertiesTableOptions(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'vertical_time_axis': 'bool', - 'sort_by': 'RenamableField', - 'wrapping': 'str', - 'fix_first_column': 'bool' - } - - attribute_map = { - 'vertical_time_axis': 'verticalTimeAxis', - 'sort_by': 'sortBy', - 'wrapping': 'wrapping', - 'fix_first_column': 'fixFirstColumn' - } - - def __init__(self, vertical_time_axis=None, sort_by=None, wrapping=None, fix_first_column=None): # noqa: E501,D401,D403 - """TableViewPropertiesTableOptions - a model defined in OpenAPI.""" # noqa: E501 - self._vertical_time_axis = None - self._sort_by = None - self._wrapping = None - self._fix_first_column = None - self.discriminator = None - - if vertical_time_axis is not None: - self.vertical_time_axis = vertical_time_axis - if sort_by is not None: - self.sort_by = sort_by - if wrapping is not None: - self.wrapping = wrapping - if fix_first_column is not None: - self.fix_first_column = fix_first_column - - @property - def vertical_time_axis(self): - """Get the vertical_time_axis of this TableViewPropertiesTableOptions. - - verticalTimeAxis describes the orientation of the table by indicating whether the time axis will be displayed vertically - - :return: The vertical_time_axis of this TableViewPropertiesTableOptions. - :rtype: bool - """ # noqa: E501 - return self._vertical_time_axis - - @vertical_time_axis.setter - def vertical_time_axis(self, vertical_time_axis): - """Set the vertical_time_axis of this TableViewPropertiesTableOptions. - - verticalTimeAxis describes the orientation of the table by indicating whether the time axis will be displayed vertically - - :param vertical_time_axis: The vertical_time_axis of this TableViewPropertiesTableOptions. - :type: bool - """ # noqa: E501 - self._vertical_time_axis = vertical_time_axis - - @property - def sort_by(self): - """Get the sort_by of this TableViewPropertiesTableOptions. - - :return: The sort_by of this TableViewPropertiesTableOptions. - :rtype: RenamableField - """ # noqa: E501 - return self._sort_by - - @sort_by.setter - def sort_by(self, sort_by): - """Set the sort_by of this TableViewPropertiesTableOptions. - - :param sort_by: The sort_by of this TableViewPropertiesTableOptions. - :type: RenamableField - """ # noqa: E501 - self._sort_by = sort_by - - @property - def wrapping(self): - """Get the wrapping of this TableViewPropertiesTableOptions. - - Wrapping describes the text wrapping style to be used in table views - - :return: The wrapping of this TableViewPropertiesTableOptions. - :rtype: str - """ # noqa: E501 - return self._wrapping - - @wrapping.setter - def wrapping(self, wrapping): - """Set the wrapping of this TableViewPropertiesTableOptions. - - Wrapping describes the text wrapping style to be used in table views - - :param wrapping: The wrapping of this TableViewPropertiesTableOptions. - :type: str - """ # noqa: E501 - self._wrapping = wrapping - - @property - def fix_first_column(self): - """Get the fix_first_column of this TableViewPropertiesTableOptions. - - fixFirstColumn indicates whether the first column of the table should be locked - - :return: The fix_first_column of this TableViewPropertiesTableOptions. - :rtype: bool - """ # noqa: E501 - return self._fix_first_column - - @fix_first_column.setter - def fix_first_column(self, fix_first_column): - """Set the fix_first_column of this TableViewPropertiesTableOptions. - - fixFirstColumn indicates whether the first column of the table should be locked - - :param fix_first_column: The fix_first_column of this TableViewPropertiesTableOptions. - :type: bool - """ # noqa: E501 - self._fix_first_column = fix_first_column - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TableViewPropertiesTableOptions): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/tag_rule.py b/frogpilot/third_party/influxdb_client/domain/tag_rule.py deleted file mode 100644 index 9683856d..00000000 --- a/frogpilot/third_party/influxdb_client/domain/tag_rule.py +++ /dev/null @@ -1,153 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TagRule(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'key': 'str', - 'value': 'str', - 'operator': 'str' - } - - attribute_map = { - 'key': 'key', - 'value': 'value', - 'operator': 'operator' - } - - def __init__(self, key=None, value=None, operator=None): # noqa: E501,D401,D403 - """TagRule - a model defined in OpenAPI.""" # noqa: E501 - self._key = None - self._value = None - self._operator = None - self.discriminator = None - - if key is not None: - self.key = key - if value is not None: - self.value = value - if operator is not None: - self.operator = operator - - @property - def key(self): - """Get the key of this TagRule. - - :return: The key of this TagRule. - :rtype: str - """ # noqa: E501 - return self._key - - @key.setter - def key(self, key): - """Set the key of this TagRule. - - :param key: The key of this TagRule. - :type: str - """ # noqa: E501 - self._key = key - - @property - def value(self): - """Get the value of this TagRule. - - :return: The value of this TagRule. - :rtype: str - """ # noqa: E501 - return self._value - - @value.setter - def value(self, value): - """Set the value of this TagRule. - - :param value: The value of this TagRule. - :type: str - """ # noqa: E501 - self._value = value - - @property - def operator(self): - """Get the operator of this TagRule. - - :return: The operator of this TagRule. - :rtype: str - """ # noqa: E501 - return self._operator - - @operator.setter - def operator(self, operator): - """Set the operator of this TagRule. - - :param operator: The operator of this TagRule. - :type: str - """ # noqa: E501 - self._operator = operator - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TagRule): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/task.py b/frogpilot/third_party/influxdb_client/domain/task.py deleted file mode 100644 index 531babca..00000000 --- a/frogpilot/third_party/influxdb_client/domain/task.py +++ /dev/null @@ -1,569 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class Task(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'str', - 'org_id': 'str', - 'org': 'str', - 'name': 'str', - 'owner_id': 'str', - 'description': 'str', - 'status': 'TaskStatusType', - 'labels': 'list[Label]', - 'authorization_id': 'str', - 'flux': 'str', - 'every': 'str', - 'cron': 'str', - 'offset': 'str', - 'latest_completed': 'datetime', - 'last_run_status': 'str', - 'last_run_error': 'str', - 'created_at': 'datetime', - 'updated_at': 'datetime', - 'links': 'TaskLinks' - } - - attribute_map = { - 'id': 'id', - 'org_id': 'orgID', - 'org': 'org', - 'name': 'name', - 'owner_id': 'ownerID', - 'description': 'description', - 'status': 'status', - 'labels': 'labels', - 'authorization_id': 'authorizationID', - 'flux': 'flux', - 'every': 'every', - 'cron': 'cron', - 'offset': 'offset', - 'latest_completed': 'latestCompleted', - 'last_run_status': 'lastRunStatus', - 'last_run_error': 'lastRunError', - 'created_at': 'createdAt', - 'updated_at': 'updatedAt', - 'links': 'links' - } - - def __init__(self, id=None, org_id=None, org=None, name=None, owner_id=None, description=None, status=None, labels=None, authorization_id=None, flux=None, every=None, cron=None, offset=None, latest_completed=None, last_run_status=None, last_run_error=None, created_at=None, updated_at=None, links=None): # noqa: E501,D401,D403 - """Task - a model defined in OpenAPI.""" # noqa: E501 - self._id = None - self._org_id = None - self._org = None - self._name = None - self._owner_id = None - self._description = None - self._status = None - self._labels = None - self._authorization_id = None - self._flux = None - self._every = None - self._cron = None - self._offset = None - self._latest_completed = None - self._last_run_status = None - self._last_run_error = None - self._created_at = None - self._updated_at = None - self._links = None - self.discriminator = None - - self.id = id - self.org_id = org_id - if org is not None: - self.org = org - self.name = name - if owner_id is not None: - self.owner_id = owner_id - if description is not None: - self.description = description - if status is not None: - self.status = status - if labels is not None: - self.labels = labels - if authorization_id is not None: - self.authorization_id = authorization_id - self.flux = flux - if every is not None: - self.every = every - if cron is not None: - self.cron = cron - if offset is not None: - self.offset = offset - if latest_completed is not None: - self.latest_completed = latest_completed - if last_run_status is not None: - self.last_run_status = last_run_status - if last_run_error is not None: - self.last_run_error = last_run_error - if created_at is not None: - self.created_at = created_at - if updated_at is not None: - self.updated_at = updated_at - if links is not None: - self.links = links - - @property - def id(self): - """Get the id of this Task. - - :return: The id of this Task. - :rtype: str - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this Task. - - :param id: The id of this Task. - :type: str - """ # noqa: E501 - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 - self._id = id - - @property - def org_id(self): - """Get the org_id of this Task. - - An [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization) ID. Specifies the organization that owns the task. - - :return: The org_id of this Task. - :rtype: str - """ # noqa: E501 - return self._org_id - - @org_id.setter - def org_id(self, org_id): - """Set the org_id of this Task. - - An [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization) ID. Specifies the organization that owns the task. - - :param org_id: The org_id of this Task. - :type: str - """ # noqa: E501 - if org_id is None: - raise ValueError("Invalid value for `org_id`, must not be `None`") # noqa: E501 - self._org_id = org_id - - @property - def org(self): - """Get the org of this Task. - - An [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization) name. Specifies the organization that owns the task. - - :return: The org of this Task. - :rtype: str - """ # noqa: E501 - return self._org - - @org.setter - def org(self, org): - """Set the org of this Task. - - An [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization) name. Specifies the organization that owns the task. - - :param org: The org of this Task. - :type: str - """ # noqa: E501 - self._org = org - - @property - def name(self): - """Get the name of this Task. - - The name of the task. - - :return: The name of this Task. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this Task. - - The name of the task. - - :param name: The name of this Task. - :type: str - """ # noqa: E501 - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - self._name = name - - @property - def owner_id(self): - """Get the owner_id of this Task. - - A [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user) ID. Specifies the owner of the task. To find a user ID, you can use the [`GET /api/v2/users` endpoint](#operation/GetUsers) to list users. - - :return: The owner_id of this Task. - :rtype: str - """ # noqa: E501 - return self._owner_id - - @owner_id.setter - def owner_id(self, owner_id): - """Set the owner_id of this Task. - - A [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user) ID. Specifies the owner of the task. To find a user ID, you can use the [`GET /api/v2/users` endpoint](#operation/GetUsers) to list users. - - :param owner_id: The owner_id of this Task. - :type: str - """ # noqa: E501 - self._owner_id = owner_id - - @property - def description(self): - """Get the description of this Task. - - A description of the task. - - :return: The description of this Task. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this Task. - - A description of the task. - - :param description: The description of this Task. - :type: str - """ # noqa: E501 - self._description = description - - @property - def status(self): - """Get the status of this Task. - - :return: The status of this Task. - :rtype: TaskStatusType - """ # noqa: E501 - return self._status - - @status.setter - def status(self, status): - """Set the status of this Task. - - :param status: The status of this Task. - :type: TaskStatusType - """ # noqa: E501 - self._status = status - - @property - def labels(self): - """Get the labels of this Task. - - :return: The labels of this Task. - :rtype: list[Label] - """ # noqa: E501 - return self._labels - - @labels.setter - def labels(self, labels): - """Set the labels of this Task. - - :param labels: The labels of this Task. - :type: list[Label] - """ # noqa: E501 - self._labels = labels - - @property - def authorization_id(self): - """Get the authorization_id of this Task. - - An authorization ID. Specifies the authorization used when the task communicates with the query engine. To find an authorization ID, use the [`GET /api/v2/authorizations` endpoint](#operation/GetAuthorizations) to list authorizations. - - :return: The authorization_id of this Task. - :rtype: str - """ # noqa: E501 - return self._authorization_id - - @authorization_id.setter - def authorization_id(self, authorization_id): - """Set the authorization_id of this Task. - - An authorization ID. Specifies the authorization used when the task communicates with the query engine. To find an authorization ID, use the [`GET /api/v2/authorizations` endpoint](#operation/GetAuthorizations) to list authorizations. - - :param authorization_id: The authorization_id of this Task. - :type: str - """ # noqa: E501 - self._authorization_id = authorization_id - - @property - def flux(self): - """Get the flux of this Task. - - The Flux script that the task executes. - - :return: The flux of this Task. - :rtype: str - """ # noqa: E501 - return self._flux - - @flux.setter - def flux(self, flux): - """Set the flux of this Task. - - The Flux script that the task executes. - - :param flux: The flux of this Task. - :type: str - """ # noqa: E501 - if flux is None: - raise ValueError("Invalid value for `flux`, must not be `None`") # noqa: E501 - self._flux = flux - - @property - def every(self): - """Get the every of this Task. - - The interval ([duration literal](https://docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339-timestamp)) at which the task runs. `every` also determines when the task first runs, depending on the specified time. - - :return: The every of this Task. - :rtype: str - """ # noqa: E501 - return self._every - - @every.setter - def every(self, every): - """Set the every of this Task. - - The interval ([duration literal](https://docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339-timestamp)) at which the task runs. `every` also determines when the task first runs, depending on the specified time. - - :param every: The every of this Task. - :type: str - """ # noqa: E501 - self._every = every - - @property - def cron(self): - """Get the cron of this Task. - - A [Cron expression](https://en.wikipedia.org/wiki/Cron#Overview) that defines the schedule on which the task runs. InfluxDB uses the system time when evaluating Cron expressions. - - :return: The cron of this Task. - :rtype: str - """ # noqa: E501 - return self._cron - - @cron.setter - def cron(self, cron): - """Set the cron of this Task. - - A [Cron expression](https://en.wikipedia.org/wiki/Cron#Overview) that defines the schedule on which the task runs. InfluxDB uses the system time when evaluating Cron expressions. - - :param cron: The cron of this Task. - :type: str - """ # noqa: E501 - self._cron = cron - - @property - def offset(self): - """Get the offset of this Task. - - A [duration](https://docs.influxdata.com/flux/v0.x/spec/lexical-elements/#duration-literals) to delay execution of the task after the scheduled time has elapsed. `0` removes the offset. - - :return: The offset of this Task. - :rtype: str - """ # noqa: E501 - return self._offset - - @offset.setter - def offset(self, offset): - """Set the offset of this Task. - - A [duration](https://docs.influxdata.com/flux/v0.x/spec/lexical-elements/#duration-literals) to delay execution of the task after the scheduled time has elapsed. `0` removes the offset. - - :param offset: The offset of this Task. - :type: str - """ # noqa: E501 - self._offset = offset - - @property - def latest_completed(self): - """Get the latest_completed of this Task. - - A timestamp ([RFC3339 date/time format](https://docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339-timestamp)) of the latest scheduled and completed run. - - :return: The latest_completed of this Task. - :rtype: datetime - """ # noqa: E501 - return self._latest_completed - - @latest_completed.setter - def latest_completed(self, latest_completed): - """Set the latest_completed of this Task. - - A timestamp ([RFC3339 date/time format](https://docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339-timestamp)) of the latest scheduled and completed run. - - :param latest_completed: The latest_completed of this Task. - :type: datetime - """ # noqa: E501 - self._latest_completed = latest_completed - - @property - def last_run_status(self): - """Get the last_run_status of this Task. - - :return: The last_run_status of this Task. - :rtype: str - """ # noqa: E501 - return self._last_run_status - - @last_run_status.setter - def last_run_status(self, last_run_status): - """Set the last_run_status of this Task. - - :param last_run_status: The last_run_status of this Task. - :type: str - """ # noqa: E501 - self._last_run_status = last_run_status - - @property - def last_run_error(self): - """Get the last_run_error of this Task. - - :return: The last_run_error of this Task. - :rtype: str - """ # noqa: E501 - return self._last_run_error - - @last_run_error.setter - def last_run_error(self, last_run_error): - """Set the last_run_error of this Task. - - :param last_run_error: The last_run_error of this Task. - :type: str - """ # noqa: E501 - self._last_run_error = last_run_error - - @property - def created_at(self): - """Get the created_at of this Task. - - :return: The created_at of this Task. - :rtype: datetime - """ # noqa: E501 - return self._created_at - - @created_at.setter - def created_at(self, created_at): - """Set the created_at of this Task. - - :param created_at: The created_at of this Task. - :type: datetime - """ # noqa: E501 - self._created_at = created_at - - @property - def updated_at(self): - """Get the updated_at of this Task. - - :return: The updated_at of this Task. - :rtype: datetime - """ # noqa: E501 - return self._updated_at - - @updated_at.setter - def updated_at(self, updated_at): - """Set the updated_at of this Task. - - :param updated_at: The updated_at of this Task. - :type: datetime - """ # noqa: E501 - self._updated_at = updated_at - - @property - def links(self): - """Get the links of this Task. - - :return: The links of this Task. - :rtype: TaskLinks - """ # noqa: E501 - return self._links - - @links.setter - def links(self, links): - """Set the links of this Task. - - :param links: The links of this Task. - :type: TaskLinks - """ # noqa: E501 - self._links = links - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Task): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/task_create_request.py b/frogpilot/third_party/influxdb_client/domain/task_create_request.py deleted file mode 100644 index 462c008f..00000000 --- a/frogpilot/third_party/influxdb_client/domain/task_create_request.py +++ /dev/null @@ -1,216 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TaskCreateRequest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'org_id': 'str', - 'org': 'str', - 'status': 'TaskStatusType', - 'flux': 'str', - 'description': 'str' - } - - attribute_map = { - 'org_id': 'orgID', - 'org': 'org', - 'status': 'status', - 'flux': 'flux', - 'description': 'description' - } - - def __init__(self, org_id=None, org=None, status=None, flux=None, description=None): # noqa: E501,D401,D403 - """TaskCreateRequest - a model defined in OpenAPI.""" # noqa: E501 - self._org_id = None - self._org = None - self._status = None - self._flux = None - self._description = None - self.discriminator = None - - if org_id is not None: - self.org_id = org_id - if org is not None: - self.org = org - if status is not None: - self.status = status - self.flux = flux - if description is not None: - self.description = description - - @property - def org_id(self): - """Get the org_id of this TaskCreateRequest. - - The ID of the organization that owns this Task. - - :return: The org_id of this TaskCreateRequest. - :rtype: str - """ # noqa: E501 - return self._org_id - - @org_id.setter - def org_id(self, org_id): - """Set the org_id of this TaskCreateRequest. - - The ID of the organization that owns this Task. - - :param org_id: The org_id of this TaskCreateRequest. - :type: str - """ # noqa: E501 - self._org_id = org_id - - @property - def org(self): - """Get the org of this TaskCreateRequest. - - The name of the organization that owns this Task. - - :return: The org of this TaskCreateRequest. - :rtype: str - """ # noqa: E501 - return self._org - - @org.setter - def org(self, org): - """Set the org of this TaskCreateRequest. - - The name of the organization that owns this Task. - - :param org: The org of this TaskCreateRequest. - :type: str - """ # noqa: E501 - self._org = org - - @property - def status(self): - """Get the status of this TaskCreateRequest. - - :return: The status of this TaskCreateRequest. - :rtype: TaskStatusType - """ # noqa: E501 - return self._status - - @status.setter - def status(self, status): - """Set the status of this TaskCreateRequest. - - :param status: The status of this TaskCreateRequest. - :type: TaskStatusType - """ # noqa: E501 - self._status = status - - @property - def flux(self): - """Get the flux of this TaskCreateRequest. - - The Flux script to run for this task. - - :return: The flux of this TaskCreateRequest. - :rtype: str - """ # noqa: E501 - return self._flux - - @flux.setter - def flux(self, flux): - """Set the flux of this TaskCreateRequest. - - The Flux script to run for this task. - - :param flux: The flux of this TaskCreateRequest. - :type: str - """ # noqa: E501 - if flux is None: - raise ValueError("Invalid value for `flux`, must not be `None`") # noqa: E501 - self._flux = flux - - @property - def description(self): - """Get the description of this TaskCreateRequest. - - An optional description of the task. - - :return: The description of this TaskCreateRequest. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this TaskCreateRequest. - - An optional description of the task. - - :param description: The description of this TaskCreateRequest. - :type: str - """ # noqa: E501 - self._description = description - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TaskCreateRequest): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/task_links.py b/frogpilot/third_party/influxdb_client/domain/task_links.py deleted file mode 100644 index 86465f09..00000000 --- a/frogpilot/third_party/influxdb_client/domain/task_links.py +++ /dev/null @@ -1,246 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TaskLinks(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - '_self': 'str', - 'owners': 'str', - 'members': 'str', - 'runs': 'str', - 'logs': 'str', - 'labels': 'str' - } - - attribute_map = { - '_self': 'self', - 'owners': 'owners', - 'members': 'members', - 'runs': 'runs', - 'logs': 'logs', - 'labels': 'labels' - } - - def __init__(self, _self=None, owners=None, members=None, runs=None, logs=None, labels=None): # noqa: E501,D401,D403 - """TaskLinks - a model defined in OpenAPI.""" # noqa: E501 - self.__self = None - self._owners = None - self._members = None - self._runs = None - self._logs = None - self._labels = None - self.discriminator = None - - if _self is not None: - self._self = _self - if owners is not None: - self.owners = owners - if members is not None: - self.members = members - if runs is not None: - self.runs = runs - if logs is not None: - self.logs = logs - if labels is not None: - self.labels = labels - - @property - def _self(self): - """Get the _self of this TaskLinks. - - URI of resource. - - :return: The _self of this TaskLinks. - :rtype: str - """ # noqa: E501 - return self.__self - - @_self.setter - def _self(self, _self): - """Set the _self of this TaskLinks. - - URI of resource. - - :param _self: The _self of this TaskLinks. - :type: str - """ # noqa: E501 - self.__self = _self - - @property - def owners(self): - """Get the owners of this TaskLinks. - - URI of resource. - - :return: The owners of this TaskLinks. - :rtype: str - """ # noqa: E501 - return self._owners - - @owners.setter - def owners(self, owners): - """Set the owners of this TaskLinks. - - URI of resource. - - :param owners: The owners of this TaskLinks. - :type: str - """ # noqa: E501 - self._owners = owners - - @property - def members(self): - """Get the members of this TaskLinks. - - URI of resource. - - :return: The members of this TaskLinks. - :rtype: str - """ # noqa: E501 - return self._members - - @members.setter - def members(self, members): - """Set the members of this TaskLinks. - - URI of resource. - - :param members: The members of this TaskLinks. - :type: str - """ # noqa: E501 - self._members = members - - @property - def runs(self): - """Get the runs of this TaskLinks. - - URI of resource. - - :return: The runs of this TaskLinks. - :rtype: str - """ # noqa: E501 - return self._runs - - @runs.setter - def runs(self, runs): - """Set the runs of this TaskLinks. - - URI of resource. - - :param runs: The runs of this TaskLinks. - :type: str - """ # noqa: E501 - self._runs = runs - - @property - def logs(self): - """Get the logs of this TaskLinks. - - URI of resource. - - :return: The logs of this TaskLinks. - :rtype: str - """ # noqa: E501 - return self._logs - - @logs.setter - def logs(self, logs): - """Set the logs of this TaskLinks. - - URI of resource. - - :param logs: The logs of this TaskLinks. - :type: str - """ # noqa: E501 - self._logs = logs - - @property - def labels(self): - """Get the labels of this TaskLinks. - - URI of resource. - - :return: The labels of this TaskLinks. - :rtype: str - """ # noqa: E501 - return self._labels - - @labels.setter - def labels(self, labels): - """Set the labels of this TaskLinks. - - URI of resource. - - :param labels: The labels of this TaskLinks. - :type: str - """ # noqa: E501 - self._labels = labels - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TaskLinks): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/task_status_type.py b/frogpilot/third_party/influxdb_client/domain/task_status_type.py deleted file mode 100644 index c775c39c..00000000 --- a/frogpilot/third_party/influxdb_client/domain/task_status_type.py +++ /dev/null @@ -1,88 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TaskStatusType(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - allowed enum values - """ - ACTIVE = "active" - INACTIVE = "inactive" - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501,D401,D403 - """TaskStatusType - a model defined in OpenAPI.""" # noqa: E501 self.discriminator = None - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TaskStatusType): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/task_update_request.py b/frogpilot/third_party/influxdb_client/domain/task_update_request.py deleted file mode 100644 index 1755a43f..00000000 --- a/frogpilot/third_party/influxdb_client/domain/task_update_request.py +++ /dev/null @@ -1,269 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TaskUpdateRequest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'status': 'TaskStatusType', - 'flux': 'str', - 'name': 'str', - 'every': 'str', - 'cron': 'str', - 'offset': 'str', - 'description': 'str' - } - - attribute_map = { - 'status': 'status', - 'flux': 'flux', - 'name': 'name', - 'every': 'every', - 'cron': 'cron', - 'offset': 'offset', - 'description': 'description' - } - - def __init__(self, status=None, flux=None, name=None, every=None, cron=None, offset=None, description=None): # noqa: E501,D401,D403 - """TaskUpdateRequest - a model defined in OpenAPI.""" # noqa: E501 - self._status = None - self._flux = None - self._name = None - self._every = None - self._cron = None - self._offset = None - self._description = None - self.discriminator = None - - if status is not None: - self.status = status - if flux is not None: - self.flux = flux - if name is not None: - self.name = name - if every is not None: - self.every = every - if cron is not None: - self.cron = cron - if offset is not None: - self.offset = offset - if description is not None: - self.description = description - - @property - def status(self): - """Get the status of this TaskUpdateRequest. - - :return: The status of this TaskUpdateRequest. - :rtype: TaskStatusType - """ # noqa: E501 - return self._status - - @status.setter - def status(self, status): - """Set the status of this TaskUpdateRequest. - - :param status: The status of this TaskUpdateRequest. - :type: TaskStatusType - """ # noqa: E501 - self._status = status - - @property - def flux(self): - """Get the flux of this TaskUpdateRequest. - - The Flux script that the task runs. - - :return: The flux of this TaskUpdateRequest. - :rtype: str - """ # noqa: E501 - return self._flux - - @flux.setter - def flux(self, flux): - """Set the flux of this TaskUpdateRequest. - - The Flux script that the task runs. - - :param flux: The flux of this TaskUpdateRequest. - :type: str - """ # noqa: E501 - self._flux = flux - - @property - def name(self): - """Get the name of this TaskUpdateRequest. - - Update the 'name' option in the flux script. - - :return: The name of this TaskUpdateRequest. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this TaskUpdateRequest. - - Update the 'name' option in the flux script. - - :param name: The name of this TaskUpdateRequest. - :type: str - """ # noqa: E501 - self._name = name - - @property - def every(self): - """Get the every of this TaskUpdateRequest. - - Update the 'every' option in the flux script. - - :return: The every of this TaskUpdateRequest. - :rtype: str - """ # noqa: E501 - return self._every - - @every.setter - def every(self, every): - """Set the every of this TaskUpdateRequest. - - Update the 'every' option in the flux script. - - :param every: The every of this TaskUpdateRequest. - :type: str - """ # noqa: E501 - self._every = every - - @property - def cron(self): - """Get the cron of this TaskUpdateRequest. - - Update the 'cron' option in the flux script. - - :return: The cron of this TaskUpdateRequest. - :rtype: str - """ # noqa: E501 - return self._cron - - @cron.setter - def cron(self, cron): - """Set the cron of this TaskUpdateRequest. - - Update the 'cron' option in the flux script. - - :param cron: The cron of this TaskUpdateRequest. - :type: str - """ # noqa: E501 - self._cron = cron - - @property - def offset(self): - """Get the offset of this TaskUpdateRequest. - - Update the 'offset' option in the flux script. - - :return: The offset of this TaskUpdateRequest. - :rtype: str - """ # noqa: E501 - return self._offset - - @offset.setter - def offset(self, offset): - """Set the offset of this TaskUpdateRequest. - - Update the 'offset' option in the flux script. - - :param offset: The offset of this TaskUpdateRequest. - :type: str - """ # noqa: E501 - self._offset = offset - - @property - def description(self): - """Get the description of this TaskUpdateRequest. - - Update the description of the task. - - :return: The description of this TaskUpdateRequest. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this TaskUpdateRequest. - - Update the description of the task. - - :param description: The description of this TaskUpdateRequest. - :type: str - """ # noqa: E501 - self._description = description - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TaskUpdateRequest): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/tasks.py b/frogpilot/third_party/influxdb_client/domain/tasks.py deleted file mode 100644 index 4174b04e..00000000 --- a/frogpilot/third_party/influxdb_client/domain/tasks.py +++ /dev/null @@ -1,130 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class Tasks(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'links': 'Links', - 'tasks': 'list[Task]' - } - - attribute_map = { - 'links': 'links', - 'tasks': 'tasks' - } - - def __init__(self, links=None, tasks=None): # noqa: E501,D401,D403 - """Tasks - a model defined in OpenAPI.""" # noqa: E501 - self._links = None - self._tasks = None - self.discriminator = None - - if links is not None: - self.links = links - if tasks is not None: - self.tasks = tasks - - @property - def links(self): - """Get the links of this Tasks. - - :return: The links of this Tasks. - :rtype: Links - """ # noqa: E501 - return self._links - - @links.setter - def links(self, links): - """Set the links of this Tasks. - - :param links: The links of this Tasks. - :type: Links - """ # noqa: E501 - self._links = links - - @property - def tasks(self): - """Get the tasks of this Tasks. - - :return: The tasks of this Tasks. - :rtype: list[Task] - """ # noqa: E501 - return self._tasks - - @tasks.setter - def tasks(self, tasks): - """Set the tasks of this Tasks. - - :param tasks: The tasks of this Tasks. - :type: list[Task] - """ # noqa: E501 - self._tasks = tasks - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Tasks): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/telegraf.py b/frogpilot/third_party/influxdb_client/domain/telegraf.py deleted file mode 100644 index 05e2a412..00000000 --- a/frogpilot/third_party/influxdb_client/domain/telegraf.py +++ /dev/null @@ -1,167 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.telegraf_request import TelegrafRequest - - -class Telegraf(TelegrafRequest): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'str', - 'links': 'object', - 'labels': 'list[Label]', - 'name': 'str', - 'description': 'str', - 'metadata': 'TelegrafRequestMetadata', - 'config': 'str', - 'org_id': 'str' - } - - attribute_map = { - 'id': 'id', - 'links': 'links', - 'labels': 'labels', - 'name': 'name', - 'description': 'description', - 'metadata': 'metadata', - 'config': 'config', - 'org_id': 'orgID' - } - - def __init__(self, id=None, links=None, labels=None, name=None, description=None, metadata=None, config=None, org_id=None): # noqa: E501,D401,D403 - """Telegraf - a model defined in OpenAPI.""" # noqa: E501 - TelegrafRequest.__init__(self, name=name, description=description, metadata=metadata, config=config, org_id=org_id) # noqa: E501 - - self._id = None - self._links = None - self._labels = None - self.discriminator = None - - if id is not None: - self.id = id - if links is not None: - self.links = links - if labels is not None: - self.labels = labels - - @property - def id(self): - """Get the id of this Telegraf. - - :return: The id of this Telegraf. - :rtype: str - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this Telegraf. - - :param id: The id of this Telegraf. - :type: str - """ # noqa: E501 - self._id = id - - @property - def links(self): - """Get the links of this Telegraf. - - :return: The links of this Telegraf. - :rtype: object - """ # noqa: E501 - return self._links - - @links.setter - def links(self, links): - """Set the links of this Telegraf. - - :param links: The links of this Telegraf. - :type: object - """ # noqa: E501 - self._links = links - - @property - def labels(self): - """Get the labels of this Telegraf. - - :return: The labels of this Telegraf. - :rtype: list[Label] - """ # noqa: E501 - return self._labels - - @labels.setter - def labels(self, labels): - """Set the labels of this Telegraf. - - :param labels: The labels of this Telegraf. - :type: list[Label] - """ # noqa: E501 - self._labels = labels - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Telegraf): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/telegraf_plugin.py b/frogpilot/third_party/influxdb_client/domain/telegraf_plugin.py deleted file mode 100644 index a01c2ef7..00000000 --- a/frogpilot/third_party/influxdb_client/domain/telegraf_plugin.py +++ /dev/null @@ -1,176 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TelegrafPlugin(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'name': 'str', - 'description': 'str', - 'config': 'dict(str, object)' - } - - attribute_map = { - 'type': 'type', - 'name': 'name', - 'description': 'description', - 'config': 'config' - } - - def __init__(self, type=None, name=None, description=None, config=None): # noqa: E501,D401,D403 - """TelegrafPlugin - a model defined in OpenAPI.""" # noqa: E501 - self._type = None - self._name = None - self._description = None - self._config = None - self.discriminator = None - - if type is not None: - self.type = type - if name is not None: - self.name = name - if description is not None: - self.description = description - if config is not None: - self.config = config - - @property - def type(self): - """Get the type of this TelegrafPlugin. - - :return: The type of this TelegrafPlugin. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this TelegrafPlugin. - - :param type: The type of this TelegrafPlugin. - :type: str - """ # noqa: E501 - self._type = type - - @property - def name(self): - """Get the name of this TelegrafPlugin. - - :return: The name of this TelegrafPlugin. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this TelegrafPlugin. - - :param name: The name of this TelegrafPlugin. - :type: str - """ # noqa: E501 - self._name = name - - @property - def description(self): - """Get the description of this TelegrafPlugin. - - :return: The description of this TelegrafPlugin. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this TelegrafPlugin. - - :param description: The description of this TelegrafPlugin. - :type: str - """ # noqa: E501 - self._description = description - - @property - def config(self): - """Get the config of this TelegrafPlugin. - - :return: The config of this TelegrafPlugin. - :rtype: dict(str, object) - """ # noqa: E501 - return self._config - - @config.setter - def config(self, config): - """Set the config of this TelegrafPlugin. - - :param config: The config of this TelegrafPlugin. - :type: dict(str, object) - """ # noqa: E501 - self._config = config - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TelegrafPlugin): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/telegraf_plugin_request.py b/frogpilot/third_party/influxdb_client/domain/telegraf_plugin_request.py deleted file mode 100644 index 79287c33..00000000 --- a/frogpilot/third_party/influxdb_client/domain/telegraf_plugin_request.py +++ /dev/null @@ -1,222 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TelegrafPluginRequest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str', - 'description': 'str', - 'plugins': 'list[TelegrafPluginRequestPlugins]', - 'metadata': 'TelegrafRequestMetadata', - 'config': 'str', - 'org_id': 'str' - } - - attribute_map = { - 'name': 'name', - 'description': 'description', - 'plugins': 'plugins', - 'metadata': 'metadata', - 'config': 'config', - 'org_id': 'orgID' - } - - def __init__(self, name=None, description=None, plugins=None, metadata=None, config=None, org_id=None): # noqa: E501,D401,D403 - """TelegrafPluginRequest - a model defined in OpenAPI.""" # noqa: E501 - self._name = None - self._description = None - self._plugins = None - self._metadata = None - self._config = None - self._org_id = None - self.discriminator = None - - if name is not None: - self.name = name - if description is not None: - self.description = description - if plugins is not None: - self.plugins = plugins - if metadata is not None: - self.metadata = metadata - if config is not None: - self.config = config - if org_id is not None: - self.org_id = org_id - - @property - def name(self): - """Get the name of this TelegrafPluginRequest. - - :return: The name of this TelegrafPluginRequest. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this TelegrafPluginRequest. - - :param name: The name of this TelegrafPluginRequest. - :type: str - """ # noqa: E501 - self._name = name - - @property - def description(self): - """Get the description of this TelegrafPluginRequest. - - :return: The description of this TelegrafPluginRequest. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this TelegrafPluginRequest. - - :param description: The description of this TelegrafPluginRequest. - :type: str - """ # noqa: E501 - self._description = description - - @property - def plugins(self): - """Get the plugins of this TelegrafPluginRequest. - - :return: The plugins of this TelegrafPluginRequest. - :rtype: list[TelegrafPluginRequestPlugins] - """ # noqa: E501 - return self._plugins - - @plugins.setter - def plugins(self, plugins): - """Set the plugins of this TelegrafPluginRequest. - - :param plugins: The plugins of this TelegrafPluginRequest. - :type: list[TelegrafPluginRequestPlugins] - """ # noqa: E501 - self._plugins = plugins - - @property - def metadata(self): - """Get the metadata of this TelegrafPluginRequest. - - :return: The metadata of this TelegrafPluginRequest. - :rtype: TelegrafRequestMetadata - """ # noqa: E501 - return self._metadata - - @metadata.setter - def metadata(self, metadata): - """Set the metadata of this TelegrafPluginRequest. - - :param metadata: The metadata of this TelegrafPluginRequest. - :type: TelegrafRequestMetadata - """ # noqa: E501 - self._metadata = metadata - - @property - def config(self): - """Get the config of this TelegrafPluginRequest. - - :return: The config of this TelegrafPluginRequest. - :rtype: str - """ # noqa: E501 - return self._config - - @config.setter - def config(self, config): - """Set the config of this TelegrafPluginRequest. - - :param config: The config of this TelegrafPluginRequest. - :type: str - """ # noqa: E501 - self._config = config - - @property - def org_id(self): - """Get the org_id of this TelegrafPluginRequest. - - :return: The org_id of this TelegrafPluginRequest. - :rtype: str - """ # noqa: E501 - return self._org_id - - @org_id.setter - def org_id(self, org_id): - """Set the org_id of this TelegrafPluginRequest. - - :param org_id: The org_id of this TelegrafPluginRequest. - :type: str - """ # noqa: E501 - self._org_id = org_id - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TelegrafPluginRequest): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/telegraf_plugin_request_plugins.py b/frogpilot/third_party/influxdb_client/domain/telegraf_plugin_request_plugins.py deleted file mode 100644 index 1ccf0dbf..00000000 --- a/frogpilot/third_party/influxdb_client/domain/telegraf_plugin_request_plugins.py +++ /dev/null @@ -1,199 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TelegrafPluginRequestPlugins(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'name': 'str', - 'alias': 'str', - 'description': 'str', - 'config': 'dict(str, object)' - } - - attribute_map = { - 'type': 'type', - 'name': 'name', - 'alias': 'alias', - 'description': 'description', - 'config': 'config' - } - - def __init__(self, type=None, name=None, alias=None, description=None, config=None): # noqa: E501,D401,D403 - """TelegrafPluginRequestPlugins - a model defined in OpenAPI.""" # noqa: E501 - self._type = None - self._name = None - self._alias = None - self._description = None - self._config = None - self.discriminator = None - - if type is not None: - self.type = type - if name is not None: - self.name = name - if alias is not None: - self.alias = alias - if description is not None: - self.description = description - if config is not None: - self.config = config - - @property - def type(self): - """Get the type of this TelegrafPluginRequestPlugins. - - :return: The type of this TelegrafPluginRequestPlugins. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this TelegrafPluginRequestPlugins. - - :param type: The type of this TelegrafPluginRequestPlugins. - :type: str - """ # noqa: E501 - self._type = type - - @property - def name(self): - """Get the name of this TelegrafPluginRequestPlugins. - - :return: The name of this TelegrafPluginRequestPlugins. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this TelegrafPluginRequestPlugins. - - :param name: The name of this TelegrafPluginRequestPlugins. - :type: str - """ # noqa: E501 - self._name = name - - @property - def alias(self): - """Get the alias of this TelegrafPluginRequestPlugins. - - :return: The alias of this TelegrafPluginRequestPlugins. - :rtype: str - """ # noqa: E501 - return self._alias - - @alias.setter - def alias(self, alias): - """Set the alias of this TelegrafPluginRequestPlugins. - - :param alias: The alias of this TelegrafPluginRequestPlugins. - :type: str - """ # noqa: E501 - self._alias = alias - - @property - def description(self): - """Get the description of this TelegrafPluginRequestPlugins. - - :return: The description of this TelegrafPluginRequestPlugins. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this TelegrafPluginRequestPlugins. - - :param description: The description of this TelegrafPluginRequestPlugins. - :type: str - """ # noqa: E501 - self._description = description - - @property - def config(self): - """Get the config of this TelegrafPluginRequestPlugins. - - :return: The config of this TelegrafPluginRequestPlugins. - :rtype: dict(str, object) - """ # noqa: E501 - return self._config - - @config.setter - def config(self, config): - """Set the config of this TelegrafPluginRequestPlugins. - - :param config: The config of this TelegrafPluginRequestPlugins. - :type: dict(str, object) - """ # noqa: E501 - self._config = config - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TelegrafPluginRequestPlugins): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/telegraf_plugins.py b/frogpilot/third_party/influxdb_client/domain/telegraf_plugins.py deleted file mode 100644 index 80a1842e..00000000 --- a/frogpilot/third_party/influxdb_client/domain/telegraf_plugins.py +++ /dev/null @@ -1,153 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TelegrafPlugins(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'version': 'str', - 'os': 'str', - 'plugins': 'list[TelegrafPlugin]' - } - - attribute_map = { - 'version': 'version', - 'os': 'os', - 'plugins': 'plugins' - } - - def __init__(self, version=None, os=None, plugins=None): # noqa: E501,D401,D403 - """TelegrafPlugins - a model defined in OpenAPI.""" # noqa: E501 - self._version = None - self._os = None - self._plugins = None - self.discriminator = None - - if version is not None: - self.version = version - if os is not None: - self.os = os - if plugins is not None: - self.plugins = plugins - - @property - def version(self): - """Get the version of this TelegrafPlugins. - - :return: The version of this TelegrafPlugins. - :rtype: str - """ # noqa: E501 - return self._version - - @version.setter - def version(self, version): - """Set the version of this TelegrafPlugins. - - :param version: The version of this TelegrafPlugins. - :type: str - """ # noqa: E501 - self._version = version - - @property - def os(self): - """Get the os of this TelegrafPlugins. - - :return: The os of this TelegrafPlugins. - :rtype: str - """ # noqa: E501 - return self._os - - @os.setter - def os(self, os): - """Set the os of this TelegrafPlugins. - - :param os: The os of this TelegrafPlugins. - :type: str - """ # noqa: E501 - self._os = os - - @property - def plugins(self): - """Get the plugins of this TelegrafPlugins. - - :return: The plugins of this TelegrafPlugins. - :rtype: list[TelegrafPlugin] - """ # noqa: E501 - return self._plugins - - @plugins.setter - def plugins(self, plugins): - """Set the plugins of this TelegrafPlugins. - - :param plugins: The plugins of this TelegrafPlugins. - :type: list[TelegrafPlugin] - """ # noqa: E501 - self._plugins = plugins - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TelegrafPlugins): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/telegraf_request.py b/frogpilot/third_party/influxdb_client/domain/telegraf_request.py deleted file mode 100644 index 898deb88..00000000 --- a/frogpilot/third_party/influxdb_client/domain/telegraf_request.py +++ /dev/null @@ -1,199 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TelegrafRequest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str', - 'description': 'str', - 'metadata': 'TelegrafRequestMetadata', - 'config': 'str', - 'org_id': 'str' - } - - attribute_map = { - 'name': 'name', - 'description': 'description', - 'metadata': 'metadata', - 'config': 'config', - 'org_id': 'orgID' - } - - def __init__(self, name=None, description=None, metadata=None, config=None, org_id=None): # noqa: E501,D401,D403 - """TelegrafRequest - a model defined in OpenAPI.""" # noqa: E501 - self._name = None - self._description = None - self._metadata = None - self._config = None - self._org_id = None - self.discriminator = None - - if name is not None: - self.name = name - if description is not None: - self.description = description - if metadata is not None: - self.metadata = metadata - if config is not None: - self.config = config - if org_id is not None: - self.org_id = org_id - - @property - def name(self): - """Get the name of this TelegrafRequest. - - :return: The name of this TelegrafRequest. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this TelegrafRequest. - - :param name: The name of this TelegrafRequest. - :type: str - """ # noqa: E501 - self._name = name - - @property - def description(self): - """Get the description of this TelegrafRequest. - - :return: The description of this TelegrafRequest. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this TelegrafRequest. - - :param description: The description of this TelegrafRequest. - :type: str - """ # noqa: E501 - self._description = description - - @property - def metadata(self): - """Get the metadata of this TelegrafRequest. - - :return: The metadata of this TelegrafRequest. - :rtype: TelegrafRequestMetadata - """ # noqa: E501 - return self._metadata - - @metadata.setter - def metadata(self, metadata): - """Set the metadata of this TelegrafRequest. - - :param metadata: The metadata of this TelegrafRequest. - :type: TelegrafRequestMetadata - """ # noqa: E501 - self._metadata = metadata - - @property - def config(self): - """Get the config of this TelegrafRequest. - - :return: The config of this TelegrafRequest. - :rtype: str - """ # noqa: E501 - return self._config - - @config.setter - def config(self, config): - """Set the config of this TelegrafRequest. - - :param config: The config of this TelegrafRequest. - :type: str - """ # noqa: E501 - self._config = config - - @property - def org_id(self): - """Get the org_id of this TelegrafRequest. - - :return: The org_id of this TelegrafRequest. - :rtype: str - """ # noqa: E501 - return self._org_id - - @org_id.setter - def org_id(self, org_id): - """Set the org_id of this TelegrafRequest. - - :param org_id: The org_id of this TelegrafRequest. - :type: str - """ # noqa: E501 - self._org_id = org_id - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TelegrafRequest): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/telegraf_request_metadata.py b/frogpilot/third_party/influxdb_client/domain/telegraf_request_metadata.py deleted file mode 100644 index e7a9f813..00000000 --- a/frogpilot/third_party/influxdb_client/domain/telegraf_request_metadata.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TelegrafRequestMetadata(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'buckets': 'list[str]' - } - - attribute_map = { - 'buckets': 'buckets' - } - - def __init__(self, buckets=None): # noqa: E501,D401,D403 - """TelegrafRequestMetadata - a model defined in OpenAPI.""" # noqa: E501 - self._buckets = None - self.discriminator = None - - if buckets is not None: - self.buckets = buckets - - @property - def buckets(self): - """Get the buckets of this TelegrafRequestMetadata. - - :return: The buckets of this TelegrafRequestMetadata. - :rtype: list[str] - """ # noqa: E501 - return self._buckets - - @buckets.setter - def buckets(self, buckets): - """Set the buckets of this TelegrafRequestMetadata. - - :param buckets: The buckets of this TelegrafRequestMetadata. - :type: list[str] - """ # noqa: E501 - self._buckets = buckets - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TelegrafRequestMetadata): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/telegrafs.py b/frogpilot/third_party/influxdb_client/domain/telegrafs.py deleted file mode 100644 index 17d7760e..00000000 --- a/frogpilot/third_party/influxdb_client/domain/telegrafs.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class Telegrafs(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'configurations': 'list[Telegraf]' - } - - attribute_map = { - 'configurations': 'configurations' - } - - def __init__(self, configurations=None): # noqa: E501,D401,D403 - """Telegrafs - a model defined in OpenAPI.""" # noqa: E501 - self._configurations = None - self.discriminator = None - - if configurations is not None: - self.configurations = configurations - - @property - def configurations(self): - """Get the configurations of this Telegrafs. - - :return: The configurations of this Telegrafs. - :rtype: list[Telegraf] - """ # noqa: E501 - return self._configurations - - @configurations.setter - def configurations(self, configurations): - """Set the configurations of this Telegrafs. - - :param configurations: The configurations of this Telegrafs. - :type: list[Telegraf] - """ # noqa: E501 - self._configurations = configurations - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Telegrafs): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/telegram_notification_endpoint.py b/frogpilot/third_party/influxdb_client/domain/telegram_notification_endpoint.py deleted file mode 100644 index 44c22dff..00000000 --- a/frogpilot/third_party/influxdb_client/domain/telegram_notification_endpoint.py +++ /dev/null @@ -1,166 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.notification_endpoint_discriminator import NotificationEndpointDiscriminator - - -class TelegramNotificationEndpoint(NotificationEndpointDiscriminator): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'token': 'str', - 'channel': 'str', - 'id': 'str', - 'org_id': 'str', - 'user_id': 'str', - 'created_at': 'datetime', - 'updated_at': 'datetime', - 'description': 'str', - 'name': 'str', - 'status': 'str', - 'labels': 'list[Label]', - 'links': 'NotificationEndpointBaseLinks', - 'type': 'NotificationEndpointType' - } - - attribute_map = { - 'token': 'token', - 'channel': 'channel', - 'id': 'id', - 'org_id': 'orgID', - 'user_id': 'userID', - 'created_at': 'createdAt', - 'updated_at': 'updatedAt', - 'description': 'description', - 'name': 'name', - 'status': 'status', - 'labels': 'labels', - 'links': 'links', - 'type': 'type' - } - - def __init__(self, token=None, channel=None, id=None, org_id=None, user_id=None, created_at=None, updated_at=None, description=None, name=None, status='active', labels=None, links=None, type="telegram"): # noqa: E501,D401,D403 - """TelegramNotificationEndpoint - a model defined in OpenAPI.""" # noqa: E501 - NotificationEndpointDiscriminator.__init__(self, id=id, org_id=org_id, user_id=user_id, created_at=created_at, updated_at=updated_at, description=description, name=name, status=status, labels=labels, links=links, type=type) # noqa: E501 - - self._token = None - self._channel = None - self.discriminator = None - - self.token = token - self.channel = channel - - @property - def token(self): - """Get the token of this TelegramNotificationEndpoint. - - Specifies the Telegram bot token. See https://core.telegram.org/bots#creating-a-new-bot . - - :return: The token of this TelegramNotificationEndpoint. - :rtype: str - """ # noqa: E501 - return self._token - - @token.setter - def token(self, token): - """Set the token of this TelegramNotificationEndpoint. - - Specifies the Telegram bot token. See https://core.telegram.org/bots#creating-a-new-bot . - - :param token: The token of this TelegramNotificationEndpoint. - :type: str - """ # noqa: E501 - if token is None: - raise ValueError("Invalid value for `token`, must not be `None`") # noqa: E501 - self._token = token - - @property - def channel(self): - """Get the channel of this TelegramNotificationEndpoint. - - The ID of the telegram channel; a chat_id in https://core.telegram.org/bots/api#sendmessage . - - :return: The channel of this TelegramNotificationEndpoint. - :rtype: str - """ # noqa: E501 - return self._channel - - @channel.setter - def channel(self, channel): - """Set the channel of this TelegramNotificationEndpoint. - - The ID of the telegram channel; a chat_id in https://core.telegram.org/bots/api#sendmessage . - - :param channel: The channel of this TelegramNotificationEndpoint. - :type: str - """ # noqa: E501 - if channel is None: - raise ValueError("Invalid value for `channel`, must not be `None`") # noqa: E501 - self._channel = channel - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TelegramNotificationEndpoint): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/telegram_notification_rule.py b/frogpilot/third_party/influxdb_client/domain/telegram_notification_rule.py deleted file mode 100644 index 2238909c..00000000 --- a/frogpilot/third_party/influxdb_client/domain/telegram_notification_rule.py +++ /dev/null @@ -1,140 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.telegram_notification_rule_base import TelegramNotificationRuleBase - - -class TelegramNotificationRule(TelegramNotificationRuleBase): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'message_template': 'str', - 'parse_mode': 'str', - 'disable_web_page_preview': 'bool', - 'latest_completed': 'datetime', - 'last_run_status': 'str', - 'last_run_error': 'str', - 'id': 'str', - 'endpoint_id': 'str', - 'org_id': 'str', - 'task_id': 'str', - 'owner_id': 'str', - 'created_at': 'datetime', - 'updated_at': 'datetime', - 'status': 'TaskStatusType', - 'name': 'str', - 'sleep_until': 'str', - 'every': 'str', - 'offset': 'str', - 'runbook_link': 'str', - 'limit_every': 'int', - 'limit': 'int', - 'tag_rules': 'list[TagRule]', - 'description': 'str', - 'status_rules': 'list[StatusRule]', - 'labels': 'list[Label]', - 'links': 'NotificationRuleBaseLinks' - } - - attribute_map = { - 'type': 'type', - 'message_template': 'messageTemplate', - 'parse_mode': 'parseMode', - 'disable_web_page_preview': 'disableWebPagePreview', - 'latest_completed': 'latestCompleted', - 'last_run_status': 'lastRunStatus', - 'last_run_error': 'lastRunError', - 'id': 'id', - 'endpoint_id': 'endpointID', - 'org_id': 'orgID', - 'task_id': 'taskID', - 'owner_id': 'ownerID', - 'created_at': 'createdAt', - 'updated_at': 'updatedAt', - 'status': 'status', - 'name': 'name', - 'sleep_until': 'sleepUntil', - 'every': 'every', - 'offset': 'offset', - 'runbook_link': 'runbookLink', - 'limit_every': 'limitEvery', - 'limit': 'limit', - 'tag_rules': 'tagRules', - 'description': 'description', - 'status_rules': 'statusRules', - 'labels': 'labels', - 'links': 'links' - } - - def __init__(self, type="telegram", message_template=None, parse_mode=None, disable_web_page_preview=None, latest_completed=None, last_run_status=None, last_run_error=None, id=None, endpoint_id=None, org_id=None, task_id=None, owner_id=None, created_at=None, updated_at=None, status=None, name=None, sleep_until=None, every=None, offset=None, runbook_link=None, limit_every=None, limit=None, tag_rules=None, description=None, status_rules=None, labels=None, links=None): # noqa: E501,D401,D403 - """TelegramNotificationRule - a model defined in OpenAPI.""" # noqa: E501 - TelegramNotificationRuleBase.__init__(self, type=type, message_template=message_template, parse_mode=parse_mode, disable_web_page_preview=disable_web_page_preview, latest_completed=latest_completed, last_run_status=last_run_status, last_run_error=last_run_error, id=id, endpoint_id=endpoint_id, org_id=org_id, task_id=task_id, owner_id=owner_id, created_at=created_at, updated_at=updated_at, status=status, name=name, sleep_until=sleep_until, every=every, offset=offset, runbook_link=runbook_link, limit_every=limit_every, limit=limit, tag_rules=tag_rules, description=description, status_rules=status_rules, labels=labels, links=links) # noqa: E501 - self.discriminator = None - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TelegramNotificationRule): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/telegram_notification_rule_base.py b/frogpilot/third_party/influxdb_client/domain/telegram_notification_rule_base.py deleted file mode 100644 index 8d3aeb1b..00000000 --- a/frogpilot/third_party/influxdb_client/domain/telegram_notification_rule_base.py +++ /dev/null @@ -1,244 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.notification_rule_discriminator import NotificationRuleDiscriminator - - -class TelegramNotificationRuleBase(NotificationRuleDiscriminator): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'message_template': 'str', - 'parse_mode': 'str', - 'disable_web_page_preview': 'bool', - 'latest_completed': 'datetime', - 'last_run_status': 'str', - 'last_run_error': 'str', - 'id': 'str', - 'endpoint_id': 'str', - 'org_id': 'str', - 'task_id': 'str', - 'owner_id': 'str', - 'created_at': 'datetime', - 'updated_at': 'datetime', - 'status': 'TaskStatusType', - 'name': 'str', - 'sleep_until': 'str', - 'every': 'str', - 'offset': 'str', - 'runbook_link': 'str', - 'limit_every': 'int', - 'limit': 'int', - 'tag_rules': 'list[TagRule]', - 'description': 'str', - 'status_rules': 'list[StatusRule]', - 'labels': 'list[Label]', - 'links': 'NotificationRuleBaseLinks' - } - - attribute_map = { - 'type': 'type', - 'message_template': 'messageTemplate', - 'parse_mode': 'parseMode', - 'disable_web_page_preview': 'disableWebPagePreview', - 'latest_completed': 'latestCompleted', - 'last_run_status': 'lastRunStatus', - 'last_run_error': 'lastRunError', - 'id': 'id', - 'endpoint_id': 'endpointID', - 'org_id': 'orgID', - 'task_id': 'taskID', - 'owner_id': 'ownerID', - 'created_at': 'createdAt', - 'updated_at': 'updatedAt', - 'status': 'status', - 'name': 'name', - 'sleep_until': 'sleepUntil', - 'every': 'every', - 'offset': 'offset', - 'runbook_link': 'runbookLink', - 'limit_every': 'limitEvery', - 'limit': 'limit', - 'tag_rules': 'tagRules', - 'description': 'description', - 'status_rules': 'statusRules', - 'labels': 'labels', - 'links': 'links' - } - - def __init__(self, type=None, message_template=None, parse_mode=None, disable_web_page_preview=None, latest_completed=None, last_run_status=None, last_run_error=None, id=None, endpoint_id=None, org_id=None, task_id=None, owner_id=None, created_at=None, updated_at=None, status=None, name=None, sleep_until=None, every=None, offset=None, runbook_link=None, limit_every=None, limit=None, tag_rules=None, description=None, status_rules=None, labels=None, links=None): # noqa: E501,D401,D403 - """TelegramNotificationRuleBase - a model defined in OpenAPI.""" # noqa: E501 - NotificationRuleDiscriminator.__init__(self, latest_completed=latest_completed, last_run_status=last_run_status, last_run_error=last_run_error, id=id, endpoint_id=endpoint_id, org_id=org_id, task_id=task_id, owner_id=owner_id, created_at=created_at, updated_at=updated_at, status=status, name=name, sleep_until=sleep_until, every=every, offset=offset, runbook_link=runbook_link, limit_every=limit_every, limit=limit, tag_rules=tag_rules, description=description, status_rules=status_rules, labels=labels, links=links) # noqa: E501 - - self._type = None - self._message_template = None - self._parse_mode = None - self._disable_web_page_preview = None - self.discriminator = None - - self.type = type - self.message_template = message_template - if parse_mode is not None: - self.parse_mode = parse_mode - if disable_web_page_preview is not None: - self.disable_web_page_preview = disable_web_page_preview - - @property - def type(self): - """Get the type of this TelegramNotificationRuleBase. - - The discriminator between other types of notification rules is "telegram". - - :return: The type of this TelegramNotificationRuleBase. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this TelegramNotificationRuleBase. - - The discriminator between other types of notification rules is "telegram". - - :param type: The type of this TelegramNotificationRuleBase. - :type: str - """ # noqa: E501 - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - self._type = type - - @property - def message_template(self): - """Get the message_template of this TelegramNotificationRuleBase. - - The message template as a flux interpolated string. - - :return: The message_template of this TelegramNotificationRuleBase. - :rtype: str - """ # noqa: E501 - return self._message_template - - @message_template.setter - def message_template(self, message_template): - """Set the message_template of this TelegramNotificationRuleBase. - - The message template as a flux interpolated string. - - :param message_template: The message_template of this TelegramNotificationRuleBase. - :type: str - """ # noqa: E501 - if message_template is None: - raise ValueError("Invalid value for `message_template`, must not be `None`") # noqa: E501 - self._message_template = message_template - - @property - def parse_mode(self): - """Get the parse_mode of this TelegramNotificationRuleBase. - - Parse mode of the message text per https://core.telegram.org/bots/api#formatting-options. Defaults to "MarkdownV2". - - :return: The parse_mode of this TelegramNotificationRuleBase. - :rtype: str - """ # noqa: E501 - return self._parse_mode - - @parse_mode.setter - def parse_mode(self, parse_mode): - """Set the parse_mode of this TelegramNotificationRuleBase. - - Parse mode of the message text per https://core.telegram.org/bots/api#formatting-options. Defaults to "MarkdownV2". - - :param parse_mode: The parse_mode of this TelegramNotificationRuleBase. - :type: str - """ # noqa: E501 - self._parse_mode = parse_mode - - @property - def disable_web_page_preview(self): - """Get the disable_web_page_preview of this TelegramNotificationRuleBase. - - Disables preview of web links in the sent messages when "true". Defaults to "false". - - :return: The disable_web_page_preview of this TelegramNotificationRuleBase. - :rtype: bool - """ # noqa: E501 - return self._disable_web_page_preview - - @disable_web_page_preview.setter - def disable_web_page_preview(self, disable_web_page_preview): - """Set the disable_web_page_preview of this TelegramNotificationRuleBase. - - Disables preview of web links in the sent messages when "true". Defaults to "false". - - :param disable_web_page_preview: The disable_web_page_preview of this TelegramNotificationRuleBase. - :type: bool - """ # noqa: E501 - self._disable_web_page_preview = disable_web_page_preview - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TelegramNotificationRuleBase): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/template_apply.py b/frogpilot/third_party/influxdb_client/domain/template_apply.py deleted file mode 100644 index 6f8d5e40..00000000 --- a/frogpilot/third_party/influxdb_client/domain/template_apply.py +++ /dev/null @@ -1,323 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TemplateApply(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'dry_run': 'bool', - 'org_id': 'str', - 'stack_id': 'str', - 'template': 'TemplateApplyTemplate', - 'templates': 'list[TemplateApplyTemplate]', - 'env_refs': 'dict(str, object)', - 'secrets': 'dict(str, str)', - 'remotes': 'list[TemplateApplyRemotes]', - 'actions': 'list[object]' - } - - attribute_map = { - 'dry_run': 'dryRun', - 'org_id': 'orgID', - 'stack_id': 'stackID', - 'template': 'template', - 'templates': 'templates', - 'env_refs': 'envRefs', - 'secrets': 'secrets', - 'remotes': 'remotes', - 'actions': 'actions' - } - - def __init__(self, dry_run=None, org_id=None, stack_id=None, template=None, templates=None, env_refs=None, secrets=None, remotes=None, actions=None): # noqa: E501,D401,D403 - """TemplateApply - a model defined in OpenAPI.""" # noqa: E501 - self._dry_run = None - self._org_id = None - self._stack_id = None - self._template = None - self._templates = None - self._env_refs = None - self._secrets = None - self._remotes = None - self._actions = None - self.discriminator = None - - if dry_run is not None: - self.dry_run = dry_run - if org_id is not None: - self.org_id = org_id - if stack_id is not None: - self.stack_id = stack_id - if template is not None: - self.template = template - if templates is not None: - self.templates = templates - if env_refs is not None: - self.env_refs = env_refs - if secrets is not None: - self.secrets = secrets - if remotes is not None: - self.remotes = remotes - if actions is not None: - self.actions = actions - - @property - def dry_run(self): - """Get the dry_run of this TemplateApply. - - Only applies a dry run of the templates passed in the request. - Validates the template and generates a resource diff and summary. - Doesn't install templates or make changes to the InfluxDB instance. - - :return: The dry_run of this TemplateApply. - :rtype: bool - """ # noqa: E501 - return self._dry_run - - @dry_run.setter - def dry_run(self, dry_run): - """Set the dry_run of this TemplateApply. - - Only applies a dry run of the templates passed in the request. - Validates the template and generates a resource diff and summary. - Doesn't install templates or make changes to the InfluxDB instance. - - :param dry_run: The dry_run of this TemplateApply. - :type: bool - """ # noqa: E501 - self._dry_run = dry_run - - @property - def org_id(self): - """Get the org_id of this TemplateApply. - - Organization ID. InfluxDB applies templates to this organization. The organization owns all resources created by the template. To find your organization, see how to [view organizations](https://docs.influxdata.com/influxdb/latest/organizations/view-orgs/). - - :return: The org_id of this TemplateApply. - :rtype: str - """ # noqa: E501 - return self._org_id - - @org_id.setter - def org_id(self, org_id): - """Set the org_id of this TemplateApply. - - Organization ID. InfluxDB applies templates to this organization. The organization owns all resources created by the template. To find your organization, see how to [view organizations](https://docs.influxdata.com/influxdb/latest/organizations/view-orgs/). - - :param org_id: The org_id of this TemplateApply. - :type: str - """ # noqa: E501 - self._org_id = org_id - - @property - def stack_id(self): - """Get the stack_id of this TemplateApply. - - ID of the stack to update. To apply templates to an existing stack in the organization, use the `stackID` parameter. If you apply templates without providing a stack ID, InfluxDB initializes a new stack with all new resources. To find a stack ID, use the InfluxDB [`/api/v2/stacks` API endpoint](#operation/ListStacks) to list stacks. #### Related guides - [Stacks](https://docs.influxdata.com/influxdb/latest/influxdb-templates/stacks/) - [View stacks](https://docs.influxdata.com/influxdb/latest/influxdb-templates/stacks/view/) - - :return: The stack_id of this TemplateApply. - :rtype: str - """ # noqa: E501 - return self._stack_id - - @stack_id.setter - def stack_id(self, stack_id): - """Set the stack_id of this TemplateApply. - - ID of the stack to update. To apply templates to an existing stack in the organization, use the `stackID` parameter. If you apply templates without providing a stack ID, InfluxDB initializes a new stack with all new resources. To find a stack ID, use the InfluxDB [`/api/v2/stacks` API endpoint](#operation/ListStacks) to list stacks. #### Related guides - [Stacks](https://docs.influxdata.com/influxdb/latest/influxdb-templates/stacks/) - [View stacks](https://docs.influxdata.com/influxdb/latest/influxdb-templates/stacks/view/) - - :param stack_id: The stack_id of this TemplateApply. - :type: str - """ # noqa: E501 - self._stack_id = stack_id - - @property - def template(self): - """Get the template of this TemplateApply. - - :return: The template of this TemplateApply. - :rtype: TemplateApplyTemplate - """ # noqa: E501 - return self._template - - @template.setter - def template(self, template): - """Set the template of this TemplateApply. - - :param template: The template of this TemplateApply. - :type: TemplateApplyTemplate - """ # noqa: E501 - self._template = template - - @property - def templates(self): - """Get the templates of this TemplateApply. - - A list of template objects to apply. A template object has a `contents` property with an array of InfluxDB resource configurations. Use the `templates` parameter to apply multiple template objects. If you use `templates`, you can't use the `template` parameter. - - :return: The templates of this TemplateApply. - :rtype: list[TemplateApplyTemplate] - """ # noqa: E501 - return self._templates - - @templates.setter - def templates(self, templates): - """Set the templates of this TemplateApply. - - A list of template objects to apply. A template object has a `contents` property with an array of InfluxDB resource configurations. Use the `templates` parameter to apply multiple template objects. If you use `templates`, you can't use the `template` parameter. - - :param templates: The templates of this TemplateApply. - :type: list[TemplateApplyTemplate] - """ # noqa: E501 - self._templates = templates - - @property - def env_refs(self): - """Get the env_refs of this TemplateApply. - - An object with key-value pairs that map to **environment references** in templates. Environment references in templates are `envRef` objects with an `envRef.key` property. To substitute a custom environment reference value when applying templates, pass `envRefs` with the `envRef.key` and the value. When you apply a template, InfluxDB replaces `envRef` objects in the template with the values that you provide in the `envRefs` parameter. For more examples, see how to [define environment references](https://docs.influxdata.com/influxdb/latest/influxdb-templates/use/#define-environment-references). The following template fields may use environment references: - `metadata.name` - `spec.endpointName` - `spec.associations.name` For more information about including environment references in template fields, see how to [include user-definable resource names](https://docs.influxdata.com/influxdb/latest/influxdb-templates/create/#include-user-definable-resource-names). - - :return: The env_refs of this TemplateApply. - :rtype: dict(str, object) - """ # noqa: E501 - return self._env_refs - - @env_refs.setter - def env_refs(self, env_refs): - """Set the env_refs of this TemplateApply. - - An object with key-value pairs that map to **environment references** in templates. Environment references in templates are `envRef` objects with an `envRef.key` property. To substitute a custom environment reference value when applying templates, pass `envRefs` with the `envRef.key` and the value. When you apply a template, InfluxDB replaces `envRef` objects in the template with the values that you provide in the `envRefs` parameter. For more examples, see how to [define environment references](https://docs.influxdata.com/influxdb/latest/influxdb-templates/use/#define-environment-references). The following template fields may use environment references: - `metadata.name` - `spec.endpointName` - `spec.associations.name` For more information about including environment references in template fields, see how to [include user-definable resource names](https://docs.influxdata.com/influxdb/latest/influxdb-templates/create/#include-user-definable-resource-names). - - :param env_refs: The env_refs of this TemplateApply. - :type: dict(str, object) - """ # noqa: E501 - self._env_refs = env_refs - - @property - def secrets(self): - """Get the secrets of this TemplateApply. - - An object with key-value pairs that map to **secrets** in queries. Queries may reference secrets stored in InfluxDB--for example, the following Flux script retrieves `POSTGRES_USERNAME` and `POSTGRES_PASSWORD` secrets and then uses them to connect to a PostgreSQL database: ```js import "sql" import "influxdata/influxdb/secrets" username = secrets.get(key: "POSTGRES_USERNAME") password = secrets.get(key: "POSTGRES_PASSWORD") sql.from( driverName: "postgres", dataSourceName: "postgresql://${username}:${password}@localhost:5432", query: "SELECT * FROM example_table", ) ``` To define secret values in your `/api/v2/templates/apply` request, pass the `secrets` parameter with key-value pairs--for example: ```json { ... "secrets": { "POSTGRES_USERNAME": "pguser", "POSTGRES_PASSWORD": "foo" } ... } ``` InfluxDB stores the key-value pairs as secrets that you can access with `secrets.get()`. Once stored, you can't view secret values in InfluxDB. #### Related guides - [How to pass secrets when installing a template](https://docs.influxdata.com/influxdb/latest/influxdb-templates/use/#pass-secrets-when-installing-a-template) - - :return: The secrets of this TemplateApply. - :rtype: dict(str, str) - """ # noqa: E501 - return self._secrets - - @secrets.setter - def secrets(self, secrets): - """Set the secrets of this TemplateApply. - - An object with key-value pairs that map to **secrets** in queries. Queries may reference secrets stored in InfluxDB--for example, the following Flux script retrieves `POSTGRES_USERNAME` and `POSTGRES_PASSWORD` secrets and then uses them to connect to a PostgreSQL database: ```js import "sql" import "influxdata/influxdb/secrets" username = secrets.get(key: "POSTGRES_USERNAME") password = secrets.get(key: "POSTGRES_PASSWORD") sql.from( driverName: "postgres", dataSourceName: "postgresql://${username}:${password}@localhost:5432", query: "SELECT * FROM example_table", ) ``` To define secret values in your `/api/v2/templates/apply` request, pass the `secrets` parameter with key-value pairs--for example: ```json { ... "secrets": { "POSTGRES_USERNAME": "pguser", "POSTGRES_PASSWORD": "foo" } ... } ``` InfluxDB stores the key-value pairs as secrets that you can access with `secrets.get()`. Once stored, you can't view secret values in InfluxDB. #### Related guides - [How to pass secrets when installing a template](https://docs.influxdata.com/influxdb/latest/influxdb-templates/use/#pass-secrets-when-installing-a-template) - - :param secrets: The secrets of this TemplateApply. - :type: dict(str, str) - """ # noqa: E501 - self._secrets = secrets - - @property - def remotes(self): - """Get the remotes of this TemplateApply. - - A list of URLs for template files. To apply a template manifest file located at a URL, pass `remotes` with an array that contains the URL. - - :return: The remotes of this TemplateApply. - :rtype: list[TemplateApplyRemotes] - """ # noqa: E501 - return self._remotes - - @remotes.setter - def remotes(self, remotes): - """Set the remotes of this TemplateApply. - - A list of URLs for template files. To apply a template manifest file located at a URL, pass `remotes` with an array that contains the URL. - - :param remotes: The remotes of this TemplateApply. - :type: list[TemplateApplyRemotes] - """ # noqa: E501 - self._remotes = remotes - - @property - def actions(self): - """Get the actions of this TemplateApply. - - A list of `action` objects. Actions let you customize how InfluxDB applies templates in the request. You can use the following actions to prevent creating or updating resources: - A `skipKind` action skips template resources of a specified `kind`. - A `skipResource` action skips template resources with a specified `metadata.name` and `kind`. - - :return: The actions of this TemplateApply. - :rtype: list[object] - """ # noqa: E501 - return self._actions - - @actions.setter - def actions(self, actions): - """Set the actions of this TemplateApply. - - A list of `action` objects. Actions let you customize how InfluxDB applies templates in the request. You can use the following actions to prevent creating or updating resources: - A `skipKind` action skips template resources of a specified `kind`. - A `skipResource` action skips template resources with a specified `metadata.name` and `kind`. - - :param actions: The actions of this TemplateApply. - :type: list[object] - """ # noqa: E501 - self._actions = actions - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TemplateApply): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/template_apply_remotes.py b/frogpilot/third_party/influxdb_client/domain/template_apply_remotes.py deleted file mode 100644 index bdb835bc..00000000 --- a/frogpilot/third_party/influxdb_client/domain/template_apply_remotes.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TemplateApplyRemotes(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'url': 'str', - 'content_type': 'str' - } - - attribute_map = { - 'url': 'url', - 'content_type': 'contentType' - } - - def __init__(self, url=None, content_type=None): # noqa: E501,D401,D403 - """TemplateApplyRemotes - a model defined in OpenAPI.""" # noqa: E501 - self._url = None - self._content_type = None - self.discriminator = None - - self.url = url - if content_type is not None: - self.content_type = content_type - - @property - def url(self): - """Get the url of this TemplateApplyRemotes. - - :return: The url of this TemplateApplyRemotes. - :rtype: str - """ # noqa: E501 - return self._url - - @url.setter - def url(self, url): - """Set the url of this TemplateApplyRemotes. - - :param url: The url of this TemplateApplyRemotes. - :type: str - """ # noqa: E501 - if url is None: - raise ValueError("Invalid value for `url`, must not be `None`") # noqa: E501 - self._url = url - - @property - def content_type(self): - """Get the content_type of this TemplateApplyRemotes. - - :return: The content_type of this TemplateApplyRemotes. - :rtype: str - """ # noqa: E501 - return self._content_type - - @content_type.setter - def content_type(self, content_type): - """Set the content_type of this TemplateApplyRemotes. - - :param content_type: The content_type of this TemplateApplyRemotes. - :type: str - """ # noqa: E501 - self._content_type = content_type - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TemplateApplyRemotes): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/template_apply_template.py b/frogpilot/third_party/influxdb_client/domain/template_apply_template.py deleted file mode 100644 index 0fee8e97..00000000 --- a/frogpilot/third_party/influxdb_client/domain/template_apply_template.py +++ /dev/null @@ -1,153 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TemplateApplyTemplate(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'content_type': 'str', - 'sources': 'list[str]', - 'contents': 'list[object]' - } - - attribute_map = { - 'content_type': 'contentType', - 'sources': 'sources', - 'contents': 'contents' - } - - def __init__(self, content_type=None, sources=None, contents=None): # noqa: E501,D401,D403 - """TemplateApplyTemplate - a model defined in OpenAPI.""" # noqa: E501 - self._content_type = None - self._sources = None - self._contents = None - self.discriminator = None - - if content_type is not None: - self.content_type = content_type - if sources is not None: - self.sources = sources - if contents is not None: - self.contents = contents - - @property - def content_type(self): - """Get the content_type of this TemplateApplyTemplate. - - :return: The content_type of this TemplateApplyTemplate. - :rtype: str - """ # noqa: E501 - return self._content_type - - @content_type.setter - def content_type(self, content_type): - """Set the content_type of this TemplateApplyTemplate. - - :param content_type: The content_type of this TemplateApplyTemplate. - :type: str - """ # noqa: E501 - self._content_type = content_type - - @property - def sources(self): - """Get the sources of this TemplateApplyTemplate. - - :return: The sources of this TemplateApplyTemplate. - :rtype: list[str] - """ # noqa: E501 - return self._sources - - @sources.setter - def sources(self, sources): - """Set the sources of this TemplateApplyTemplate. - - :param sources: The sources of this TemplateApplyTemplate. - :type: list[str] - """ # noqa: E501 - self._sources = sources - - @property - def contents(self): - """Get the contents of this TemplateApplyTemplate. - - :return: The contents of this TemplateApplyTemplate. - :rtype: list[object] - """ # noqa: E501 - return self._contents - - @contents.setter - def contents(self, contents): - """Set the contents of this TemplateApplyTemplate. - - :param contents: The contents of this TemplateApplyTemplate. - :type: list[object] - """ # noqa: E501 - self._contents = contents - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TemplateApplyTemplate): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/template_chart.py b/frogpilot/third_party/influxdb_client/domain/template_chart.py deleted file mode 100644 index 7ae7b357..00000000 --- a/frogpilot/third_party/influxdb_client/domain/template_chart.py +++ /dev/null @@ -1,199 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TemplateChart(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'x_pos': 'int', - 'y_pos': 'int', - 'height': 'int', - 'width': 'int', - 'properties': 'ViewProperties' - } - - attribute_map = { - 'x_pos': 'xPos', - 'y_pos': 'yPos', - 'height': 'height', - 'width': 'width', - 'properties': 'properties' - } - - def __init__(self, x_pos=None, y_pos=None, height=None, width=None, properties=None): # noqa: E501,D401,D403 - """TemplateChart - a model defined in OpenAPI.""" # noqa: E501 - self._x_pos = None - self._y_pos = None - self._height = None - self._width = None - self._properties = None - self.discriminator = None - - if x_pos is not None: - self.x_pos = x_pos - if y_pos is not None: - self.y_pos = y_pos - if height is not None: - self.height = height - if width is not None: - self.width = width - if properties is not None: - self.properties = properties - - @property - def x_pos(self): - """Get the x_pos of this TemplateChart. - - :return: The x_pos of this TemplateChart. - :rtype: int - """ # noqa: E501 - return self._x_pos - - @x_pos.setter - def x_pos(self, x_pos): - """Set the x_pos of this TemplateChart. - - :param x_pos: The x_pos of this TemplateChart. - :type: int - """ # noqa: E501 - self._x_pos = x_pos - - @property - def y_pos(self): - """Get the y_pos of this TemplateChart. - - :return: The y_pos of this TemplateChart. - :rtype: int - """ # noqa: E501 - return self._y_pos - - @y_pos.setter - def y_pos(self, y_pos): - """Set the y_pos of this TemplateChart. - - :param y_pos: The y_pos of this TemplateChart. - :type: int - """ # noqa: E501 - self._y_pos = y_pos - - @property - def height(self): - """Get the height of this TemplateChart. - - :return: The height of this TemplateChart. - :rtype: int - """ # noqa: E501 - return self._height - - @height.setter - def height(self, height): - """Set the height of this TemplateChart. - - :param height: The height of this TemplateChart. - :type: int - """ # noqa: E501 - self._height = height - - @property - def width(self): - """Get the width of this TemplateChart. - - :return: The width of this TemplateChart. - :rtype: int - """ # noqa: E501 - return self._width - - @width.setter - def width(self, width): - """Set the width of this TemplateChart. - - :param width: The width of this TemplateChart. - :type: int - """ # noqa: E501 - self._width = width - - @property - def properties(self): - """Get the properties of this TemplateChart. - - :return: The properties of this TemplateChart. - :rtype: ViewProperties - """ # noqa: E501 - return self._properties - - @properties.setter - def properties(self, properties): - """Set the properties of this TemplateChart. - - :param properties: The properties of this TemplateChart. - :type: ViewProperties - """ # noqa: E501 - self._properties = properties - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TemplateChart): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/template_export_by_id.py b/frogpilot/third_party/influxdb_client/domain/template_export_by_id.py deleted file mode 100644 index 7b5f2123..00000000 --- a/frogpilot/third_party/influxdb_client/domain/template_export_by_id.py +++ /dev/null @@ -1,153 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TemplateExportByID(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'stack_id': 'str', - 'org_ids': 'list[TemplateExportByIDOrgIDs]', - 'resources': 'list[TemplateExportByIDResources]' - } - - attribute_map = { - 'stack_id': 'stackID', - 'org_ids': 'orgIDs', - 'resources': 'resources' - } - - def __init__(self, stack_id=None, org_ids=None, resources=None): # noqa: E501,D401,D403 - """TemplateExportByID - a model defined in OpenAPI.""" # noqa: E501 - self._stack_id = None - self._org_ids = None - self._resources = None - self.discriminator = None - - if stack_id is not None: - self.stack_id = stack_id - if org_ids is not None: - self.org_ids = org_ids - if resources is not None: - self.resources = resources - - @property - def stack_id(self): - """Get the stack_id of this TemplateExportByID. - - :return: The stack_id of this TemplateExportByID. - :rtype: str - """ # noqa: E501 - return self._stack_id - - @stack_id.setter - def stack_id(self, stack_id): - """Set the stack_id of this TemplateExportByID. - - :param stack_id: The stack_id of this TemplateExportByID. - :type: str - """ # noqa: E501 - self._stack_id = stack_id - - @property - def org_ids(self): - """Get the org_ids of this TemplateExportByID. - - :return: The org_ids of this TemplateExportByID. - :rtype: list[TemplateExportByIDOrgIDs] - """ # noqa: E501 - return self._org_ids - - @org_ids.setter - def org_ids(self, org_ids): - """Set the org_ids of this TemplateExportByID. - - :param org_ids: The org_ids of this TemplateExportByID. - :type: list[TemplateExportByIDOrgIDs] - """ # noqa: E501 - self._org_ids = org_ids - - @property - def resources(self): - """Get the resources of this TemplateExportByID. - - :return: The resources of this TemplateExportByID. - :rtype: list[TemplateExportByIDResources] - """ # noqa: E501 - return self._resources - - @resources.setter - def resources(self, resources): - """Set the resources of this TemplateExportByID. - - :param resources: The resources of this TemplateExportByID. - :type: list[TemplateExportByIDResources] - """ # noqa: E501 - self._resources = resources - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TemplateExportByID): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/template_export_by_id_org_ids.py b/frogpilot/third_party/influxdb_client/domain/template_export_by_id_org_ids.py deleted file mode 100644 index f29886e5..00000000 --- a/frogpilot/third_party/influxdb_client/domain/template_export_by_id_org_ids.py +++ /dev/null @@ -1,130 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TemplateExportByIDOrgIDs(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'org_id': 'str', - 'resource_filters': 'TemplateExportByIDResourceFilters' - } - - attribute_map = { - 'org_id': 'orgID', - 'resource_filters': 'resourceFilters' - } - - def __init__(self, org_id=None, resource_filters=None): # noqa: E501,D401,D403 - """TemplateExportByIDOrgIDs - a model defined in OpenAPI.""" # noqa: E501 - self._org_id = None - self._resource_filters = None - self.discriminator = None - - if org_id is not None: - self.org_id = org_id - if resource_filters is not None: - self.resource_filters = resource_filters - - @property - def org_id(self): - """Get the org_id of this TemplateExportByIDOrgIDs. - - :return: The org_id of this TemplateExportByIDOrgIDs. - :rtype: str - """ # noqa: E501 - return self._org_id - - @org_id.setter - def org_id(self, org_id): - """Set the org_id of this TemplateExportByIDOrgIDs. - - :param org_id: The org_id of this TemplateExportByIDOrgIDs. - :type: str - """ # noqa: E501 - self._org_id = org_id - - @property - def resource_filters(self): - """Get the resource_filters of this TemplateExportByIDOrgIDs. - - :return: The resource_filters of this TemplateExportByIDOrgIDs. - :rtype: TemplateExportByIDResourceFilters - """ # noqa: E501 - return self._resource_filters - - @resource_filters.setter - def resource_filters(self, resource_filters): - """Set the resource_filters of this TemplateExportByIDOrgIDs. - - :param resource_filters: The resource_filters of this TemplateExportByIDOrgIDs. - :type: TemplateExportByIDResourceFilters - """ # noqa: E501 - self._resource_filters = resource_filters - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TemplateExportByIDOrgIDs): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/template_export_by_id_resource_filters.py b/frogpilot/third_party/influxdb_client/domain/template_export_by_id_resource_filters.py deleted file mode 100644 index 33cd9f76..00000000 --- a/frogpilot/third_party/influxdb_client/domain/template_export_by_id_resource_filters.py +++ /dev/null @@ -1,130 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TemplateExportByIDResourceFilters(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'by_label': 'list[str]', - 'by_resource_kind': 'list[TemplateKind]' - } - - attribute_map = { - 'by_label': 'byLabel', - 'by_resource_kind': 'byResourceKind' - } - - def __init__(self, by_label=None, by_resource_kind=None): # noqa: E501,D401,D403 - """TemplateExportByIDResourceFilters - a model defined in OpenAPI.""" # noqa: E501 - self._by_label = None - self._by_resource_kind = None - self.discriminator = None - - if by_label is not None: - self.by_label = by_label - if by_resource_kind is not None: - self.by_resource_kind = by_resource_kind - - @property - def by_label(self): - """Get the by_label of this TemplateExportByIDResourceFilters. - - :return: The by_label of this TemplateExportByIDResourceFilters. - :rtype: list[str] - """ # noqa: E501 - return self._by_label - - @by_label.setter - def by_label(self, by_label): - """Set the by_label of this TemplateExportByIDResourceFilters. - - :param by_label: The by_label of this TemplateExportByIDResourceFilters. - :type: list[str] - """ # noqa: E501 - self._by_label = by_label - - @property - def by_resource_kind(self): - """Get the by_resource_kind of this TemplateExportByIDResourceFilters. - - :return: The by_resource_kind of this TemplateExportByIDResourceFilters. - :rtype: list[TemplateKind] - """ # noqa: E501 - return self._by_resource_kind - - @by_resource_kind.setter - def by_resource_kind(self, by_resource_kind): - """Set the by_resource_kind of this TemplateExportByIDResourceFilters. - - :param by_resource_kind: The by_resource_kind of this TemplateExportByIDResourceFilters. - :type: list[TemplateKind] - """ # noqa: E501 - self._by_resource_kind = by_resource_kind - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TemplateExportByIDResourceFilters): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/template_export_by_id_resources.py b/frogpilot/third_party/influxdb_client/domain/template_export_by_id_resources.py deleted file mode 100644 index ddbc0b42..00000000 --- a/frogpilot/third_party/influxdb_client/domain/template_export_by_id_resources.py +++ /dev/null @@ -1,159 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TemplateExportByIDResources(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'str', - 'kind': 'TemplateKind', - 'name': 'str' - } - - attribute_map = { - 'id': 'id', - 'kind': 'kind', - 'name': 'name' - } - - def __init__(self, id=None, kind=None, name=None): # noqa: E501,D401,D403 - """TemplateExportByIDResources - a model defined in OpenAPI.""" # noqa: E501 - self._id = None - self._kind = None - self._name = None - self.discriminator = None - - self.id = id - self.kind = kind - if name is not None: - self.name = name - - @property - def id(self): - """Get the id of this TemplateExportByIDResources. - - :return: The id of this TemplateExportByIDResources. - :rtype: str - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this TemplateExportByIDResources. - - :param id: The id of this TemplateExportByIDResources. - :type: str - """ # noqa: E501 - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 - self._id = id - - @property - def kind(self): - """Get the kind of this TemplateExportByIDResources. - - :return: The kind of this TemplateExportByIDResources. - :rtype: TemplateKind - """ # noqa: E501 - return self._kind - - @kind.setter - def kind(self, kind): - """Set the kind of this TemplateExportByIDResources. - - :param kind: The kind of this TemplateExportByIDResources. - :type: TemplateKind - """ # noqa: E501 - if kind is None: - raise ValueError("Invalid value for `kind`, must not be `None`") # noqa: E501 - self._kind = kind - - @property - def name(self): - """Get the name of this TemplateExportByIDResources. - - if defined with id, name is used for resource exported by id. if defined independently, resources strictly matching name are exported - - :return: The name of this TemplateExportByIDResources. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this TemplateExportByIDResources. - - if defined with id, name is used for resource exported by id. if defined independently, resources strictly matching name are exported - - :param name: The name of this TemplateExportByIDResources. - :type: str - """ # noqa: E501 - self._name = name - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TemplateExportByIDResources): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/template_export_by_name.py b/frogpilot/third_party/influxdb_client/domain/template_export_by_name.py deleted file mode 100644 index aa096dea..00000000 --- a/frogpilot/third_party/influxdb_client/domain/template_export_by_name.py +++ /dev/null @@ -1,153 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TemplateExportByName(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'stack_id': 'str', - 'org_ids': 'list[TemplateExportByIDOrgIDs]', - 'resources': 'list[TemplateExportByNameResources]' - } - - attribute_map = { - 'stack_id': 'stackID', - 'org_ids': 'orgIDs', - 'resources': 'resources' - } - - def __init__(self, stack_id=None, org_ids=None, resources=None): # noqa: E501,D401,D403 - """TemplateExportByName - a model defined in OpenAPI.""" # noqa: E501 - self._stack_id = None - self._org_ids = None - self._resources = None - self.discriminator = None - - if stack_id is not None: - self.stack_id = stack_id - if org_ids is not None: - self.org_ids = org_ids - if resources is not None: - self.resources = resources - - @property - def stack_id(self): - """Get the stack_id of this TemplateExportByName. - - :return: The stack_id of this TemplateExportByName. - :rtype: str - """ # noqa: E501 - return self._stack_id - - @stack_id.setter - def stack_id(self, stack_id): - """Set the stack_id of this TemplateExportByName. - - :param stack_id: The stack_id of this TemplateExportByName. - :type: str - """ # noqa: E501 - self._stack_id = stack_id - - @property - def org_ids(self): - """Get the org_ids of this TemplateExportByName. - - :return: The org_ids of this TemplateExportByName. - :rtype: list[TemplateExportByIDOrgIDs] - """ # noqa: E501 - return self._org_ids - - @org_ids.setter - def org_ids(self, org_ids): - """Set the org_ids of this TemplateExportByName. - - :param org_ids: The org_ids of this TemplateExportByName. - :type: list[TemplateExportByIDOrgIDs] - """ # noqa: E501 - self._org_ids = org_ids - - @property - def resources(self): - """Get the resources of this TemplateExportByName. - - :return: The resources of this TemplateExportByName. - :rtype: list[TemplateExportByNameResources] - """ # noqa: E501 - return self._resources - - @resources.setter - def resources(self, resources): - """Set the resources of this TemplateExportByName. - - :param resources: The resources of this TemplateExportByName. - :type: list[TemplateExportByNameResources] - """ # noqa: E501 - self._resources = resources - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TemplateExportByName): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/template_export_by_name_resources.py b/frogpilot/third_party/influxdb_client/domain/template_export_by_name_resources.py deleted file mode 100644 index 35e955b3..00000000 --- a/frogpilot/third_party/influxdb_client/domain/template_export_by_name_resources.py +++ /dev/null @@ -1,132 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TemplateExportByNameResources(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'kind': 'TemplateKind', - 'name': 'str' - } - - attribute_map = { - 'kind': 'kind', - 'name': 'name' - } - - def __init__(self, kind=None, name=None): # noqa: E501,D401,D403 - """TemplateExportByNameResources - a model defined in OpenAPI.""" # noqa: E501 - self._kind = None - self._name = None - self.discriminator = None - - self.kind = kind - self.name = name - - @property - def kind(self): - """Get the kind of this TemplateExportByNameResources. - - :return: The kind of this TemplateExportByNameResources. - :rtype: TemplateKind - """ # noqa: E501 - return self._kind - - @kind.setter - def kind(self, kind): - """Set the kind of this TemplateExportByNameResources. - - :param kind: The kind of this TemplateExportByNameResources. - :type: TemplateKind - """ # noqa: E501 - if kind is None: - raise ValueError("Invalid value for `kind`, must not be `None`") # noqa: E501 - self._kind = kind - - @property - def name(self): - """Get the name of this TemplateExportByNameResources. - - :return: The name of this TemplateExportByNameResources. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this TemplateExportByNameResources. - - :param name: The name of this TemplateExportByNameResources. - :type: str - """ # noqa: E501 - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - self._name = name - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TemplateExportByNameResources): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/template_kind.py b/frogpilot/third_party/influxdb_client/domain/template_kind.py deleted file mode 100644 index 256408a5..00000000 --- a/frogpilot/third_party/influxdb_client/domain/template_kind.py +++ /dev/null @@ -1,100 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TemplateKind(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - allowed enum values - """ - BUCKET = "Bucket" - CHECK = "Check" - CHECKDEADMAN = "CheckDeadman" - CHECKTHRESHOLD = "CheckThreshold" - DASHBOARD = "Dashboard" - LABEL = "Label" - NOTIFICATIONENDPOINT = "NotificationEndpoint" - NOTIFICATIONENDPOINTHTTP = "NotificationEndpointHTTP" - NOTIFICATIONENDPOINTPAGERDUTY = "NotificationEndpointPagerDuty" - NOTIFICATIONENDPOINTSLACK = "NotificationEndpointSlack" - NOTIFICATIONRULE = "NotificationRule" - TASK = "Task" - TELEGRAF = "Telegraf" - VARIABLE = "Variable" - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501,D401,D403 - """TemplateKind - a model defined in OpenAPI.""" # noqa: E501 self.discriminator = None - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TemplateKind): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/template_summary.py b/frogpilot/third_party/influxdb_client/domain/template_summary.py deleted file mode 100644 index bdb2e20a..00000000 --- a/frogpilot/third_party/influxdb_client/domain/template_summary.py +++ /dev/null @@ -1,199 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TemplateSummary(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'sources': 'list[str]', - 'stack_id': 'str', - 'summary': 'TemplateSummarySummary', - 'diff': 'TemplateSummaryDiff', - 'errors': 'list[TemplateSummaryErrors]' - } - - attribute_map = { - 'sources': 'sources', - 'stack_id': 'stackID', - 'summary': 'summary', - 'diff': 'diff', - 'errors': 'errors' - } - - def __init__(self, sources=None, stack_id=None, summary=None, diff=None, errors=None): # noqa: E501,D401,D403 - """TemplateSummary - a model defined in OpenAPI.""" # noqa: E501 - self._sources = None - self._stack_id = None - self._summary = None - self._diff = None - self._errors = None - self.discriminator = None - - if sources is not None: - self.sources = sources - if stack_id is not None: - self.stack_id = stack_id - if summary is not None: - self.summary = summary - if diff is not None: - self.diff = diff - if errors is not None: - self.errors = errors - - @property - def sources(self): - """Get the sources of this TemplateSummary. - - :return: The sources of this TemplateSummary. - :rtype: list[str] - """ # noqa: E501 - return self._sources - - @sources.setter - def sources(self, sources): - """Set the sources of this TemplateSummary. - - :param sources: The sources of this TemplateSummary. - :type: list[str] - """ # noqa: E501 - self._sources = sources - - @property - def stack_id(self): - """Get the stack_id of this TemplateSummary. - - :return: The stack_id of this TemplateSummary. - :rtype: str - """ # noqa: E501 - return self._stack_id - - @stack_id.setter - def stack_id(self, stack_id): - """Set the stack_id of this TemplateSummary. - - :param stack_id: The stack_id of this TemplateSummary. - :type: str - """ # noqa: E501 - self._stack_id = stack_id - - @property - def summary(self): - """Get the summary of this TemplateSummary. - - :return: The summary of this TemplateSummary. - :rtype: TemplateSummarySummary - """ # noqa: E501 - return self._summary - - @summary.setter - def summary(self, summary): - """Set the summary of this TemplateSummary. - - :param summary: The summary of this TemplateSummary. - :type: TemplateSummarySummary - """ # noqa: E501 - self._summary = summary - - @property - def diff(self): - """Get the diff of this TemplateSummary. - - :return: The diff of this TemplateSummary. - :rtype: TemplateSummaryDiff - """ # noqa: E501 - return self._diff - - @diff.setter - def diff(self, diff): - """Set the diff of this TemplateSummary. - - :param diff: The diff of this TemplateSummary. - :type: TemplateSummaryDiff - """ # noqa: E501 - self._diff = diff - - @property - def errors(self): - """Get the errors of this TemplateSummary. - - :return: The errors of this TemplateSummary. - :rtype: list[TemplateSummaryErrors] - """ # noqa: E501 - return self._errors - - @errors.setter - def errors(self, errors): - """Set the errors of this TemplateSummary. - - :param errors: The errors of this TemplateSummary. - :type: list[TemplateSummaryErrors] - """ # noqa: E501 - self._errors = errors - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TemplateSummary): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/template_summary_diff.py b/frogpilot/third_party/influxdb_client/domain/template_summary_diff.py deleted file mode 100644 index 468fd4f8..00000000 --- a/frogpilot/third_party/influxdb_client/domain/template_summary_diff.py +++ /dev/null @@ -1,314 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TemplateSummaryDiff(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'buckets': 'list[TemplateSummaryDiffBuckets]', - 'checks': 'list[TemplateSummaryDiffChecks]', - 'dashboards': 'list[TemplateSummaryDiffDashboards]', - 'labels': 'list[TemplateSummaryDiffLabels]', - 'label_mappings': 'list[TemplateSummaryDiffLabelMappings]', - 'notification_endpoints': 'list[TemplateSummaryDiffNotificationEndpoints]', - 'notification_rules': 'list[TemplateSummaryDiffNotificationRules]', - 'tasks': 'list[TemplateSummaryDiffTasks]', - 'telegraf_configs': 'list[TemplateSummaryDiffTelegrafConfigs]', - 'variables': 'list[TemplateSummaryDiffVariables]' - } - - attribute_map = { - 'buckets': 'buckets', - 'checks': 'checks', - 'dashboards': 'dashboards', - 'labels': 'labels', - 'label_mappings': 'labelMappings', - 'notification_endpoints': 'notificationEndpoints', - 'notification_rules': 'notificationRules', - 'tasks': 'tasks', - 'telegraf_configs': 'telegrafConfigs', - 'variables': 'variables' - } - - def __init__(self, buckets=None, checks=None, dashboards=None, labels=None, label_mappings=None, notification_endpoints=None, notification_rules=None, tasks=None, telegraf_configs=None, variables=None): # noqa: E501,D401,D403 - """TemplateSummaryDiff - a model defined in OpenAPI.""" # noqa: E501 - self._buckets = None - self._checks = None - self._dashboards = None - self._labels = None - self._label_mappings = None - self._notification_endpoints = None - self._notification_rules = None - self._tasks = None - self._telegraf_configs = None - self._variables = None - self.discriminator = None - - if buckets is not None: - self.buckets = buckets - if checks is not None: - self.checks = checks - if dashboards is not None: - self.dashboards = dashboards - if labels is not None: - self.labels = labels - if label_mappings is not None: - self.label_mappings = label_mappings - if notification_endpoints is not None: - self.notification_endpoints = notification_endpoints - if notification_rules is not None: - self.notification_rules = notification_rules - if tasks is not None: - self.tasks = tasks - if telegraf_configs is not None: - self.telegraf_configs = telegraf_configs - if variables is not None: - self.variables = variables - - @property - def buckets(self): - """Get the buckets of this TemplateSummaryDiff. - - :return: The buckets of this TemplateSummaryDiff. - :rtype: list[TemplateSummaryDiffBuckets] - """ # noqa: E501 - return self._buckets - - @buckets.setter - def buckets(self, buckets): - """Set the buckets of this TemplateSummaryDiff. - - :param buckets: The buckets of this TemplateSummaryDiff. - :type: list[TemplateSummaryDiffBuckets] - """ # noqa: E501 - self._buckets = buckets - - @property - def checks(self): - """Get the checks of this TemplateSummaryDiff. - - :return: The checks of this TemplateSummaryDiff. - :rtype: list[TemplateSummaryDiffChecks] - """ # noqa: E501 - return self._checks - - @checks.setter - def checks(self, checks): - """Set the checks of this TemplateSummaryDiff. - - :param checks: The checks of this TemplateSummaryDiff. - :type: list[TemplateSummaryDiffChecks] - """ # noqa: E501 - self._checks = checks - - @property - def dashboards(self): - """Get the dashboards of this TemplateSummaryDiff. - - :return: The dashboards of this TemplateSummaryDiff. - :rtype: list[TemplateSummaryDiffDashboards] - """ # noqa: E501 - return self._dashboards - - @dashboards.setter - def dashboards(self, dashboards): - """Set the dashboards of this TemplateSummaryDiff. - - :param dashboards: The dashboards of this TemplateSummaryDiff. - :type: list[TemplateSummaryDiffDashboards] - """ # noqa: E501 - self._dashboards = dashboards - - @property - def labels(self): - """Get the labels of this TemplateSummaryDiff. - - :return: The labels of this TemplateSummaryDiff. - :rtype: list[TemplateSummaryDiffLabels] - """ # noqa: E501 - return self._labels - - @labels.setter - def labels(self, labels): - """Set the labels of this TemplateSummaryDiff. - - :param labels: The labels of this TemplateSummaryDiff. - :type: list[TemplateSummaryDiffLabels] - """ # noqa: E501 - self._labels = labels - - @property - def label_mappings(self): - """Get the label_mappings of this TemplateSummaryDiff. - - :return: The label_mappings of this TemplateSummaryDiff. - :rtype: list[TemplateSummaryDiffLabelMappings] - """ # noqa: E501 - return self._label_mappings - - @label_mappings.setter - def label_mappings(self, label_mappings): - """Set the label_mappings of this TemplateSummaryDiff. - - :param label_mappings: The label_mappings of this TemplateSummaryDiff. - :type: list[TemplateSummaryDiffLabelMappings] - """ # noqa: E501 - self._label_mappings = label_mappings - - @property - def notification_endpoints(self): - """Get the notification_endpoints of this TemplateSummaryDiff. - - :return: The notification_endpoints of this TemplateSummaryDiff. - :rtype: list[TemplateSummaryDiffNotificationEndpoints] - """ # noqa: E501 - return self._notification_endpoints - - @notification_endpoints.setter - def notification_endpoints(self, notification_endpoints): - """Set the notification_endpoints of this TemplateSummaryDiff. - - :param notification_endpoints: The notification_endpoints of this TemplateSummaryDiff. - :type: list[TemplateSummaryDiffNotificationEndpoints] - """ # noqa: E501 - self._notification_endpoints = notification_endpoints - - @property - def notification_rules(self): - """Get the notification_rules of this TemplateSummaryDiff. - - :return: The notification_rules of this TemplateSummaryDiff. - :rtype: list[TemplateSummaryDiffNotificationRules] - """ # noqa: E501 - return self._notification_rules - - @notification_rules.setter - def notification_rules(self, notification_rules): - """Set the notification_rules of this TemplateSummaryDiff. - - :param notification_rules: The notification_rules of this TemplateSummaryDiff. - :type: list[TemplateSummaryDiffNotificationRules] - """ # noqa: E501 - self._notification_rules = notification_rules - - @property - def tasks(self): - """Get the tasks of this TemplateSummaryDiff. - - :return: The tasks of this TemplateSummaryDiff. - :rtype: list[TemplateSummaryDiffTasks] - """ # noqa: E501 - return self._tasks - - @tasks.setter - def tasks(self, tasks): - """Set the tasks of this TemplateSummaryDiff. - - :param tasks: The tasks of this TemplateSummaryDiff. - :type: list[TemplateSummaryDiffTasks] - """ # noqa: E501 - self._tasks = tasks - - @property - def telegraf_configs(self): - """Get the telegraf_configs of this TemplateSummaryDiff. - - :return: The telegraf_configs of this TemplateSummaryDiff. - :rtype: list[TemplateSummaryDiffTelegrafConfigs] - """ # noqa: E501 - return self._telegraf_configs - - @telegraf_configs.setter - def telegraf_configs(self, telegraf_configs): - """Set the telegraf_configs of this TemplateSummaryDiff. - - :param telegraf_configs: The telegraf_configs of this TemplateSummaryDiff. - :type: list[TemplateSummaryDiffTelegrafConfigs] - """ # noqa: E501 - self._telegraf_configs = telegraf_configs - - @property - def variables(self): - """Get the variables of this TemplateSummaryDiff. - - :return: The variables of this TemplateSummaryDiff. - :rtype: list[TemplateSummaryDiffVariables] - """ # noqa: E501 - return self._variables - - @variables.setter - def variables(self, variables): - """Set the variables of this TemplateSummaryDiff. - - :param variables: The variables of this TemplateSummaryDiff. - :type: list[TemplateSummaryDiffVariables] - """ # noqa: E501 - self._variables = variables - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TemplateSummaryDiff): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/template_summary_diff_buckets.py b/frogpilot/third_party/influxdb_client/domain/template_summary_diff_buckets.py deleted file mode 100644 index 48e1c046..00000000 --- a/frogpilot/third_party/influxdb_client/domain/template_summary_diff_buckets.py +++ /dev/null @@ -1,222 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TemplateSummaryDiffBuckets(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'kind': 'TemplateKind', - 'state_status': 'str', - 'id': 'str', - 'template_meta_name': 'str', - 'new': 'TemplateSummaryDiffBucketsNewOld', - 'old': 'TemplateSummaryDiffBucketsNewOld' - } - - attribute_map = { - 'kind': 'kind', - 'state_status': 'stateStatus', - 'id': 'id', - 'template_meta_name': 'templateMetaName', - 'new': 'new', - 'old': 'old' - } - - def __init__(self, kind=None, state_status=None, id=None, template_meta_name=None, new=None, old=None): # noqa: E501,D401,D403 - """TemplateSummaryDiffBuckets - a model defined in OpenAPI.""" # noqa: E501 - self._kind = None - self._state_status = None - self._id = None - self._template_meta_name = None - self._new = None - self._old = None - self.discriminator = None - - if kind is not None: - self.kind = kind - if state_status is not None: - self.state_status = state_status - if id is not None: - self.id = id - if template_meta_name is not None: - self.template_meta_name = template_meta_name - if new is not None: - self.new = new - if old is not None: - self.old = old - - @property - def kind(self): - """Get the kind of this TemplateSummaryDiffBuckets. - - :return: The kind of this TemplateSummaryDiffBuckets. - :rtype: TemplateKind - """ # noqa: E501 - return self._kind - - @kind.setter - def kind(self, kind): - """Set the kind of this TemplateSummaryDiffBuckets. - - :param kind: The kind of this TemplateSummaryDiffBuckets. - :type: TemplateKind - """ # noqa: E501 - self._kind = kind - - @property - def state_status(self): - """Get the state_status of this TemplateSummaryDiffBuckets. - - :return: The state_status of this TemplateSummaryDiffBuckets. - :rtype: str - """ # noqa: E501 - return self._state_status - - @state_status.setter - def state_status(self, state_status): - """Set the state_status of this TemplateSummaryDiffBuckets. - - :param state_status: The state_status of this TemplateSummaryDiffBuckets. - :type: str - """ # noqa: E501 - self._state_status = state_status - - @property - def id(self): - """Get the id of this TemplateSummaryDiffBuckets. - - :return: The id of this TemplateSummaryDiffBuckets. - :rtype: str - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this TemplateSummaryDiffBuckets. - - :param id: The id of this TemplateSummaryDiffBuckets. - :type: str - """ # noqa: E501 - self._id = id - - @property - def template_meta_name(self): - """Get the template_meta_name of this TemplateSummaryDiffBuckets. - - :return: The template_meta_name of this TemplateSummaryDiffBuckets. - :rtype: str - """ # noqa: E501 - return self._template_meta_name - - @template_meta_name.setter - def template_meta_name(self, template_meta_name): - """Set the template_meta_name of this TemplateSummaryDiffBuckets. - - :param template_meta_name: The template_meta_name of this TemplateSummaryDiffBuckets. - :type: str - """ # noqa: E501 - self._template_meta_name = template_meta_name - - @property - def new(self): - """Get the new of this TemplateSummaryDiffBuckets. - - :return: The new of this TemplateSummaryDiffBuckets. - :rtype: TemplateSummaryDiffBucketsNewOld - """ # noqa: E501 - return self._new - - @new.setter - def new(self, new): - """Set the new of this TemplateSummaryDiffBuckets. - - :param new: The new of this TemplateSummaryDiffBuckets. - :type: TemplateSummaryDiffBucketsNewOld - """ # noqa: E501 - self._new = new - - @property - def old(self): - """Get the old of this TemplateSummaryDiffBuckets. - - :return: The old of this TemplateSummaryDiffBuckets. - :rtype: TemplateSummaryDiffBucketsNewOld - """ # noqa: E501 - return self._old - - @old.setter - def old(self, old): - """Set the old of this TemplateSummaryDiffBuckets. - - :param old: The old of this TemplateSummaryDiffBuckets. - :type: TemplateSummaryDiffBucketsNewOld - """ # noqa: E501 - self._old = old - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TemplateSummaryDiffBuckets): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/template_summary_diff_buckets_new_old.py b/frogpilot/third_party/influxdb_client/domain/template_summary_diff_buckets_new_old.py deleted file mode 100644 index 7caf2791..00000000 --- a/frogpilot/third_party/influxdb_client/domain/template_summary_diff_buckets_new_old.py +++ /dev/null @@ -1,157 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TemplateSummaryDiffBucketsNewOld(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str', - 'description': 'str', - 'retention_rules': 'list[BucketRetentionRules]' - } - - attribute_map = { - 'name': 'name', - 'description': 'description', - 'retention_rules': 'retentionRules' - } - - def __init__(self, name=None, description=None, retention_rules=None): # noqa: E501,D401,D403 - """TemplateSummaryDiffBucketsNewOld - a model defined in OpenAPI.""" # noqa: E501 - self._name = None - self._description = None - self._retention_rules = None - self.discriminator = None - - if name is not None: - self.name = name - if description is not None: - self.description = description - if retention_rules is not None: - self.retention_rules = retention_rules - - @property - def name(self): - """Get the name of this TemplateSummaryDiffBucketsNewOld. - - :return: The name of this TemplateSummaryDiffBucketsNewOld. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this TemplateSummaryDiffBucketsNewOld. - - :param name: The name of this TemplateSummaryDiffBucketsNewOld. - :type: str - """ # noqa: E501 - self._name = name - - @property - def description(self): - """Get the description of this TemplateSummaryDiffBucketsNewOld. - - :return: The description of this TemplateSummaryDiffBucketsNewOld. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this TemplateSummaryDiffBucketsNewOld. - - :param description: The description of this TemplateSummaryDiffBucketsNewOld. - :type: str - """ # noqa: E501 - self._description = description - - @property - def retention_rules(self): - """Get the retention_rules of this TemplateSummaryDiffBucketsNewOld. - - Retention rules to expire or retain data. The InfluxDB `/api/v2` API uses `RetentionRules` to configure the [retention period](https://docs.influxdata.com/influxdb/latest/reference/glossary/#retention-period). #### InfluxDB Cloud - `retentionRules` is required. #### InfluxDB OSS - `retentionRules` isn't required. - - :return: The retention_rules of this TemplateSummaryDiffBucketsNewOld. - :rtype: list[BucketRetentionRules] - """ # noqa: E501 - return self._retention_rules - - @retention_rules.setter - def retention_rules(self, retention_rules): - """Set the retention_rules of this TemplateSummaryDiffBucketsNewOld. - - Retention rules to expire or retain data. The InfluxDB `/api/v2` API uses `RetentionRules` to configure the [retention period](https://docs.influxdata.com/influxdb/latest/reference/glossary/#retention-period). #### InfluxDB Cloud - `retentionRules` is required. #### InfluxDB OSS - `retentionRules` isn't required. - - :param retention_rules: The retention_rules of this TemplateSummaryDiffBucketsNewOld. - :type: list[BucketRetentionRules] - """ # noqa: E501 - self._retention_rules = retention_rules - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TemplateSummaryDiffBucketsNewOld): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/template_summary_diff_checks.py b/frogpilot/third_party/influxdb_client/domain/template_summary_diff_checks.py deleted file mode 100644 index 3617fa36..00000000 --- a/frogpilot/third_party/influxdb_client/domain/template_summary_diff_checks.py +++ /dev/null @@ -1,222 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TemplateSummaryDiffChecks(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'kind': 'TemplateKind', - 'state_status': 'str', - 'id': 'str', - 'template_meta_name': 'str', - 'new': 'CheckDiscriminator', - 'old': 'CheckDiscriminator' - } - - attribute_map = { - 'kind': 'kind', - 'state_status': 'stateStatus', - 'id': 'id', - 'template_meta_name': 'templateMetaName', - 'new': 'new', - 'old': 'old' - } - - def __init__(self, kind=None, state_status=None, id=None, template_meta_name=None, new=None, old=None): # noqa: E501,D401,D403 - """TemplateSummaryDiffChecks - a model defined in OpenAPI.""" # noqa: E501 - self._kind = None - self._state_status = None - self._id = None - self._template_meta_name = None - self._new = None - self._old = None - self.discriminator = None - - if kind is not None: - self.kind = kind - if state_status is not None: - self.state_status = state_status - if id is not None: - self.id = id - if template_meta_name is not None: - self.template_meta_name = template_meta_name - if new is not None: - self.new = new - if old is not None: - self.old = old - - @property - def kind(self): - """Get the kind of this TemplateSummaryDiffChecks. - - :return: The kind of this TemplateSummaryDiffChecks. - :rtype: TemplateKind - """ # noqa: E501 - return self._kind - - @kind.setter - def kind(self, kind): - """Set the kind of this TemplateSummaryDiffChecks. - - :param kind: The kind of this TemplateSummaryDiffChecks. - :type: TemplateKind - """ # noqa: E501 - self._kind = kind - - @property - def state_status(self): - """Get the state_status of this TemplateSummaryDiffChecks. - - :return: The state_status of this TemplateSummaryDiffChecks. - :rtype: str - """ # noqa: E501 - return self._state_status - - @state_status.setter - def state_status(self, state_status): - """Set the state_status of this TemplateSummaryDiffChecks. - - :param state_status: The state_status of this TemplateSummaryDiffChecks. - :type: str - """ # noqa: E501 - self._state_status = state_status - - @property - def id(self): - """Get the id of this TemplateSummaryDiffChecks. - - :return: The id of this TemplateSummaryDiffChecks. - :rtype: str - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this TemplateSummaryDiffChecks. - - :param id: The id of this TemplateSummaryDiffChecks. - :type: str - """ # noqa: E501 - self._id = id - - @property - def template_meta_name(self): - """Get the template_meta_name of this TemplateSummaryDiffChecks. - - :return: The template_meta_name of this TemplateSummaryDiffChecks. - :rtype: str - """ # noqa: E501 - return self._template_meta_name - - @template_meta_name.setter - def template_meta_name(self, template_meta_name): - """Set the template_meta_name of this TemplateSummaryDiffChecks. - - :param template_meta_name: The template_meta_name of this TemplateSummaryDiffChecks. - :type: str - """ # noqa: E501 - self._template_meta_name = template_meta_name - - @property - def new(self): - """Get the new of this TemplateSummaryDiffChecks. - - :return: The new of this TemplateSummaryDiffChecks. - :rtype: CheckDiscriminator - """ # noqa: E501 - return self._new - - @new.setter - def new(self, new): - """Set the new of this TemplateSummaryDiffChecks. - - :param new: The new of this TemplateSummaryDiffChecks. - :type: CheckDiscriminator - """ # noqa: E501 - self._new = new - - @property - def old(self): - """Get the old of this TemplateSummaryDiffChecks. - - :return: The old of this TemplateSummaryDiffChecks. - :rtype: CheckDiscriminator - """ # noqa: E501 - return self._old - - @old.setter - def old(self, old): - """Set the old of this TemplateSummaryDiffChecks. - - :param old: The old of this TemplateSummaryDiffChecks. - :type: CheckDiscriminator - """ # noqa: E501 - self._old = old - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TemplateSummaryDiffChecks): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/template_summary_diff_dashboards.py b/frogpilot/third_party/influxdb_client/domain/template_summary_diff_dashboards.py deleted file mode 100644 index 748b2a09..00000000 --- a/frogpilot/third_party/influxdb_client/domain/template_summary_diff_dashboards.py +++ /dev/null @@ -1,222 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TemplateSummaryDiffDashboards(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'state_status': 'str', - 'id': 'str', - 'kind': 'TemplateKind', - 'template_meta_name': 'str', - 'new': 'TemplateSummaryDiffDashboardsNewOld', - 'old': 'TemplateSummaryDiffDashboardsNewOld' - } - - attribute_map = { - 'state_status': 'stateStatus', - 'id': 'id', - 'kind': 'kind', - 'template_meta_name': 'templateMetaName', - 'new': 'new', - 'old': 'old' - } - - def __init__(self, state_status=None, id=None, kind=None, template_meta_name=None, new=None, old=None): # noqa: E501,D401,D403 - """TemplateSummaryDiffDashboards - a model defined in OpenAPI.""" # noqa: E501 - self._state_status = None - self._id = None - self._kind = None - self._template_meta_name = None - self._new = None - self._old = None - self.discriminator = None - - if state_status is not None: - self.state_status = state_status - if id is not None: - self.id = id - if kind is not None: - self.kind = kind - if template_meta_name is not None: - self.template_meta_name = template_meta_name - if new is not None: - self.new = new - if old is not None: - self.old = old - - @property - def state_status(self): - """Get the state_status of this TemplateSummaryDiffDashboards. - - :return: The state_status of this TemplateSummaryDiffDashboards. - :rtype: str - """ # noqa: E501 - return self._state_status - - @state_status.setter - def state_status(self, state_status): - """Set the state_status of this TemplateSummaryDiffDashboards. - - :param state_status: The state_status of this TemplateSummaryDiffDashboards. - :type: str - """ # noqa: E501 - self._state_status = state_status - - @property - def id(self): - """Get the id of this TemplateSummaryDiffDashboards. - - :return: The id of this TemplateSummaryDiffDashboards. - :rtype: str - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this TemplateSummaryDiffDashboards. - - :param id: The id of this TemplateSummaryDiffDashboards. - :type: str - """ # noqa: E501 - self._id = id - - @property - def kind(self): - """Get the kind of this TemplateSummaryDiffDashboards. - - :return: The kind of this TemplateSummaryDiffDashboards. - :rtype: TemplateKind - """ # noqa: E501 - return self._kind - - @kind.setter - def kind(self, kind): - """Set the kind of this TemplateSummaryDiffDashboards. - - :param kind: The kind of this TemplateSummaryDiffDashboards. - :type: TemplateKind - """ # noqa: E501 - self._kind = kind - - @property - def template_meta_name(self): - """Get the template_meta_name of this TemplateSummaryDiffDashboards. - - :return: The template_meta_name of this TemplateSummaryDiffDashboards. - :rtype: str - """ # noqa: E501 - return self._template_meta_name - - @template_meta_name.setter - def template_meta_name(self, template_meta_name): - """Set the template_meta_name of this TemplateSummaryDiffDashboards. - - :param template_meta_name: The template_meta_name of this TemplateSummaryDiffDashboards. - :type: str - """ # noqa: E501 - self._template_meta_name = template_meta_name - - @property - def new(self): - """Get the new of this TemplateSummaryDiffDashboards. - - :return: The new of this TemplateSummaryDiffDashboards. - :rtype: TemplateSummaryDiffDashboardsNewOld - """ # noqa: E501 - return self._new - - @new.setter - def new(self, new): - """Set the new of this TemplateSummaryDiffDashboards. - - :param new: The new of this TemplateSummaryDiffDashboards. - :type: TemplateSummaryDiffDashboardsNewOld - """ # noqa: E501 - self._new = new - - @property - def old(self): - """Get the old of this TemplateSummaryDiffDashboards. - - :return: The old of this TemplateSummaryDiffDashboards. - :rtype: TemplateSummaryDiffDashboardsNewOld - """ # noqa: E501 - return self._old - - @old.setter - def old(self, old): - """Set the old of this TemplateSummaryDiffDashboards. - - :param old: The old of this TemplateSummaryDiffDashboards. - :type: TemplateSummaryDiffDashboardsNewOld - """ # noqa: E501 - self._old = old - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TemplateSummaryDiffDashboards): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/template_summary_diff_dashboards_new_old.py b/frogpilot/third_party/influxdb_client/domain/template_summary_diff_dashboards_new_old.py deleted file mode 100644 index a2b727d4..00000000 --- a/frogpilot/third_party/influxdb_client/domain/template_summary_diff_dashboards_new_old.py +++ /dev/null @@ -1,153 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TemplateSummaryDiffDashboardsNewOld(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str', - 'description': 'str', - 'charts': 'list[TemplateChart]' - } - - attribute_map = { - 'name': 'name', - 'description': 'description', - 'charts': 'charts' - } - - def __init__(self, name=None, description=None, charts=None): # noqa: E501,D401,D403 - """TemplateSummaryDiffDashboardsNewOld - a model defined in OpenAPI.""" # noqa: E501 - self._name = None - self._description = None - self._charts = None - self.discriminator = None - - if name is not None: - self.name = name - if description is not None: - self.description = description - if charts is not None: - self.charts = charts - - @property - def name(self): - """Get the name of this TemplateSummaryDiffDashboardsNewOld. - - :return: The name of this TemplateSummaryDiffDashboardsNewOld. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this TemplateSummaryDiffDashboardsNewOld. - - :param name: The name of this TemplateSummaryDiffDashboardsNewOld. - :type: str - """ # noqa: E501 - self._name = name - - @property - def description(self): - """Get the description of this TemplateSummaryDiffDashboardsNewOld. - - :return: The description of this TemplateSummaryDiffDashboardsNewOld. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this TemplateSummaryDiffDashboardsNewOld. - - :param description: The description of this TemplateSummaryDiffDashboardsNewOld. - :type: str - """ # noqa: E501 - self._description = description - - @property - def charts(self): - """Get the charts of this TemplateSummaryDiffDashboardsNewOld. - - :return: The charts of this TemplateSummaryDiffDashboardsNewOld. - :rtype: list[TemplateChart] - """ # noqa: E501 - return self._charts - - @charts.setter - def charts(self, charts): - """Set the charts of this TemplateSummaryDiffDashboardsNewOld. - - :param charts: The charts of this TemplateSummaryDiffDashboardsNewOld. - :type: list[TemplateChart] - """ # noqa: E501 - self._charts = charts - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TemplateSummaryDiffDashboardsNewOld): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/template_summary_diff_label_mappings.py b/frogpilot/third_party/influxdb_client/domain/template_summary_diff_label_mappings.py deleted file mode 100644 index 2abb3dd7..00000000 --- a/frogpilot/third_party/influxdb_client/domain/template_summary_diff_label_mappings.py +++ /dev/null @@ -1,268 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TemplateSummaryDiffLabelMappings(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'status': 'str', - 'resource_type': 'str', - 'resource_id': 'str', - 'resource_template_meta_name': 'str', - 'resource_name': 'str', - 'label_id': 'str', - 'label_template_meta_name': 'str', - 'label_name': 'str' - } - - attribute_map = { - 'status': 'status', - 'resource_type': 'resourceType', - 'resource_id': 'resourceID', - 'resource_template_meta_name': 'resourceTemplateMetaName', - 'resource_name': 'resourceName', - 'label_id': 'labelID', - 'label_template_meta_name': 'labelTemplateMetaName', - 'label_name': 'labelName' - } - - def __init__(self, status=None, resource_type=None, resource_id=None, resource_template_meta_name=None, resource_name=None, label_id=None, label_template_meta_name=None, label_name=None): # noqa: E501,D401,D403 - """TemplateSummaryDiffLabelMappings - a model defined in OpenAPI.""" # noqa: E501 - self._status = None - self._resource_type = None - self._resource_id = None - self._resource_template_meta_name = None - self._resource_name = None - self._label_id = None - self._label_template_meta_name = None - self._label_name = None - self.discriminator = None - - if status is not None: - self.status = status - if resource_type is not None: - self.resource_type = resource_type - if resource_id is not None: - self.resource_id = resource_id - if resource_template_meta_name is not None: - self.resource_template_meta_name = resource_template_meta_name - if resource_name is not None: - self.resource_name = resource_name - if label_id is not None: - self.label_id = label_id - if label_template_meta_name is not None: - self.label_template_meta_name = label_template_meta_name - if label_name is not None: - self.label_name = label_name - - @property - def status(self): - """Get the status of this TemplateSummaryDiffLabelMappings. - - :return: The status of this TemplateSummaryDiffLabelMappings. - :rtype: str - """ # noqa: E501 - return self._status - - @status.setter - def status(self, status): - """Set the status of this TemplateSummaryDiffLabelMappings. - - :param status: The status of this TemplateSummaryDiffLabelMappings. - :type: str - """ # noqa: E501 - self._status = status - - @property - def resource_type(self): - """Get the resource_type of this TemplateSummaryDiffLabelMappings. - - :return: The resource_type of this TemplateSummaryDiffLabelMappings. - :rtype: str - """ # noqa: E501 - return self._resource_type - - @resource_type.setter - def resource_type(self, resource_type): - """Set the resource_type of this TemplateSummaryDiffLabelMappings. - - :param resource_type: The resource_type of this TemplateSummaryDiffLabelMappings. - :type: str - """ # noqa: E501 - self._resource_type = resource_type - - @property - def resource_id(self): - """Get the resource_id of this TemplateSummaryDiffLabelMappings. - - :return: The resource_id of this TemplateSummaryDiffLabelMappings. - :rtype: str - """ # noqa: E501 - return self._resource_id - - @resource_id.setter - def resource_id(self, resource_id): - """Set the resource_id of this TemplateSummaryDiffLabelMappings. - - :param resource_id: The resource_id of this TemplateSummaryDiffLabelMappings. - :type: str - """ # noqa: E501 - self._resource_id = resource_id - - @property - def resource_template_meta_name(self): - """Get the resource_template_meta_name of this TemplateSummaryDiffLabelMappings. - - :return: The resource_template_meta_name of this TemplateSummaryDiffLabelMappings. - :rtype: str - """ # noqa: E501 - return self._resource_template_meta_name - - @resource_template_meta_name.setter - def resource_template_meta_name(self, resource_template_meta_name): - """Set the resource_template_meta_name of this TemplateSummaryDiffLabelMappings. - - :param resource_template_meta_name: The resource_template_meta_name of this TemplateSummaryDiffLabelMappings. - :type: str - """ # noqa: E501 - self._resource_template_meta_name = resource_template_meta_name - - @property - def resource_name(self): - """Get the resource_name of this TemplateSummaryDiffLabelMappings. - - :return: The resource_name of this TemplateSummaryDiffLabelMappings. - :rtype: str - """ # noqa: E501 - return self._resource_name - - @resource_name.setter - def resource_name(self, resource_name): - """Set the resource_name of this TemplateSummaryDiffLabelMappings. - - :param resource_name: The resource_name of this TemplateSummaryDiffLabelMappings. - :type: str - """ # noqa: E501 - self._resource_name = resource_name - - @property - def label_id(self): - """Get the label_id of this TemplateSummaryDiffLabelMappings. - - :return: The label_id of this TemplateSummaryDiffLabelMappings. - :rtype: str - """ # noqa: E501 - return self._label_id - - @label_id.setter - def label_id(self, label_id): - """Set the label_id of this TemplateSummaryDiffLabelMappings. - - :param label_id: The label_id of this TemplateSummaryDiffLabelMappings. - :type: str - """ # noqa: E501 - self._label_id = label_id - - @property - def label_template_meta_name(self): - """Get the label_template_meta_name of this TemplateSummaryDiffLabelMappings. - - :return: The label_template_meta_name of this TemplateSummaryDiffLabelMappings. - :rtype: str - """ # noqa: E501 - return self._label_template_meta_name - - @label_template_meta_name.setter - def label_template_meta_name(self, label_template_meta_name): - """Set the label_template_meta_name of this TemplateSummaryDiffLabelMappings. - - :param label_template_meta_name: The label_template_meta_name of this TemplateSummaryDiffLabelMappings. - :type: str - """ # noqa: E501 - self._label_template_meta_name = label_template_meta_name - - @property - def label_name(self): - """Get the label_name of this TemplateSummaryDiffLabelMappings. - - :return: The label_name of this TemplateSummaryDiffLabelMappings. - :rtype: str - """ # noqa: E501 - return self._label_name - - @label_name.setter - def label_name(self, label_name): - """Set the label_name of this TemplateSummaryDiffLabelMappings. - - :param label_name: The label_name of this TemplateSummaryDiffLabelMappings. - :type: str - """ # noqa: E501 - self._label_name = label_name - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TemplateSummaryDiffLabelMappings): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/template_summary_diff_labels.py b/frogpilot/third_party/influxdb_client/domain/template_summary_diff_labels.py deleted file mode 100644 index ab6b9c06..00000000 --- a/frogpilot/third_party/influxdb_client/domain/template_summary_diff_labels.py +++ /dev/null @@ -1,222 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TemplateSummaryDiffLabels(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'state_status': 'str', - 'kind': 'TemplateKind', - 'id': 'str', - 'template_meta_name': 'str', - 'new': 'TemplateSummaryDiffLabelsNewOld', - 'old': 'TemplateSummaryDiffLabelsNewOld' - } - - attribute_map = { - 'state_status': 'stateStatus', - 'kind': 'kind', - 'id': 'id', - 'template_meta_name': 'templateMetaName', - 'new': 'new', - 'old': 'old' - } - - def __init__(self, state_status=None, kind=None, id=None, template_meta_name=None, new=None, old=None): # noqa: E501,D401,D403 - """TemplateSummaryDiffLabels - a model defined in OpenAPI.""" # noqa: E501 - self._state_status = None - self._kind = None - self._id = None - self._template_meta_name = None - self._new = None - self._old = None - self.discriminator = None - - if state_status is not None: - self.state_status = state_status - if kind is not None: - self.kind = kind - if id is not None: - self.id = id - if template_meta_name is not None: - self.template_meta_name = template_meta_name - if new is not None: - self.new = new - if old is not None: - self.old = old - - @property - def state_status(self): - """Get the state_status of this TemplateSummaryDiffLabels. - - :return: The state_status of this TemplateSummaryDiffLabels. - :rtype: str - """ # noqa: E501 - return self._state_status - - @state_status.setter - def state_status(self, state_status): - """Set the state_status of this TemplateSummaryDiffLabels. - - :param state_status: The state_status of this TemplateSummaryDiffLabels. - :type: str - """ # noqa: E501 - self._state_status = state_status - - @property - def kind(self): - """Get the kind of this TemplateSummaryDiffLabels. - - :return: The kind of this TemplateSummaryDiffLabels. - :rtype: TemplateKind - """ # noqa: E501 - return self._kind - - @kind.setter - def kind(self, kind): - """Set the kind of this TemplateSummaryDiffLabels. - - :param kind: The kind of this TemplateSummaryDiffLabels. - :type: TemplateKind - """ # noqa: E501 - self._kind = kind - - @property - def id(self): - """Get the id of this TemplateSummaryDiffLabels. - - :return: The id of this TemplateSummaryDiffLabels. - :rtype: str - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this TemplateSummaryDiffLabels. - - :param id: The id of this TemplateSummaryDiffLabels. - :type: str - """ # noqa: E501 - self._id = id - - @property - def template_meta_name(self): - """Get the template_meta_name of this TemplateSummaryDiffLabels. - - :return: The template_meta_name of this TemplateSummaryDiffLabels. - :rtype: str - """ # noqa: E501 - return self._template_meta_name - - @template_meta_name.setter - def template_meta_name(self, template_meta_name): - """Set the template_meta_name of this TemplateSummaryDiffLabels. - - :param template_meta_name: The template_meta_name of this TemplateSummaryDiffLabels. - :type: str - """ # noqa: E501 - self._template_meta_name = template_meta_name - - @property - def new(self): - """Get the new of this TemplateSummaryDiffLabels. - - :return: The new of this TemplateSummaryDiffLabels. - :rtype: TemplateSummaryDiffLabelsNewOld - """ # noqa: E501 - return self._new - - @new.setter - def new(self, new): - """Set the new of this TemplateSummaryDiffLabels. - - :param new: The new of this TemplateSummaryDiffLabels. - :type: TemplateSummaryDiffLabelsNewOld - """ # noqa: E501 - self._new = new - - @property - def old(self): - """Get the old of this TemplateSummaryDiffLabels. - - :return: The old of this TemplateSummaryDiffLabels. - :rtype: TemplateSummaryDiffLabelsNewOld - """ # noqa: E501 - return self._old - - @old.setter - def old(self, old): - """Set the old of this TemplateSummaryDiffLabels. - - :param old: The old of this TemplateSummaryDiffLabels. - :type: TemplateSummaryDiffLabelsNewOld - """ # noqa: E501 - self._old = old - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TemplateSummaryDiffLabels): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/template_summary_diff_labels_new_old.py b/frogpilot/third_party/influxdb_client/domain/template_summary_diff_labels_new_old.py deleted file mode 100644 index 27e7bdd1..00000000 --- a/frogpilot/third_party/influxdb_client/domain/template_summary_diff_labels_new_old.py +++ /dev/null @@ -1,153 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TemplateSummaryDiffLabelsNewOld(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str', - 'color': 'str', - 'description': 'str' - } - - attribute_map = { - 'name': 'name', - 'color': 'color', - 'description': 'description' - } - - def __init__(self, name=None, color=None, description=None): # noqa: E501,D401,D403 - """TemplateSummaryDiffLabelsNewOld - a model defined in OpenAPI.""" # noqa: E501 - self._name = None - self._color = None - self._description = None - self.discriminator = None - - if name is not None: - self.name = name - if color is not None: - self.color = color - if description is not None: - self.description = description - - @property - def name(self): - """Get the name of this TemplateSummaryDiffLabelsNewOld. - - :return: The name of this TemplateSummaryDiffLabelsNewOld. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this TemplateSummaryDiffLabelsNewOld. - - :param name: The name of this TemplateSummaryDiffLabelsNewOld. - :type: str - """ # noqa: E501 - self._name = name - - @property - def color(self): - """Get the color of this TemplateSummaryDiffLabelsNewOld. - - :return: The color of this TemplateSummaryDiffLabelsNewOld. - :rtype: str - """ # noqa: E501 - return self._color - - @color.setter - def color(self, color): - """Set the color of this TemplateSummaryDiffLabelsNewOld. - - :param color: The color of this TemplateSummaryDiffLabelsNewOld. - :type: str - """ # noqa: E501 - self._color = color - - @property - def description(self): - """Get the description of this TemplateSummaryDiffLabelsNewOld. - - :return: The description of this TemplateSummaryDiffLabelsNewOld. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this TemplateSummaryDiffLabelsNewOld. - - :param description: The description of this TemplateSummaryDiffLabelsNewOld. - :type: str - """ # noqa: E501 - self._description = description - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TemplateSummaryDiffLabelsNewOld): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/template_summary_diff_notification_endpoints.py b/frogpilot/third_party/influxdb_client/domain/template_summary_diff_notification_endpoints.py deleted file mode 100644 index 47dc4caf..00000000 --- a/frogpilot/third_party/influxdb_client/domain/template_summary_diff_notification_endpoints.py +++ /dev/null @@ -1,222 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TemplateSummaryDiffNotificationEndpoints(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'kind': 'TemplateKind', - 'state_status': 'str', - 'id': 'str', - 'template_meta_name': 'str', - 'new': 'NotificationEndpointDiscriminator', - 'old': 'NotificationEndpointDiscriminator' - } - - attribute_map = { - 'kind': 'kind', - 'state_status': 'stateStatus', - 'id': 'id', - 'template_meta_name': 'templateMetaName', - 'new': 'new', - 'old': 'old' - } - - def __init__(self, kind=None, state_status=None, id=None, template_meta_name=None, new=None, old=None): # noqa: E501,D401,D403 - """TemplateSummaryDiffNotificationEndpoints - a model defined in OpenAPI.""" # noqa: E501 - self._kind = None - self._state_status = None - self._id = None - self._template_meta_name = None - self._new = None - self._old = None - self.discriminator = None - - if kind is not None: - self.kind = kind - if state_status is not None: - self.state_status = state_status - if id is not None: - self.id = id - if template_meta_name is not None: - self.template_meta_name = template_meta_name - if new is not None: - self.new = new - if old is not None: - self.old = old - - @property - def kind(self): - """Get the kind of this TemplateSummaryDiffNotificationEndpoints. - - :return: The kind of this TemplateSummaryDiffNotificationEndpoints. - :rtype: TemplateKind - """ # noqa: E501 - return self._kind - - @kind.setter - def kind(self, kind): - """Set the kind of this TemplateSummaryDiffNotificationEndpoints. - - :param kind: The kind of this TemplateSummaryDiffNotificationEndpoints. - :type: TemplateKind - """ # noqa: E501 - self._kind = kind - - @property - def state_status(self): - """Get the state_status of this TemplateSummaryDiffNotificationEndpoints. - - :return: The state_status of this TemplateSummaryDiffNotificationEndpoints. - :rtype: str - """ # noqa: E501 - return self._state_status - - @state_status.setter - def state_status(self, state_status): - """Set the state_status of this TemplateSummaryDiffNotificationEndpoints. - - :param state_status: The state_status of this TemplateSummaryDiffNotificationEndpoints. - :type: str - """ # noqa: E501 - self._state_status = state_status - - @property - def id(self): - """Get the id of this TemplateSummaryDiffNotificationEndpoints. - - :return: The id of this TemplateSummaryDiffNotificationEndpoints. - :rtype: str - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this TemplateSummaryDiffNotificationEndpoints. - - :param id: The id of this TemplateSummaryDiffNotificationEndpoints. - :type: str - """ # noqa: E501 - self._id = id - - @property - def template_meta_name(self): - """Get the template_meta_name of this TemplateSummaryDiffNotificationEndpoints. - - :return: The template_meta_name of this TemplateSummaryDiffNotificationEndpoints. - :rtype: str - """ # noqa: E501 - return self._template_meta_name - - @template_meta_name.setter - def template_meta_name(self, template_meta_name): - """Set the template_meta_name of this TemplateSummaryDiffNotificationEndpoints. - - :param template_meta_name: The template_meta_name of this TemplateSummaryDiffNotificationEndpoints. - :type: str - """ # noqa: E501 - self._template_meta_name = template_meta_name - - @property - def new(self): - """Get the new of this TemplateSummaryDiffNotificationEndpoints. - - :return: The new of this TemplateSummaryDiffNotificationEndpoints. - :rtype: NotificationEndpointDiscriminator - """ # noqa: E501 - return self._new - - @new.setter - def new(self, new): - """Set the new of this TemplateSummaryDiffNotificationEndpoints. - - :param new: The new of this TemplateSummaryDiffNotificationEndpoints. - :type: NotificationEndpointDiscriminator - """ # noqa: E501 - self._new = new - - @property - def old(self): - """Get the old of this TemplateSummaryDiffNotificationEndpoints. - - :return: The old of this TemplateSummaryDiffNotificationEndpoints. - :rtype: NotificationEndpointDiscriminator - """ # noqa: E501 - return self._old - - @old.setter - def old(self, old): - """Set the old of this TemplateSummaryDiffNotificationEndpoints. - - :param old: The old of this TemplateSummaryDiffNotificationEndpoints. - :type: NotificationEndpointDiscriminator - """ # noqa: E501 - self._old = old - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TemplateSummaryDiffNotificationEndpoints): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/template_summary_diff_notification_rules.py b/frogpilot/third_party/influxdb_client/domain/template_summary_diff_notification_rules.py deleted file mode 100644 index cc4ab1ea..00000000 --- a/frogpilot/third_party/influxdb_client/domain/template_summary_diff_notification_rules.py +++ /dev/null @@ -1,222 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TemplateSummaryDiffNotificationRules(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'kind': 'TemplateKind', - 'state_status': 'str', - 'id': 'str', - 'template_meta_name': 'str', - 'new': 'TemplateSummaryDiffNotificationRulesNewOld', - 'old': 'TemplateSummaryDiffNotificationRulesNewOld' - } - - attribute_map = { - 'kind': 'kind', - 'state_status': 'stateStatus', - 'id': 'id', - 'template_meta_name': 'templateMetaName', - 'new': 'new', - 'old': 'old' - } - - def __init__(self, kind=None, state_status=None, id=None, template_meta_name=None, new=None, old=None): # noqa: E501,D401,D403 - """TemplateSummaryDiffNotificationRules - a model defined in OpenAPI.""" # noqa: E501 - self._kind = None - self._state_status = None - self._id = None - self._template_meta_name = None - self._new = None - self._old = None - self.discriminator = None - - if kind is not None: - self.kind = kind - if state_status is not None: - self.state_status = state_status - if id is not None: - self.id = id - if template_meta_name is not None: - self.template_meta_name = template_meta_name - if new is not None: - self.new = new - if old is not None: - self.old = old - - @property - def kind(self): - """Get the kind of this TemplateSummaryDiffNotificationRules. - - :return: The kind of this TemplateSummaryDiffNotificationRules. - :rtype: TemplateKind - """ # noqa: E501 - return self._kind - - @kind.setter - def kind(self, kind): - """Set the kind of this TemplateSummaryDiffNotificationRules. - - :param kind: The kind of this TemplateSummaryDiffNotificationRules. - :type: TemplateKind - """ # noqa: E501 - self._kind = kind - - @property - def state_status(self): - """Get the state_status of this TemplateSummaryDiffNotificationRules. - - :return: The state_status of this TemplateSummaryDiffNotificationRules. - :rtype: str - """ # noqa: E501 - return self._state_status - - @state_status.setter - def state_status(self, state_status): - """Set the state_status of this TemplateSummaryDiffNotificationRules. - - :param state_status: The state_status of this TemplateSummaryDiffNotificationRules. - :type: str - """ # noqa: E501 - self._state_status = state_status - - @property - def id(self): - """Get the id of this TemplateSummaryDiffNotificationRules. - - :return: The id of this TemplateSummaryDiffNotificationRules. - :rtype: str - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this TemplateSummaryDiffNotificationRules. - - :param id: The id of this TemplateSummaryDiffNotificationRules. - :type: str - """ # noqa: E501 - self._id = id - - @property - def template_meta_name(self): - """Get the template_meta_name of this TemplateSummaryDiffNotificationRules. - - :return: The template_meta_name of this TemplateSummaryDiffNotificationRules. - :rtype: str - """ # noqa: E501 - return self._template_meta_name - - @template_meta_name.setter - def template_meta_name(self, template_meta_name): - """Set the template_meta_name of this TemplateSummaryDiffNotificationRules. - - :param template_meta_name: The template_meta_name of this TemplateSummaryDiffNotificationRules. - :type: str - """ # noqa: E501 - self._template_meta_name = template_meta_name - - @property - def new(self): - """Get the new of this TemplateSummaryDiffNotificationRules. - - :return: The new of this TemplateSummaryDiffNotificationRules. - :rtype: TemplateSummaryDiffNotificationRulesNewOld - """ # noqa: E501 - return self._new - - @new.setter - def new(self, new): - """Set the new of this TemplateSummaryDiffNotificationRules. - - :param new: The new of this TemplateSummaryDiffNotificationRules. - :type: TemplateSummaryDiffNotificationRulesNewOld - """ # noqa: E501 - self._new = new - - @property - def old(self): - """Get the old of this TemplateSummaryDiffNotificationRules. - - :return: The old of this TemplateSummaryDiffNotificationRules. - :rtype: TemplateSummaryDiffNotificationRulesNewOld - """ # noqa: E501 - return self._old - - @old.setter - def old(self, old): - """Set the old of this TemplateSummaryDiffNotificationRules. - - :param old: The old of this TemplateSummaryDiffNotificationRules. - :type: TemplateSummaryDiffNotificationRulesNewOld - """ # noqa: E501 - self._old = old - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TemplateSummaryDiffNotificationRules): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/template_summary_diff_notification_rules_new_old.py b/frogpilot/third_party/influxdb_client/domain/template_summary_diff_notification_rules_new_old.py deleted file mode 100644 index b769118f..00000000 --- a/frogpilot/third_party/influxdb_client/domain/template_summary_diff_notification_rules_new_old.py +++ /dev/null @@ -1,337 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TemplateSummaryDiffNotificationRulesNewOld(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str', - 'description': 'str', - 'endpoint_name': 'str', - 'endpoint_id': 'str', - 'endpoint_type': 'str', - 'every': 'str', - 'offset': 'str', - 'message_template': 'str', - 'status': 'str', - 'status_rules': 'list[TemplateSummarySummaryStatusRules]', - 'tag_rules': 'list[TemplateSummarySummaryTagRules]' - } - - attribute_map = { - 'name': 'name', - 'description': 'description', - 'endpoint_name': 'endpointName', - 'endpoint_id': 'endpointID', - 'endpoint_type': 'endpointType', - 'every': 'every', - 'offset': 'offset', - 'message_template': 'messageTemplate', - 'status': 'status', - 'status_rules': 'statusRules', - 'tag_rules': 'tagRules' - } - - def __init__(self, name=None, description=None, endpoint_name=None, endpoint_id=None, endpoint_type=None, every=None, offset=None, message_template=None, status=None, status_rules=None, tag_rules=None): # noqa: E501,D401,D403 - """TemplateSummaryDiffNotificationRulesNewOld - a model defined in OpenAPI.""" # noqa: E501 - self._name = None - self._description = None - self._endpoint_name = None - self._endpoint_id = None - self._endpoint_type = None - self._every = None - self._offset = None - self._message_template = None - self._status = None - self._status_rules = None - self._tag_rules = None - self.discriminator = None - - if name is not None: - self.name = name - if description is not None: - self.description = description - if endpoint_name is not None: - self.endpoint_name = endpoint_name - if endpoint_id is not None: - self.endpoint_id = endpoint_id - if endpoint_type is not None: - self.endpoint_type = endpoint_type - if every is not None: - self.every = every - if offset is not None: - self.offset = offset - if message_template is not None: - self.message_template = message_template - if status is not None: - self.status = status - if status_rules is not None: - self.status_rules = status_rules - if tag_rules is not None: - self.tag_rules = tag_rules - - @property - def name(self): - """Get the name of this TemplateSummaryDiffNotificationRulesNewOld. - - :return: The name of this TemplateSummaryDiffNotificationRulesNewOld. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this TemplateSummaryDiffNotificationRulesNewOld. - - :param name: The name of this TemplateSummaryDiffNotificationRulesNewOld. - :type: str - """ # noqa: E501 - self._name = name - - @property - def description(self): - """Get the description of this TemplateSummaryDiffNotificationRulesNewOld. - - :return: The description of this TemplateSummaryDiffNotificationRulesNewOld. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this TemplateSummaryDiffNotificationRulesNewOld. - - :param description: The description of this TemplateSummaryDiffNotificationRulesNewOld. - :type: str - """ # noqa: E501 - self._description = description - - @property - def endpoint_name(self): - """Get the endpoint_name of this TemplateSummaryDiffNotificationRulesNewOld. - - :return: The endpoint_name of this TemplateSummaryDiffNotificationRulesNewOld. - :rtype: str - """ # noqa: E501 - return self._endpoint_name - - @endpoint_name.setter - def endpoint_name(self, endpoint_name): - """Set the endpoint_name of this TemplateSummaryDiffNotificationRulesNewOld. - - :param endpoint_name: The endpoint_name of this TemplateSummaryDiffNotificationRulesNewOld. - :type: str - """ # noqa: E501 - self._endpoint_name = endpoint_name - - @property - def endpoint_id(self): - """Get the endpoint_id of this TemplateSummaryDiffNotificationRulesNewOld. - - :return: The endpoint_id of this TemplateSummaryDiffNotificationRulesNewOld. - :rtype: str - """ # noqa: E501 - return self._endpoint_id - - @endpoint_id.setter - def endpoint_id(self, endpoint_id): - """Set the endpoint_id of this TemplateSummaryDiffNotificationRulesNewOld. - - :param endpoint_id: The endpoint_id of this TemplateSummaryDiffNotificationRulesNewOld. - :type: str - """ # noqa: E501 - self._endpoint_id = endpoint_id - - @property - def endpoint_type(self): - """Get the endpoint_type of this TemplateSummaryDiffNotificationRulesNewOld. - - :return: The endpoint_type of this TemplateSummaryDiffNotificationRulesNewOld. - :rtype: str - """ # noqa: E501 - return self._endpoint_type - - @endpoint_type.setter - def endpoint_type(self, endpoint_type): - """Set the endpoint_type of this TemplateSummaryDiffNotificationRulesNewOld. - - :param endpoint_type: The endpoint_type of this TemplateSummaryDiffNotificationRulesNewOld. - :type: str - """ # noqa: E501 - self._endpoint_type = endpoint_type - - @property - def every(self): - """Get the every of this TemplateSummaryDiffNotificationRulesNewOld. - - :return: The every of this TemplateSummaryDiffNotificationRulesNewOld. - :rtype: str - """ # noqa: E501 - return self._every - - @every.setter - def every(self, every): - """Set the every of this TemplateSummaryDiffNotificationRulesNewOld. - - :param every: The every of this TemplateSummaryDiffNotificationRulesNewOld. - :type: str - """ # noqa: E501 - self._every = every - - @property - def offset(self): - """Get the offset of this TemplateSummaryDiffNotificationRulesNewOld. - - :return: The offset of this TemplateSummaryDiffNotificationRulesNewOld. - :rtype: str - """ # noqa: E501 - return self._offset - - @offset.setter - def offset(self, offset): - """Set the offset of this TemplateSummaryDiffNotificationRulesNewOld. - - :param offset: The offset of this TemplateSummaryDiffNotificationRulesNewOld. - :type: str - """ # noqa: E501 - self._offset = offset - - @property - def message_template(self): - """Get the message_template of this TemplateSummaryDiffNotificationRulesNewOld. - - :return: The message_template of this TemplateSummaryDiffNotificationRulesNewOld. - :rtype: str - """ # noqa: E501 - return self._message_template - - @message_template.setter - def message_template(self, message_template): - """Set the message_template of this TemplateSummaryDiffNotificationRulesNewOld. - - :param message_template: The message_template of this TemplateSummaryDiffNotificationRulesNewOld. - :type: str - """ # noqa: E501 - self._message_template = message_template - - @property - def status(self): - """Get the status of this TemplateSummaryDiffNotificationRulesNewOld. - - :return: The status of this TemplateSummaryDiffNotificationRulesNewOld. - :rtype: str - """ # noqa: E501 - return self._status - - @status.setter - def status(self, status): - """Set the status of this TemplateSummaryDiffNotificationRulesNewOld. - - :param status: The status of this TemplateSummaryDiffNotificationRulesNewOld. - :type: str - """ # noqa: E501 - self._status = status - - @property - def status_rules(self): - """Get the status_rules of this TemplateSummaryDiffNotificationRulesNewOld. - - :return: The status_rules of this TemplateSummaryDiffNotificationRulesNewOld. - :rtype: list[TemplateSummarySummaryStatusRules] - """ # noqa: E501 - return self._status_rules - - @status_rules.setter - def status_rules(self, status_rules): - """Set the status_rules of this TemplateSummaryDiffNotificationRulesNewOld. - - :param status_rules: The status_rules of this TemplateSummaryDiffNotificationRulesNewOld. - :type: list[TemplateSummarySummaryStatusRules] - """ # noqa: E501 - self._status_rules = status_rules - - @property - def tag_rules(self): - """Get the tag_rules of this TemplateSummaryDiffNotificationRulesNewOld. - - :return: The tag_rules of this TemplateSummaryDiffNotificationRulesNewOld. - :rtype: list[TemplateSummarySummaryTagRules] - """ # noqa: E501 - return self._tag_rules - - @tag_rules.setter - def tag_rules(self, tag_rules): - """Set the tag_rules of this TemplateSummaryDiffNotificationRulesNewOld. - - :param tag_rules: The tag_rules of this TemplateSummaryDiffNotificationRulesNewOld. - :type: list[TemplateSummarySummaryTagRules] - """ # noqa: E501 - self._tag_rules = tag_rules - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TemplateSummaryDiffNotificationRulesNewOld): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/template_summary_diff_tasks.py b/frogpilot/third_party/influxdb_client/domain/template_summary_diff_tasks.py deleted file mode 100644 index 8dca893c..00000000 --- a/frogpilot/third_party/influxdb_client/domain/template_summary_diff_tasks.py +++ /dev/null @@ -1,222 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TemplateSummaryDiffTasks(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'kind': 'TemplateKind', - 'state_status': 'str', - 'id': 'str', - 'template_meta_name': 'str', - 'new': 'TemplateSummaryDiffTasksNewOld', - 'old': 'TemplateSummaryDiffTasksNewOld' - } - - attribute_map = { - 'kind': 'kind', - 'state_status': 'stateStatus', - 'id': 'id', - 'template_meta_name': 'templateMetaName', - 'new': 'new', - 'old': 'old' - } - - def __init__(self, kind=None, state_status=None, id=None, template_meta_name=None, new=None, old=None): # noqa: E501,D401,D403 - """TemplateSummaryDiffTasks - a model defined in OpenAPI.""" # noqa: E501 - self._kind = None - self._state_status = None - self._id = None - self._template_meta_name = None - self._new = None - self._old = None - self.discriminator = None - - if kind is not None: - self.kind = kind - if state_status is not None: - self.state_status = state_status - if id is not None: - self.id = id - if template_meta_name is not None: - self.template_meta_name = template_meta_name - if new is not None: - self.new = new - if old is not None: - self.old = old - - @property - def kind(self): - """Get the kind of this TemplateSummaryDiffTasks. - - :return: The kind of this TemplateSummaryDiffTasks. - :rtype: TemplateKind - """ # noqa: E501 - return self._kind - - @kind.setter - def kind(self, kind): - """Set the kind of this TemplateSummaryDiffTasks. - - :param kind: The kind of this TemplateSummaryDiffTasks. - :type: TemplateKind - """ # noqa: E501 - self._kind = kind - - @property - def state_status(self): - """Get the state_status of this TemplateSummaryDiffTasks. - - :return: The state_status of this TemplateSummaryDiffTasks. - :rtype: str - """ # noqa: E501 - return self._state_status - - @state_status.setter - def state_status(self, state_status): - """Set the state_status of this TemplateSummaryDiffTasks. - - :param state_status: The state_status of this TemplateSummaryDiffTasks. - :type: str - """ # noqa: E501 - self._state_status = state_status - - @property - def id(self): - """Get the id of this TemplateSummaryDiffTasks. - - :return: The id of this TemplateSummaryDiffTasks. - :rtype: str - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this TemplateSummaryDiffTasks. - - :param id: The id of this TemplateSummaryDiffTasks. - :type: str - """ # noqa: E501 - self._id = id - - @property - def template_meta_name(self): - """Get the template_meta_name of this TemplateSummaryDiffTasks. - - :return: The template_meta_name of this TemplateSummaryDiffTasks. - :rtype: str - """ # noqa: E501 - return self._template_meta_name - - @template_meta_name.setter - def template_meta_name(self, template_meta_name): - """Set the template_meta_name of this TemplateSummaryDiffTasks. - - :param template_meta_name: The template_meta_name of this TemplateSummaryDiffTasks. - :type: str - """ # noqa: E501 - self._template_meta_name = template_meta_name - - @property - def new(self): - """Get the new of this TemplateSummaryDiffTasks. - - :return: The new of this TemplateSummaryDiffTasks. - :rtype: TemplateSummaryDiffTasksNewOld - """ # noqa: E501 - return self._new - - @new.setter - def new(self, new): - """Set the new of this TemplateSummaryDiffTasks. - - :param new: The new of this TemplateSummaryDiffTasks. - :type: TemplateSummaryDiffTasksNewOld - """ # noqa: E501 - self._new = new - - @property - def old(self): - """Get the old of this TemplateSummaryDiffTasks. - - :return: The old of this TemplateSummaryDiffTasks. - :rtype: TemplateSummaryDiffTasksNewOld - """ # noqa: E501 - return self._old - - @old.setter - def old(self, old): - """Set the old of this TemplateSummaryDiffTasks. - - :param old: The old of this TemplateSummaryDiffTasks. - :type: TemplateSummaryDiffTasksNewOld - """ # noqa: E501 - self._old = old - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TemplateSummaryDiffTasks): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/template_summary_diff_tasks_new_old.py b/frogpilot/third_party/influxdb_client/domain/template_summary_diff_tasks_new_old.py deleted file mode 100644 index 57a83e8a..00000000 --- a/frogpilot/third_party/influxdb_client/domain/template_summary_diff_tasks_new_old.py +++ /dev/null @@ -1,245 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TemplateSummaryDiffTasksNewOld(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str', - 'cron': 'str', - 'description': 'str', - 'every': 'str', - 'offset': 'str', - 'query': 'str', - 'status': 'str' - } - - attribute_map = { - 'name': 'name', - 'cron': 'cron', - 'description': 'description', - 'every': 'every', - 'offset': 'offset', - 'query': 'query', - 'status': 'status' - } - - def __init__(self, name=None, cron=None, description=None, every=None, offset=None, query=None, status=None): # noqa: E501,D401,D403 - """TemplateSummaryDiffTasksNewOld - a model defined in OpenAPI.""" # noqa: E501 - self._name = None - self._cron = None - self._description = None - self._every = None - self._offset = None - self._query = None - self._status = None - self.discriminator = None - - if name is not None: - self.name = name - if cron is not None: - self.cron = cron - if description is not None: - self.description = description - if every is not None: - self.every = every - if offset is not None: - self.offset = offset - if query is not None: - self.query = query - if status is not None: - self.status = status - - @property - def name(self): - """Get the name of this TemplateSummaryDiffTasksNewOld. - - :return: The name of this TemplateSummaryDiffTasksNewOld. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this TemplateSummaryDiffTasksNewOld. - - :param name: The name of this TemplateSummaryDiffTasksNewOld. - :type: str - """ # noqa: E501 - self._name = name - - @property - def cron(self): - """Get the cron of this TemplateSummaryDiffTasksNewOld. - - :return: The cron of this TemplateSummaryDiffTasksNewOld. - :rtype: str - """ # noqa: E501 - return self._cron - - @cron.setter - def cron(self, cron): - """Set the cron of this TemplateSummaryDiffTasksNewOld. - - :param cron: The cron of this TemplateSummaryDiffTasksNewOld. - :type: str - """ # noqa: E501 - self._cron = cron - - @property - def description(self): - """Get the description of this TemplateSummaryDiffTasksNewOld. - - :return: The description of this TemplateSummaryDiffTasksNewOld. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this TemplateSummaryDiffTasksNewOld. - - :param description: The description of this TemplateSummaryDiffTasksNewOld. - :type: str - """ # noqa: E501 - self._description = description - - @property - def every(self): - """Get the every of this TemplateSummaryDiffTasksNewOld. - - :return: The every of this TemplateSummaryDiffTasksNewOld. - :rtype: str - """ # noqa: E501 - return self._every - - @every.setter - def every(self, every): - """Set the every of this TemplateSummaryDiffTasksNewOld. - - :param every: The every of this TemplateSummaryDiffTasksNewOld. - :type: str - """ # noqa: E501 - self._every = every - - @property - def offset(self): - """Get the offset of this TemplateSummaryDiffTasksNewOld. - - :return: The offset of this TemplateSummaryDiffTasksNewOld. - :rtype: str - """ # noqa: E501 - return self._offset - - @offset.setter - def offset(self, offset): - """Set the offset of this TemplateSummaryDiffTasksNewOld. - - :param offset: The offset of this TemplateSummaryDiffTasksNewOld. - :type: str - """ # noqa: E501 - self._offset = offset - - @property - def query(self): - """Get the query of this TemplateSummaryDiffTasksNewOld. - - :return: The query of this TemplateSummaryDiffTasksNewOld. - :rtype: str - """ # noqa: E501 - return self._query - - @query.setter - def query(self, query): - """Set the query of this TemplateSummaryDiffTasksNewOld. - - :param query: The query of this TemplateSummaryDiffTasksNewOld. - :type: str - """ # noqa: E501 - self._query = query - - @property - def status(self): - """Get the status of this TemplateSummaryDiffTasksNewOld. - - :return: The status of this TemplateSummaryDiffTasksNewOld. - :rtype: str - """ # noqa: E501 - return self._status - - @status.setter - def status(self, status): - """Set the status of this TemplateSummaryDiffTasksNewOld. - - :param status: The status of this TemplateSummaryDiffTasksNewOld. - :type: str - """ # noqa: E501 - self._status = status - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TemplateSummaryDiffTasksNewOld): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/template_summary_diff_telegraf_configs.py b/frogpilot/third_party/influxdb_client/domain/template_summary_diff_telegraf_configs.py deleted file mode 100644 index 2aa8ef86..00000000 --- a/frogpilot/third_party/influxdb_client/domain/template_summary_diff_telegraf_configs.py +++ /dev/null @@ -1,222 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TemplateSummaryDiffTelegrafConfigs(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'kind': 'TemplateKind', - 'state_status': 'str', - 'id': 'str', - 'template_meta_name': 'str', - 'new': 'TelegrafRequest', - 'old': 'TelegrafRequest' - } - - attribute_map = { - 'kind': 'kind', - 'state_status': 'stateStatus', - 'id': 'id', - 'template_meta_name': 'templateMetaName', - 'new': 'new', - 'old': 'old' - } - - def __init__(self, kind=None, state_status=None, id=None, template_meta_name=None, new=None, old=None): # noqa: E501,D401,D403 - """TemplateSummaryDiffTelegrafConfigs - a model defined in OpenAPI.""" # noqa: E501 - self._kind = None - self._state_status = None - self._id = None - self._template_meta_name = None - self._new = None - self._old = None - self.discriminator = None - - if kind is not None: - self.kind = kind - if state_status is not None: - self.state_status = state_status - if id is not None: - self.id = id - if template_meta_name is not None: - self.template_meta_name = template_meta_name - if new is not None: - self.new = new - if old is not None: - self.old = old - - @property - def kind(self): - """Get the kind of this TemplateSummaryDiffTelegrafConfigs. - - :return: The kind of this TemplateSummaryDiffTelegrafConfigs. - :rtype: TemplateKind - """ # noqa: E501 - return self._kind - - @kind.setter - def kind(self, kind): - """Set the kind of this TemplateSummaryDiffTelegrafConfigs. - - :param kind: The kind of this TemplateSummaryDiffTelegrafConfigs. - :type: TemplateKind - """ # noqa: E501 - self._kind = kind - - @property - def state_status(self): - """Get the state_status of this TemplateSummaryDiffTelegrafConfigs. - - :return: The state_status of this TemplateSummaryDiffTelegrafConfigs. - :rtype: str - """ # noqa: E501 - return self._state_status - - @state_status.setter - def state_status(self, state_status): - """Set the state_status of this TemplateSummaryDiffTelegrafConfigs. - - :param state_status: The state_status of this TemplateSummaryDiffTelegrafConfigs. - :type: str - """ # noqa: E501 - self._state_status = state_status - - @property - def id(self): - """Get the id of this TemplateSummaryDiffTelegrafConfigs. - - :return: The id of this TemplateSummaryDiffTelegrafConfigs. - :rtype: str - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this TemplateSummaryDiffTelegrafConfigs. - - :param id: The id of this TemplateSummaryDiffTelegrafConfigs. - :type: str - """ # noqa: E501 - self._id = id - - @property - def template_meta_name(self): - """Get the template_meta_name of this TemplateSummaryDiffTelegrafConfigs. - - :return: The template_meta_name of this TemplateSummaryDiffTelegrafConfigs. - :rtype: str - """ # noqa: E501 - return self._template_meta_name - - @template_meta_name.setter - def template_meta_name(self, template_meta_name): - """Set the template_meta_name of this TemplateSummaryDiffTelegrafConfigs. - - :param template_meta_name: The template_meta_name of this TemplateSummaryDiffTelegrafConfigs. - :type: str - """ # noqa: E501 - self._template_meta_name = template_meta_name - - @property - def new(self): - """Get the new of this TemplateSummaryDiffTelegrafConfigs. - - :return: The new of this TemplateSummaryDiffTelegrafConfigs. - :rtype: TelegrafRequest - """ # noqa: E501 - return self._new - - @new.setter - def new(self, new): - """Set the new of this TemplateSummaryDiffTelegrafConfigs. - - :param new: The new of this TemplateSummaryDiffTelegrafConfigs. - :type: TelegrafRequest - """ # noqa: E501 - self._new = new - - @property - def old(self): - """Get the old of this TemplateSummaryDiffTelegrafConfigs. - - :return: The old of this TemplateSummaryDiffTelegrafConfigs. - :rtype: TelegrafRequest - """ # noqa: E501 - return self._old - - @old.setter - def old(self, old): - """Set the old of this TemplateSummaryDiffTelegrafConfigs. - - :param old: The old of this TemplateSummaryDiffTelegrafConfigs. - :type: TelegrafRequest - """ # noqa: E501 - self._old = old - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TemplateSummaryDiffTelegrafConfigs): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/template_summary_diff_variables.py b/frogpilot/third_party/influxdb_client/domain/template_summary_diff_variables.py deleted file mode 100644 index 3d4712eb..00000000 --- a/frogpilot/third_party/influxdb_client/domain/template_summary_diff_variables.py +++ /dev/null @@ -1,222 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TemplateSummaryDiffVariables(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'kind': 'TemplateKind', - 'state_status': 'str', - 'id': 'str', - 'template_meta_name': 'str', - 'new': 'TemplateSummaryDiffVariablesNewOld', - 'old': 'TemplateSummaryDiffVariablesNewOld' - } - - attribute_map = { - 'kind': 'kind', - 'state_status': 'stateStatus', - 'id': 'id', - 'template_meta_name': 'templateMetaName', - 'new': 'new', - 'old': 'old' - } - - def __init__(self, kind=None, state_status=None, id=None, template_meta_name=None, new=None, old=None): # noqa: E501,D401,D403 - """TemplateSummaryDiffVariables - a model defined in OpenAPI.""" # noqa: E501 - self._kind = None - self._state_status = None - self._id = None - self._template_meta_name = None - self._new = None - self._old = None - self.discriminator = None - - if kind is not None: - self.kind = kind - if state_status is not None: - self.state_status = state_status - if id is not None: - self.id = id - if template_meta_name is not None: - self.template_meta_name = template_meta_name - if new is not None: - self.new = new - if old is not None: - self.old = old - - @property - def kind(self): - """Get the kind of this TemplateSummaryDiffVariables. - - :return: The kind of this TemplateSummaryDiffVariables. - :rtype: TemplateKind - """ # noqa: E501 - return self._kind - - @kind.setter - def kind(self, kind): - """Set the kind of this TemplateSummaryDiffVariables. - - :param kind: The kind of this TemplateSummaryDiffVariables. - :type: TemplateKind - """ # noqa: E501 - self._kind = kind - - @property - def state_status(self): - """Get the state_status of this TemplateSummaryDiffVariables. - - :return: The state_status of this TemplateSummaryDiffVariables. - :rtype: str - """ # noqa: E501 - return self._state_status - - @state_status.setter - def state_status(self, state_status): - """Set the state_status of this TemplateSummaryDiffVariables. - - :param state_status: The state_status of this TemplateSummaryDiffVariables. - :type: str - """ # noqa: E501 - self._state_status = state_status - - @property - def id(self): - """Get the id of this TemplateSummaryDiffVariables. - - :return: The id of this TemplateSummaryDiffVariables. - :rtype: str - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this TemplateSummaryDiffVariables. - - :param id: The id of this TemplateSummaryDiffVariables. - :type: str - """ # noqa: E501 - self._id = id - - @property - def template_meta_name(self): - """Get the template_meta_name of this TemplateSummaryDiffVariables. - - :return: The template_meta_name of this TemplateSummaryDiffVariables. - :rtype: str - """ # noqa: E501 - return self._template_meta_name - - @template_meta_name.setter - def template_meta_name(self, template_meta_name): - """Set the template_meta_name of this TemplateSummaryDiffVariables. - - :param template_meta_name: The template_meta_name of this TemplateSummaryDiffVariables. - :type: str - """ # noqa: E501 - self._template_meta_name = template_meta_name - - @property - def new(self): - """Get the new of this TemplateSummaryDiffVariables. - - :return: The new of this TemplateSummaryDiffVariables. - :rtype: TemplateSummaryDiffVariablesNewOld - """ # noqa: E501 - return self._new - - @new.setter - def new(self, new): - """Set the new of this TemplateSummaryDiffVariables. - - :param new: The new of this TemplateSummaryDiffVariables. - :type: TemplateSummaryDiffVariablesNewOld - """ # noqa: E501 - self._new = new - - @property - def old(self): - """Get the old of this TemplateSummaryDiffVariables. - - :return: The old of this TemplateSummaryDiffVariables. - :rtype: TemplateSummaryDiffVariablesNewOld - """ # noqa: E501 - return self._old - - @old.setter - def old(self, old): - """Set the old of this TemplateSummaryDiffVariables. - - :param old: The old of this TemplateSummaryDiffVariables. - :type: TemplateSummaryDiffVariablesNewOld - """ # noqa: E501 - self._old = old - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TemplateSummaryDiffVariables): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/template_summary_diff_variables_new_old.py b/frogpilot/third_party/influxdb_client/domain/template_summary_diff_variables_new_old.py deleted file mode 100644 index 1537e5da..00000000 --- a/frogpilot/third_party/influxdb_client/domain/template_summary_diff_variables_new_old.py +++ /dev/null @@ -1,153 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TemplateSummaryDiffVariablesNewOld(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str', - 'description': 'str', - 'args': 'VariableProperties' - } - - attribute_map = { - 'name': 'name', - 'description': 'description', - 'args': 'args' - } - - def __init__(self, name=None, description=None, args=None): # noqa: E501,D401,D403 - """TemplateSummaryDiffVariablesNewOld - a model defined in OpenAPI.""" # noqa: E501 - self._name = None - self._description = None - self._args = None - self.discriminator = None - - if name is not None: - self.name = name - if description is not None: - self.description = description - if args is not None: - self.args = args - - @property - def name(self): - """Get the name of this TemplateSummaryDiffVariablesNewOld. - - :return: The name of this TemplateSummaryDiffVariablesNewOld. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this TemplateSummaryDiffVariablesNewOld. - - :param name: The name of this TemplateSummaryDiffVariablesNewOld. - :type: str - """ # noqa: E501 - self._name = name - - @property - def description(self): - """Get the description of this TemplateSummaryDiffVariablesNewOld. - - :return: The description of this TemplateSummaryDiffVariablesNewOld. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this TemplateSummaryDiffVariablesNewOld. - - :param description: The description of this TemplateSummaryDiffVariablesNewOld. - :type: str - """ # noqa: E501 - self._description = description - - @property - def args(self): - """Get the args of this TemplateSummaryDiffVariablesNewOld. - - :return: The args of this TemplateSummaryDiffVariablesNewOld. - :rtype: VariableProperties - """ # noqa: E501 - return self._args - - @args.setter - def args(self, args): - """Set the args of this TemplateSummaryDiffVariablesNewOld. - - :param args: The args of this TemplateSummaryDiffVariablesNewOld. - :type: VariableProperties - """ # noqa: E501 - self._args = args - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TemplateSummaryDiffVariablesNewOld): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/template_summary_errors.py b/frogpilot/third_party/influxdb_client/domain/template_summary_errors.py deleted file mode 100644 index 3d41ef4e..00000000 --- a/frogpilot/third_party/influxdb_client/domain/template_summary_errors.py +++ /dev/null @@ -1,176 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TemplateSummaryErrors(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'kind': 'TemplateKind', - 'reason': 'str', - 'fields': 'list[str]', - 'indexes': 'list[int]' - } - - attribute_map = { - 'kind': 'kind', - 'reason': 'reason', - 'fields': 'fields', - 'indexes': 'indexes' - } - - def __init__(self, kind=None, reason=None, fields=None, indexes=None): # noqa: E501,D401,D403 - """TemplateSummaryErrors - a model defined in OpenAPI.""" # noqa: E501 - self._kind = None - self._reason = None - self._fields = None - self._indexes = None - self.discriminator = None - - if kind is not None: - self.kind = kind - if reason is not None: - self.reason = reason - if fields is not None: - self.fields = fields - if indexes is not None: - self.indexes = indexes - - @property - def kind(self): - """Get the kind of this TemplateSummaryErrors. - - :return: The kind of this TemplateSummaryErrors. - :rtype: TemplateKind - """ # noqa: E501 - return self._kind - - @kind.setter - def kind(self, kind): - """Set the kind of this TemplateSummaryErrors. - - :param kind: The kind of this TemplateSummaryErrors. - :type: TemplateKind - """ # noqa: E501 - self._kind = kind - - @property - def reason(self): - """Get the reason of this TemplateSummaryErrors. - - :return: The reason of this TemplateSummaryErrors. - :rtype: str - """ # noqa: E501 - return self._reason - - @reason.setter - def reason(self, reason): - """Set the reason of this TemplateSummaryErrors. - - :param reason: The reason of this TemplateSummaryErrors. - :type: str - """ # noqa: E501 - self._reason = reason - - @property - def fields(self): - """Get the fields of this TemplateSummaryErrors. - - :return: The fields of this TemplateSummaryErrors. - :rtype: list[str] - """ # noqa: E501 - return self._fields - - @fields.setter - def fields(self, fields): - """Set the fields of this TemplateSummaryErrors. - - :param fields: The fields of this TemplateSummaryErrors. - :type: list[str] - """ # noqa: E501 - self._fields = fields - - @property - def indexes(self): - """Get the indexes of this TemplateSummaryErrors. - - :return: The indexes of this TemplateSummaryErrors. - :rtype: list[int] - """ # noqa: E501 - return self._indexes - - @indexes.setter - def indexes(self, indexes): - """Set the indexes of this TemplateSummaryErrors. - - :param indexes: The indexes of this TemplateSummaryErrors. - :type: list[int] - """ # noqa: E501 - self._indexes = indexes - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TemplateSummaryErrors): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/template_summary_label.py b/frogpilot/third_party/influxdb_client/domain/template_summary_label.py deleted file mode 100644 index 727260ad..00000000 --- a/frogpilot/third_party/influxdb_client/domain/template_summary_label.py +++ /dev/null @@ -1,245 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TemplateSummaryLabel(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'str', - 'org_id': 'str', - 'kind': 'TemplateKind', - 'template_meta_name': 'str', - 'name': 'str', - 'properties': 'TemplateSummaryLabelProperties', - 'env_references': 'list[object]' - } - - attribute_map = { - 'id': 'id', - 'org_id': 'orgID', - 'kind': 'kind', - 'template_meta_name': 'templateMetaName', - 'name': 'name', - 'properties': 'properties', - 'env_references': 'envReferences' - } - - def __init__(self, id=None, org_id=None, kind=None, template_meta_name=None, name=None, properties=None, env_references=None): # noqa: E501,D401,D403 - """TemplateSummaryLabel - a model defined in OpenAPI.""" # noqa: E501 - self._id = None - self._org_id = None - self._kind = None - self._template_meta_name = None - self._name = None - self._properties = None - self._env_references = None - self.discriminator = None - - if id is not None: - self.id = id - if org_id is not None: - self.org_id = org_id - if kind is not None: - self.kind = kind - if template_meta_name is not None: - self.template_meta_name = template_meta_name - if name is not None: - self.name = name - if properties is not None: - self.properties = properties - if env_references is not None: - self.env_references = env_references - - @property - def id(self): - """Get the id of this TemplateSummaryLabel. - - :return: The id of this TemplateSummaryLabel. - :rtype: str - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this TemplateSummaryLabel. - - :param id: The id of this TemplateSummaryLabel. - :type: str - """ # noqa: E501 - self._id = id - - @property - def org_id(self): - """Get the org_id of this TemplateSummaryLabel. - - :return: The org_id of this TemplateSummaryLabel. - :rtype: str - """ # noqa: E501 - return self._org_id - - @org_id.setter - def org_id(self, org_id): - """Set the org_id of this TemplateSummaryLabel. - - :param org_id: The org_id of this TemplateSummaryLabel. - :type: str - """ # noqa: E501 - self._org_id = org_id - - @property - def kind(self): - """Get the kind of this TemplateSummaryLabel. - - :return: The kind of this TemplateSummaryLabel. - :rtype: TemplateKind - """ # noqa: E501 - return self._kind - - @kind.setter - def kind(self, kind): - """Set the kind of this TemplateSummaryLabel. - - :param kind: The kind of this TemplateSummaryLabel. - :type: TemplateKind - """ # noqa: E501 - self._kind = kind - - @property - def template_meta_name(self): - """Get the template_meta_name of this TemplateSummaryLabel. - - :return: The template_meta_name of this TemplateSummaryLabel. - :rtype: str - """ # noqa: E501 - return self._template_meta_name - - @template_meta_name.setter - def template_meta_name(self, template_meta_name): - """Set the template_meta_name of this TemplateSummaryLabel. - - :param template_meta_name: The template_meta_name of this TemplateSummaryLabel. - :type: str - """ # noqa: E501 - self._template_meta_name = template_meta_name - - @property - def name(self): - """Get the name of this TemplateSummaryLabel. - - :return: The name of this TemplateSummaryLabel. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this TemplateSummaryLabel. - - :param name: The name of this TemplateSummaryLabel. - :type: str - """ # noqa: E501 - self._name = name - - @property - def properties(self): - """Get the properties of this TemplateSummaryLabel. - - :return: The properties of this TemplateSummaryLabel. - :rtype: TemplateSummaryLabelProperties - """ # noqa: E501 - return self._properties - - @properties.setter - def properties(self, properties): - """Set the properties of this TemplateSummaryLabel. - - :param properties: The properties of this TemplateSummaryLabel. - :type: TemplateSummaryLabelProperties - """ # noqa: E501 - self._properties = properties - - @property - def env_references(self): - """Get the env_references of this TemplateSummaryLabel. - - :return: The env_references of this TemplateSummaryLabel. - :rtype: list[object] - """ # noqa: E501 - return self._env_references - - @env_references.setter - def env_references(self, env_references): - """Set the env_references of this TemplateSummaryLabel. - - :param env_references: The env_references of this TemplateSummaryLabel. - :type: list[object] - """ # noqa: E501 - self._env_references = env_references - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TemplateSummaryLabel): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/template_summary_label_properties.py b/frogpilot/third_party/influxdb_client/domain/template_summary_label_properties.py deleted file mode 100644 index 82bab1e7..00000000 --- a/frogpilot/third_party/influxdb_client/domain/template_summary_label_properties.py +++ /dev/null @@ -1,130 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TemplateSummaryLabelProperties(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'color': 'str', - 'description': 'str' - } - - attribute_map = { - 'color': 'color', - 'description': 'description' - } - - def __init__(self, color=None, description=None): # noqa: E501,D401,D403 - """TemplateSummaryLabelProperties - a model defined in OpenAPI.""" # noqa: E501 - self._color = None - self._description = None - self.discriminator = None - - if color is not None: - self.color = color - if description is not None: - self.description = description - - @property - def color(self): - """Get the color of this TemplateSummaryLabelProperties. - - :return: The color of this TemplateSummaryLabelProperties. - :rtype: str - """ # noqa: E501 - return self._color - - @color.setter - def color(self, color): - """Set the color of this TemplateSummaryLabelProperties. - - :param color: The color of this TemplateSummaryLabelProperties. - :type: str - """ # noqa: E501 - self._color = color - - @property - def description(self): - """Get the description of this TemplateSummaryLabelProperties. - - :return: The description of this TemplateSummaryLabelProperties. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this TemplateSummaryLabelProperties. - - :param description: The description of this TemplateSummaryLabelProperties. - :type: str - """ # noqa: E501 - self._description = description - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TemplateSummaryLabelProperties): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/template_summary_summary.py b/frogpilot/third_party/influxdb_client/domain/template_summary_summary.py deleted file mode 100644 index 5ca10021..00000000 --- a/frogpilot/third_party/influxdb_client/domain/template_summary_summary.py +++ /dev/null @@ -1,360 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TemplateSummarySummary(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'buckets': 'list[TemplateSummarySummaryBuckets]', - 'checks': 'list[CheckDiscriminator]', - 'dashboards': 'list[TemplateSummarySummaryDashboards]', - 'labels': 'list[TemplateSummaryLabel]', - 'label_mappings': 'list[TemplateSummarySummaryLabelMappings]', - 'missing_env_refs': 'list[str]', - 'missing_secrets': 'list[str]', - 'notification_endpoints': 'list[NotificationEndpointDiscriminator]', - 'notification_rules': 'list[TemplateSummarySummaryNotificationRules]', - 'tasks': 'list[TemplateSummarySummaryTasks]', - 'telegraf_configs': 'list[TelegrafRequest]', - 'variables': 'list[TemplateSummarySummaryVariables]' - } - - attribute_map = { - 'buckets': 'buckets', - 'checks': 'checks', - 'dashboards': 'dashboards', - 'labels': 'labels', - 'label_mappings': 'labelMappings', - 'missing_env_refs': 'missingEnvRefs', - 'missing_secrets': 'missingSecrets', - 'notification_endpoints': 'notificationEndpoints', - 'notification_rules': 'notificationRules', - 'tasks': 'tasks', - 'telegraf_configs': 'telegrafConfigs', - 'variables': 'variables' - } - - def __init__(self, buckets=None, checks=None, dashboards=None, labels=None, label_mappings=None, missing_env_refs=None, missing_secrets=None, notification_endpoints=None, notification_rules=None, tasks=None, telegraf_configs=None, variables=None): # noqa: E501,D401,D403 - """TemplateSummarySummary - a model defined in OpenAPI.""" # noqa: E501 - self._buckets = None - self._checks = None - self._dashboards = None - self._labels = None - self._label_mappings = None - self._missing_env_refs = None - self._missing_secrets = None - self._notification_endpoints = None - self._notification_rules = None - self._tasks = None - self._telegraf_configs = None - self._variables = None - self.discriminator = None - - if buckets is not None: - self.buckets = buckets - if checks is not None: - self.checks = checks - if dashboards is not None: - self.dashboards = dashboards - if labels is not None: - self.labels = labels - if label_mappings is not None: - self.label_mappings = label_mappings - if missing_env_refs is not None: - self.missing_env_refs = missing_env_refs - if missing_secrets is not None: - self.missing_secrets = missing_secrets - if notification_endpoints is not None: - self.notification_endpoints = notification_endpoints - if notification_rules is not None: - self.notification_rules = notification_rules - if tasks is not None: - self.tasks = tasks - if telegraf_configs is not None: - self.telegraf_configs = telegraf_configs - if variables is not None: - self.variables = variables - - @property - def buckets(self): - """Get the buckets of this TemplateSummarySummary. - - :return: The buckets of this TemplateSummarySummary. - :rtype: list[TemplateSummarySummaryBuckets] - """ # noqa: E501 - return self._buckets - - @buckets.setter - def buckets(self, buckets): - """Set the buckets of this TemplateSummarySummary. - - :param buckets: The buckets of this TemplateSummarySummary. - :type: list[TemplateSummarySummaryBuckets] - """ # noqa: E501 - self._buckets = buckets - - @property - def checks(self): - """Get the checks of this TemplateSummarySummary. - - :return: The checks of this TemplateSummarySummary. - :rtype: list[CheckDiscriminator] - """ # noqa: E501 - return self._checks - - @checks.setter - def checks(self, checks): - """Set the checks of this TemplateSummarySummary. - - :param checks: The checks of this TemplateSummarySummary. - :type: list[CheckDiscriminator] - """ # noqa: E501 - self._checks = checks - - @property - def dashboards(self): - """Get the dashboards of this TemplateSummarySummary. - - :return: The dashboards of this TemplateSummarySummary. - :rtype: list[TemplateSummarySummaryDashboards] - """ # noqa: E501 - return self._dashboards - - @dashboards.setter - def dashboards(self, dashboards): - """Set the dashboards of this TemplateSummarySummary. - - :param dashboards: The dashboards of this TemplateSummarySummary. - :type: list[TemplateSummarySummaryDashboards] - """ # noqa: E501 - self._dashboards = dashboards - - @property - def labels(self): - """Get the labels of this TemplateSummarySummary. - - :return: The labels of this TemplateSummarySummary. - :rtype: list[TemplateSummaryLabel] - """ # noqa: E501 - return self._labels - - @labels.setter - def labels(self, labels): - """Set the labels of this TemplateSummarySummary. - - :param labels: The labels of this TemplateSummarySummary. - :type: list[TemplateSummaryLabel] - """ # noqa: E501 - self._labels = labels - - @property - def label_mappings(self): - """Get the label_mappings of this TemplateSummarySummary. - - :return: The label_mappings of this TemplateSummarySummary. - :rtype: list[TemplateSummarySummaryLabelMappings] - """ # noqa: E501 - return self._label_mappings - - @label_mappings.setter - def label_mappings(self, label_mappings): - """Set the label_mappings of this TemplateSummarySummary. - - :param label_mappings: The label_mappings of this TemplateSummarySummary. - :type: list[TemplateSummarySummaryLabelMappings] - """ # noqa: E501 - self._label_mappings = label_mappings - - @property - def missing_env_refs(self): - """Get the missing_env_refs of this TemplateSummarySummary. - - :return: The missing_env_refs of this TemplateSummarySummary. - :rtype: list[str] - """ # noqa: E501 - return self._missing_env_refs - - @missing_env_refs.setter - def missing_env_refs(self, missing_env_refs): - """Set the missing_env_refs of this TemplateSummarySummary. - - :param missing_env_refs: The missing_env_refs of this TemplateSummarySummary. - :type: list[str] - """ # noqa: E501 - self._missing_env_refs = missing_env_refs - - @property - def missing_secrets(self): - """Get the missing_secrets of this TemplateSummarySummary. - - :return: The missing_secrets of this TemplateSummarySummary. - :rtype: list[str] - """ # noqa: E501 - return self._missing_secrets - - @missing_secrets.setter - def missing_secrets(self, missing_secrets): - """Set the missing_secrets of this TemplateSummarySummary. - - :param missing_secrets: The missing_secrets of this TemplateSummarySummary. - :type: list[str] - """ # noqa: E501 - self._missing_secrets = missing_secrets - - @property - def notification_endpoints(self): - """Get the notification_endpoints of this TemplateSummarySummary. - - :return: The notification_endpoints of this TemplateSummarySummary. - :rtype: list[NotificationEndpointDiscriminator] - """ # noqa: E501 - return self._notification_endpoints - - @notification_endpoints.setter - def notification_endpoints(self, notification_endpoints): - """Set the notification_endpoints of this TemplateSummarySummary. - - :param notification_endpoints: The notification_endpoints of this TemplateSummarySummary. - :type: list[NotificationEndpointDiscriminator] - """ # noqa: E501 - self._notification_endpoints = notification_endpoints - - @property - def notification_rules(self): - """Get the notification_rules of this TemplateSummarySummary. - - :return: The notification_rules of this TemplateSummarySummary. - :rtype: list[TemplateSummarySummaryNotificationRules] - """ # noqa: E501 - return self._notification_rules - - @notification_rules.setter - def notification_rules(self, notification_rules): - """Set the notification_rules of this TemplateSummarySummary. - - :param notification_rules: The notification_rules of this TemplateSummarySummary. - :type: list[TemplateSummarySummaryNotificationRules] - """ # noqa: E501 - self._notification_rules = notification_rules - - @property - def tasks(self): - """Get the tasks of this TemplateSummarySummary. - - :return: The tasks of this TemplateSummarySummary. - :rtype: list[TemplateSummarySummaryTasks] - """ # noqa: E501 - return self._tasks - - @tasks.setter - def tasks(self, tasks): - """Set the tasks of this TemplateSummarySummary. - - :param tasks: The tasks of this TemplateSummarySummary. - :type: list[TemplateSummarySummaryTasks] - """ # noqa: E501 - self._tasks = tasks - - @property - def telegraf_configs(self): - """Get the telegraf_configs of this TemplateSummarySummary. - - :return: The telegraf_configs of this TemplateSummarySummary. - :rtype: list[TelegrafRequest] - """ # noqa: E501 - return self._telegraf_configs - - @telegraf_configs.setter - def telegraf_configs(self, telegraf_configs): - """Set the telegraf_configs of this TemplateSummarySummary. - - :param telegraf_configs: The telegraf_configs of this TemplateSummarySummary. - :type: list[TelegrafRequest] - """ # noqa: E501 - self._telegraf_configs = telegraf_configs - - @property - def variables(self): - """Get the variables of this TemplateSummarySummary. - - :return: The variables of this TemplateSummarySummary. - :rtype: list[TemplateSummarySummaryVariables] - """ # noqa: E501 - return self._variables - - @variables.setter - def variables(self, variables): - """Set the variables of this TemplateSummarySummary. - - :param variables: The variables of this TemplateSummarySummary. - :type: list[TemplateSummarySummaryVariables] - """ # noqa: E501 - self._variables = variables - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TemplateSummarySummary): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/template_summary_summary_buckets.py b/frogpilot/third_party/influxdb_client/domain/template_summary_summary_buckets.py deleted file mode 100644 index ba43e8ca..00000000 --- a/frogpilot/third_party/influxdb_client/domain/template_summary_summary_buckets.py +++ /dev/null @@ -1,291 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TemplateSummarySummaryBuckets(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'str', - 'org_id': 'str', - 'kind': 'TemplateKind', - 'template_meta_name': 'str', - 'name': 'str', - 'description': 'str', - 'retention_period': 'int', - 'label_associations': 'list[TemplateSummaryLabel]', - 'env_references': 'list[object]' - } - - attribute_map = { - 'id': 'id', - 'org_id': 'orgID', - 'kind': 'kind', - 'template_meta_name': 'templateMetaName', - 'name': 'name', - 'description': 'description', - 'retention_period': 'retentionPeriod', - 'label_associations': 'labelAssociations', - 'env_references': 'envReferences' - } - - def __init__(self, id=None, org_id=None, kind=None, template_meta_name=None, name=None, description=None, retention_period=None, label_associations=None, env_references=None): # noqa: E501,D401,D403 - """TemplateSummarySummaryBuckets - a model defined in OpenAPI.""" # noqa: E501 - self._id = None - self._org_id = None - self._kind = None - self._template_meta_name = None - self._name = None - self._description = None - self._retention_period = None - self._label_associations = None - self._env_references = None - self.discriminator = None - - if id is not None: - self.id = id - if org_id is not None: - self.org_id = org_id - if kind is not None: - self.kind = kind - if template_meta_name is not None: - self.template_meta_name = template_meta_name - if name is not None: - self.name = name - if description is not None: - self.description = description - if retention_period is not None: - self.retention_period = retention_period - if label_associations is not None: - self.label_associations = label_associations - if env_references is not None: - self.env_references = env_references - - @property - def id(self): - """Get the id of this TemplateSummarySummaryBuckets. - - :return: The id of this TemplateSummarySummaryBuckets. - :rtype: str - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this TemplateSummarySummaryBuckets. - - :param id: The id of this TemplateSummarySummaryBuckets. - :type: str - """ # noqa: E501 - self._id = id - - @property - def org_id(self): - """Get the org_id of this TemplateSummarySummaryBuckets. - - :return: The org_id of this TemplateSummarySummaryBuckets. - :rtype: str - """ # noqa: E501 - return self._org_id - - @org_id.setter - def org_id(self, org_id): - """Set the org_id of this TemplateSummarySummaryBuckets. - - :param org_id: The org_id of this TemplateSummarySummaryBuckets. - :type: str - """ # noqa: E501 - self._org_id = org_id - - @property - def kind(self): - """Get the kind of this TemplateSummarySummaryBuckets. - - :return: The kind of this TemplateSummarySummaryBuckets. - :rtype: TemplateKind - """ # noqa: E501 - return self._kind - - @kind.setter - def kind(self, kind): - """Set the kind of this TemplateSummarySummaryBuckets. - - :param kind: The kind of this TemplateSummarySummaryBuckets. - :type: TemplateKind - """ # noqa: E501 - self._kind = kind - - @property - def template_meta_name(self): - """Get the template_meta_name of this TemplateSummarySummaryBuckets. - - :return: The template_meta_name of this TemplateSummarySummaryBuckets. - :rtype: str - """ # noqa: E501 - return self._template_meta_name - - @template_meta_name.setter - def template_meta_name(self, template_meta_name): - """Set the template_meta_name of this TemplateSummarySummaryBuckets. - - :param template_meta_name: The template_meta_name of this TemplateSummarySummaryBuckets. - :type: str - """ # noqa: E501 - self._template_meta_name = template_meta_name - - @property - def name(self): - """Get the name of this TemplateSummarySummaryBuckets. - - :return: The name of this TemplateSummarySummaryBuckets. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this TemplateSummarySummaryBuckets. - - :param name: The name of this TemplateSummarySummaryBuckets. - :type: str - """ # noqa: E501 - self._name = name - - @property - def description(self): - """Get the description of this TemplateSummarySummaryBuckets. - - :return: The description of this TemplateSummarySummaryBuckets. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this TemplateSummarySummaryBuckets. - - :param description: The description of this TemplateSummarySummaryBuckets. - :type: str - """ # noqa: E501 - self._description = description - - @property - def retention_period(self): - """Get the retention_period of this TemplateSummarySummaryBuckets. - - :return: The retention_period of this TemplateSummarySummaryBuckets. - :rtype: int - """ # noqa: E501 - return self._retention_period - - @retention_period.setter - def retention_period(self, retention_period): - """Set the retention_period of this TemplateSummarySummaryBuckets. - - :param retention_period: The retention_period of this TemplateSummarySummaryBuckets. - :type: int - """ # noqa: E501 - self._retention_period = retention_period - - @property - def label_associations(self): - """Get the label_associations of this TemplateSummarySummaryBuckets. - - :return: The label_associations of this TemplateSummarySummaryBuckets. - :rtype: list[TemplateSummaryLabel] - """ # noqa: E501 - return self._label_associations - - @label_associations.setter - def label_associations(self, label_associations): - """Set the label_associations of this TemplateSummarySummaryBuckets. - - :param label_associations: The label_associations of this TemplateSummarySummaryBuckets. - :type: list[TemplateSummaryLabel] - """ # noqa: E501 - self._label_associations = label_associations - - @property - def env_references(self): - """Get the env_references of this TemplateSummarySummaryBuckets. - - :return: The env_references of this TemplateSummarySummaryBuckets. - :rtype: list[object] - """ # noqa: E501 - return self._env_references - - @env_references.setter - def env_references(self, env_references): - """Set the env_references of this TemplateSummarySummaryBuckets. - - :param env_references: The env_references of this TemplateSummarySummaryBuckets. - :type: list[object] - """ # noqa: E501 - self._env_references = env_references - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TemplateSummarySummaryBuckets): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/template_summary_summary_dashboards.py b/frogpilot/third_party/influxdb_client/domain/template_summary_summary_dashboards.py deleted file mode 100644 index 91a54849..00000000 --- a/frogpilot/third_party/influxdb_client/domain/template_summary_summary_dashboards.py +++ /dev/null @@ -1,291 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TemplateSummarySummaryDashboards(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'str', - 'org_id': 'str', - 'kind': 'TemplateKind', - 'template_meta_name': 'str', - 'name': 'str', - 'description': 'str', - 'label_associations': 'list[TemplateSummaryLabel]', - 'charts': 'list[TemplateChart]', - 'env_references': 'list[object]' - } - - attribute_map = { - 'id': 'id', - 'org_id': 'orgID', - 'kind': 'kind', - 'template_meta_name': 'templateMetaName', - 'name': 'name', - 'description': 'description', - 'label_associations': 'labelAssociations', - 'charts': 'charts', - 'env_references': 'envReferences' - } - - def __init__(self, id=None, org_id=None, kind=None, template_meta_name=None, name=None, description=None, label_associations=None, charts=None, env_references=None): # noqa: E501,D401,D403 - """TemplateSummarySummaryDashboards - a model defined in OpenAPI.""" # noqa: E501 - self._id = None - self._org_id = None - self._kind = None - self._template_meta_name = None - self._name = None - self._description = None - self._label_associations = None - self._charts = None - self._env_references = None - self.discriminator = None - - if id is not None: - self.id = id - if org_id is not None: - self.org_id = org_id - if kind is not None: - self.kind = kind - if template_meta_name is not None: - self.template_meta_name = template_meta_name - if name is not None: - self.name = name - if description is not None: - self.description = description - if label_associations is not None: - self.label_associations = label_associations - if charts is not None: - self.charts = charts - if env_references is not None: - self.env_references = env_references - - @property - def id(self): - """Get the id of this TemplateSummarySummaryDashboards. - - :return: The id of this TemplateSummarySummaryDashboards. - :rtype: str - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this TemplateSummarySummaryDashboards. - - :param id: The id of this TemplateSummarySummaryDashboards. - :type: str - """ # noqa: E501 - self._id = id - - @property - def org_id(self): - """Get the org_id of this TemplateSummarySummaryDashboards. - - :return: The org_id of this TemplateSummarySummaryDashboards. - :rtype: str - """ # noqa: E501 - return self._org_id - - @org_id.setter - def org_id(self, org_id): - """Set the org_id of this TemplateSummarySummaryDashboards. - - :param org_id: The org_id of this TemplateSummarySummaryDashboards. - :type: str - """ # noqa: E501 - self._org_id = org_id - - @property - def kind(self): - """Get the kind of this TemplateSummarySummaryDashboards. - - :return: The kind of this TemplateSummarySummaryDashboards. - :rtype: TemplateKind - """ # noqa: E501 - return self._kind - - @kind.setter - def kind(self, kind): - """Set the kind of this TemplateSummarySummaryDashboards. - - :param kind: The kind of this TemplateSummarySummaryDashboards. - :type: TemplateKind - """ # noqa: E501 - self._kind = kind - - @property - def template_meta_name(self): - """Get the template_meta_name of this TemplateSummarySummaryDashboards. - - :return: The template_meta_name of this TemplateSummarySummaryDashboards. - :rtype: str - """ # noqa: E501 - return self._template_meta_name - - @template_meta_name.setter - def template_meta_name(self, template_meta_name): - """Set the template_meta_name of this TemplateSummarySummaryDashboards. - - :param template_meta_name: The template_meta_name of this TemplateSummarySummaryDashboards. - :type: str - """ # noqa: E501 - self._template_meta_name = template_meta_name - - @property - def name(self): - """Get the name of this TemplateSummarySummaryDashboards. - - :return: The name of this TemplateSummarySummaryDashboards. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this TemplateSummarySummaryDashboards. - - :param name: The name of this TemplateSummarySummaryDashboards. - :type: str - """ # noqa: E501 - self._name = name - - @property - def description(self): - """Get the description of this TemplateSummarySummaryDashboards. - - :return: The description of this TemplateSummarySummaryDashboards. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this TemplateSummarySummaryDashboards. - - :param description: The description of this TemplateSummarySummaryDashboards. - :type: str - """ # noqa: E501 - self._description = description - - @property - def label_associations(self): - """Get the label_associations of this TemplateSummarySummaryDashboards. - - :return: The label_associations of this TemplateSummarySummaryDashboards. - :rtype: list[TemplateSummaryLabel] - """ # noqa: E501 - return self._label_associations - - @label_associations.setter - def label_associations(self, label_associations): - """Set the label_associations of this TemplateSummarySummaryDashboards. - - :param label_associations: The label_associations of this TemplateSummarySummaryDashboards. - :type: list[TemplateSummaryLabel] - """ # noqa: E501 - self._label_associations = label_associations - - @property - def charts(self): - """Get the charts of this TemplateSummarySummaryDashboards. - - :return: The charts of this TemplateSummarySummaryDashboards. - :rtype: list[TemplateChart] - """ # noqa: E501 - return self._charts - - @charts.setter - def charts(self, charts): - """Set the charts of this TemplateSummarySummaryDashboards. - - :param charts: The charts of this TemplateSummarySummaryDashboards. - :type: list[TemplateChart] - """ # noqa: E501 - self._charts = charts - - @property - def env_references(self): - """Get the env_references of this TemplateSummarySummaryDashboards. - - :return: The env_references of this TemplateSummarySummaryDashboards. - :rtype: list[object] - """ # noqa: E501 - return self._env_references - - @env_references.setter - def env_references(self, env_references): - """Set the env_references of this TemplateSummarySummaryDashboards. - - :param env_references: The env_references of this TemplateSummarySummaryDashboards. - :type: list[object] - """ # noqa: E501 - self._env_references = env_references - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TemplateSummarySummaryDashboards): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/template_summary_summary_label_mappings.py b/frogpilot/third_party/influxdb_client/domain/template_summary_summary_label_mappings.py deleted file mode 100644 index 9051866c..00000000 --- a/frogpilot/third_party/influxdb_client/domain/template_summary_summary_label_mappings.py +++ /dev/null @@ -1,268 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TemplateSummarySummaryLabelMappings(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'status': 'str', - 'resource_template_meta_name': 'str', - 'resource_name': 'str', - 'resource_id': 'str', - 'resource_type': 'str', - 'label_template_meta_name': 'str', - 'label_name': 'str', - 'label_id': 'str' - } - - attribute_map = { - 'status': 'status', - 'resource_template_meta_name': 'resourceTemplateMetaName', - 'resource_name': 'resourceName', - 'resource_id': 'resourceID', - 'resource_type': 'resourceType', - 'label_template_meta_name': 'labelTemplateMetaName', - 'label_name': 'labelName', - 'label_id': 'labelID' - } - - def __init__(self, status=None, resource_template_meta_name=None, resource_name=None, resource_id=None, resource_type=None, label_template_meta_name=None, label_name=None, label_id=None): # noqa: E501,D401,D403 - """TemplateSummarySummaryLabelMappings - a model defined in OpenAPI.""" # noqa: E501 - self._status = None - self._resource_template_meta_name = None - self._resource_name = None - self._resource_id = None - self._resource_type = None - self._label_template_meta_name = None - self._label_name = None - self._label_id = None - self.discriminator = None - - if status is not None: - self.status = status - if resource_template_meta_name is not None: - self.resource_template_meta_name = resource_template_meta_name - if resource_name is not None: - self.resource_name = resource_name - if resource_id is not None: - self.resource_id = resource_id - if resource_type is not None: - self.resource_type = resource_type - if label_template_meta_name is not None: - self.label_template_meta_name = label_template_meta_name - if label_name is not None: - self.label_name = label_name - if label_id is not None: - self.label_id = label_id - - @property - def status(self): - """Get the status of this TemplateSummarySummaryLabelMappings. - - :return: The status of this TemplateSummarySummaryLabelMappings. - :rtype: str - """ # noqa: E501 - return self._status - - @status.setter - def status(self, status): - """Set the status of this TemplateSummarySummaryLabelMappings. - - :param status: The status of this TemplateSummarySummaryLabelMappings. - :type: str - """ # noqa: E501 - self._status = status - - @property - def resource_template_meta_name(self): - """Get the resource_template_meta_name of this TemplateSummarySummaryLabelMappings. - - :return: The resource_template_meta_name of this TemplateSummarySummaryLabelMappings. - :rtype: str - """ # noqa: E501 - return self._resource_template_meta_name - - @resource_template_meta_name.setter - def resource_template_meta_name(self, resource_template_meta_name): - """Set the resource_template_meta_name of this TemplateSummarySummaryLabelMappings. - - :param resource_template_meta_name: The resource_template_meta_name of this TemplateSummarySummaryLabelMappings. - :type: str - """ # noqa: E501 - self._resource_template_meta_name = resource_template_meta_name - - @property - def resource_name(self): - """Get the resource_name of this TemplateSummarySummaryLabelMappings. - - :return: The resource_name of this TemplateSummarySummaryLabelMappings. - :rtype: str - """ # noqa: E501 - return self._resource_name - - @resource_name.setter - def resource_name(self, resource_name): - """Set the resource_name of this TemplateSummarySummaryLabelMappings. - - :param resource_name: The resource_name of this TemplateSummarySummaryLabelMappings. - :type: str - """ # noqa: E501 - self._resource_name = resource_name - - @property - def resource_id(self): - """Get the resource_id of this TemplateSummarySummaryLabelMappings. - - :return: The resource_id of this TemplateSummarySummaryLabelMappings. - :rtype: str - """ # noqa: E501 - return self._resource_id - - @resource_id.setter - def resource_id(self, resource_id): - """Set the resource_id of this TemplateSummarySummaryLabelMappings. - - :param resource_id: The resource_id of this TemplateSummarySummaryLabelMappings. - :type: str - """ # noqa: E501 - self._resource_id = resource_id - - @property - def resource_type(self): - """Get the resource_type of this TemplateSummarySummaryLabelMappings. - - :return: The resource_type of this TemplateSummarySummaryLabelMappings. - :rtype: str - """ # noqa: E501 - return self._resource_type - - @resource_type.setter - def resource_type(self, resource_type): - """Set the resource_type of this TemplateSummarySummaryLabelMappings. - - :param resource_type: The resource_type of this TemplateSummarySummaryLabelMappings. - :type: str - """ # noqa: E501 - self._resource_type = resource_type - - @property - def label_template_meta_name(self): - """Get the label_template_meta_name of this TemplateSummarySummaryLabelMappings. - - :return: The label_template_meta_name of this TemplateSummarySummaryLabelMappings. - :rtype: str - """ # noqa: E501 - return self._label_template_meta_name - - @label_template_meta_name.setter - def label_template_meta_name(self, label_template_meta_name): - """Set the label_template_meta_name of this TemplateSummarySummaryLabelMappings. - - :param label_template_meta_name: The label_template_meta_name of this TemplateSummarySummaryLabelMappings. - :type: str - """ # noqa: E501 - self._label_template_meta_name = label_template_meta_name - - @property - def label_name(self): - """Get the label_name of this TemplateSummarySummaryLabelMappings. - - :return: The label_name of this TemplateSummarySummaryLabelMappings. - :rtype: str - """ # noqa: E501 - return self._label_name - - @label_name.setter - def label_name(self, label_name): - """Set the label_name of this TemplateSummarySummaryLabelMappings. - - :param label_name: The label_name of this TemplateSummarySummaryLabelMappings. - :type: str - """ # noqa: E501 - self._label_name = label_name - - @property - def label_id(self): - """Get the label_id of this TemplateSummarySummaryLabelMappings. - - :return: The label_id of this TemplateSummarySummaryLabelMappings. - :rtype: str - """ # noqa: E501 - return self._label_id - - @label_id.setter - def label_id(self, label_id): - """Set the label_id of this TemplateSummarySummaryLabelMappings. - - :param label_id: The label_id of this TemplateSummarySummaryLabelMappings. - :type: str - """ # noqa: E501 - self._label_id = label_id - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TemplateSummarySummaryLabelMappings): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/template_summary_summary_notification_rules.py b/frogpilot/third_party/influxdb_client/domain/template_summary_summary_notification_rules.py deleted file mode 100644 index 63168ed0..00000000 --- a/frogpilot/third_party/influxdb_client/domain/template_summary_summary_notification_rules.py +++ /dev/null @@ -1,429 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TemplateSummarySummaryNotificationRules(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'kind': 'TemplateKind', - 'template_meta_name': 'str', - 'name': 'str', - 'description': 'str', - 'endpoint_template_meta_name': 'str', - 'endpoint_id': 'str', - 'endpoint_type': 'str', - 'every': 'str', - 'offset': 'str', - 'message_template': 'str', - 'status': 'str', - 'status_rules': 'list[TemplateSummarySummaryStatusRules]', - 'tag_rules': 'list[TemplateSummarySummaryTagRules]', - 'label_associations': 'list[TemplateSummaryLabel]', - 'env_references': 'list[object]' - } - - attribute_map = { - 'kind': 'kind', - 'template_meta_name': 'templateMetaName', - 'name': 'name', - 'description': 'description', - 'endpoint_template_meta_name': 'endpointTemplateMetaName', - 'endpoint_id': 'endpointID', - 'endpoint_type': 'endpointType', - 'every': 'every', - 'offset': 'offset', - 'message_template': 'messageTemplate', - 'status': 'status', - 'status_rules': 'statusRules', - 'tag_rules': 'tagRules', - 'label_associations': 'labelAssociations', - 'env_references': 'envReferences' - } - - def __init__(self, kind=None, template_meta_name=None, name=None, description=None, endpoint_template_meta_name=None, endpoint_id=None, endpoint_type=None, every=None, offset=None, message_template=None, status=None, status_rules=None, tag_rules=None, label_associations=None, env_references=None): # noqa: E501,D401,D403 - """TemplateSummarySummaryNotificationRules - a model defined in OpenAPI.""" # noqa: E501 - self._kind = None - self._template_meta_name = None - self._name = None - self._description = None - self._endpoint_template_meta_name = None - self._endpoint_id = None - self._endpoint_type = None - self._every = None - self._offset = None - self._message_template = None - self._status = None - self._status_rules = None - self._tag_rules = None - self._label_associations = None - self._env_references = None - self.discriminator = None - - if kind is not None: - self.kind = kind - if template_meta_name is not None: - self.template_meta_name = template_meta_name - if name is not None: - self.name = name - if description is not None: - self.description = description - if endpoint_template_meta_name is not None: - self.endpoint_template_meta_name = endpoint_template_meta_name - if endpoint_id is not None: - self.endpoint_id = endpoint_id - if endpoint_type is not None: - self.endpoint_type = endpoint_type - if every is not None: - self.every = every - if offset is not None: - self.offset = offset - if message_template is not None: - self.message_template = message_template - if status is not None: - self.status = status - if status_rules is not None: - self.status_rules = status_rules - if tag_rules is not None: - self.tag_rules = tag_rules - if label_associations is not None: - self.label_associations = label_associations - if env_references is not None: - self.env_references = env_references - - @property - def kind(self): - """Get the kind of this TemplateSummarySummaryNotificationRules. - - :return: The kind of this TemplateSummarySummaryNotificationRules. - :rtype: TemplateKind - """ # noqa: E501 - return self._kind - - @kind.setter - def kind(self, kind): - """Set the kind of this TemplateSummarySummaryNotificationRules. - - :param kind: The kind of this TemplateSummarySummaryNotificationRules. - :type: TemplateKind - """ # noqa: E501 - self._kind = kind - - @property - def template_meta_name(self): - """Get the template_meta_name of this TemplateSummarySummaryNotificationRules. - - :return: The template_meta_name of this TemplateSummarySummaryNotificationRules. - :rtype: str - """ # noqa: E501 - return self._template_meta_name - - @template_meta_name.setter - def template_meta_name(self, template_meta_name): - """Set the template_meta_name of this TemplateSummarySummaryNotificationRules. - - :param template_meta_name: The template_meta_name of this TemplateSummarySummaryNotificationRules. - :type: str - """ # noqa: E501 - self._template_meta_name = template_meta_name - - @property - def name(self): - """Get the name of this TemplateSummarySummaryNotificationRules. - - :return: The name of this TemplateSummarySummaryNotificationRules. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this TemplateSummarySummaryNotificationRules. - - :param name: The name of this TemplateSummarySummaryNotificationRules. - :type: str - """ # noqa: E501 - self._name = name - - @property - def description(self): - """Get the description of this TemplateSummarySummaryNotificationRules. - - :return: The description of this TemplateSummarySummaryNotificationRules. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this TemplateSummarySummaryNotificationRules. - - :param description: The description of this TemplateSummarySummaryNotificationRules. - :type: str - """ # noqa: E501 - self._description = description - - @property - def endpoint_template_meta_name(self): - """Get the endpoint_template_meta_name of this TemplateSummarySummaryNotificationRules. - - :return: The endpoint_template_meta_name of this TemplateSummarySummaryNotificationRules. - :rtype: str - """ # noqa: E501 - return self._endpoint_template_meta_name - - @endpoint_template_meta_name.setter - def endpoint_template_meta_name(self, endpoint_template_meta_name): - """Set the endpoint_template_meta_name of this TemplateSummarySummaryNotificationRules. - - :param endpoint_template_meta_name: The endpoint_template_meta_name of this TemplateSummarySummaryNotificationRules. - :type: str - """ # noqa: E501 - self._endpoint_template_meta_name = endpoint_template_meta_name - - @property - def endpoint_id(self): - """Get the endpoint_id of this TemplateSummarySummaryNotificationRules. - - :return: The endpoint_id of this TemplateSummarySummaryNotificationRules. - :rtype: str - """ # noqa: E501 - return self._endpoint_id - - @endpoint_id.setter - def endpoint_id(self, endpoint_id): - """Set the endpoint_id of this TemplateSummarySummaryNotificationRules. - - :param endpoint_id: The endpoint_id of this TemplateSummarySummaryNotificationRules. - :type: str - """ # noqa: E501 - self._endpoint_id = endpoint_id - - @property - def endpoint_type(self): - """Get the endpoint_type of this TemplateSummarySummaryNotificationRules. - - :return: The endpoint_type of this TemplateSummarySummaryNotificationRules. - :rtype: str - """ # noqa: E501 - return self._endpoint_type - - @endpoint_type.setter - def endpoint_type(self, endpoint_type): - """Set the endpoint_type of this TemplateSummarySummaryNotificationRules. - - :param endpoint_type: The endpoint_type of this TemplateSummarySummaryNotificationRules. - :type: str - """ # noqa: E501 - self._endpoint_type = endpoint_type - - @property - def every(self): - """Get the every of this TemplateSummarySummaryNotificationRules. - - :return: The every of this TemplateSummarySummaryNotificationRules. - :rtype: str - """ # noqa: E501 - return self._every - - @every.setter - def every(self, every): - """Set the every of this TemplateSummarySummaryNotificationRules. - - :param every: The every of this TemplateSummarySummaryNotificationRules. - :type: str - """ # noqa: E501 - self._every = every - - @property - def offset(self): - """Get the offset of this TemplateSummarySummaryNotificationRules. - - :return: The offset of this TemplateSummarySummaryNotificationRules. - :rtype: str - """ # noqa: E501 - return self._offset - - @offset.setter - def offset(self, offset): - """Set the offset of this TemplateSummarySummaryNotificationRules. - - :param offset: The offset of this TemplateSummarySummaryNotificationRules. - :type: str - """ # noqa: E501 - self._offset = offset - - @property - def message_template(self): - """Get the message_template of this TemplateSummarySummaryNotificationRules. - - :return: The message_template of this TemplateSummarySummaryNotificationRules. - :rtype: str - """ # noqa: E501 - return self._message_template - - @message_template.setter - def message_template(self, message_template): - """Set the message_template of this TemplateSummarySummaryNotificationRules. - - :param message_template: The message_template of this TemplateSummarySummaryNotificationRules. - :type: str - """ # noqa: E501 - self._message_template = message_template - - @property - def status(self): - """Get the status of this TemplateSummarySummaryNotificationRules. - - :return: The status of this TemplateSummarySummaryNotificationRules. - :rtype: str - """ # noqa: E501 - return self._status - - @status.setter - def status(self, status): - """Set the status of this TemplateSummarySummaryNotificationRules. - - :param status: The status of this TemplateSummarySummaryNotificationRules. - :type: str - """ # noqa: E501 - self._status = status - - @property - def status_rules(self): - """Get the status_rules of this TemplateSummarySummaryNotificationRules. - - :return: The status_rules of this TemplateSummarySummaryNotificationRules. - :rtype: list[TemplateSummarySummaryStatusRules] - """ # noqa: E501 - return self._status_rules - - @status_rules.setter - def status_rules(self, status_rules): - """Set the status_rules of this TemplateSummarySummaryNotificationRules. - - :param status_rules: The status_rules of this TemplateSummarySummaryNotificationRules. - :type: list[TemplateSummarySummaryStatusRules] - """ # noqa: E501 - self._status_rules = status_rules - - @property - def tag_rules(self): - """Get the tag_rules of this TemplateSummarySummaryNotificationRules. - - :return: The tag_rules of this TemplateSummarySummaryNotificationRules. - :rtype: list[TemplateSummarySummaryTagRules] - """ # noqa: E501 - return self._tag_rules - - @tag_rules.setter - def tag_rules(self, tag_rules): - """Set the tag_rules of this TemplateSummarySummaryNotificationRules. - - :param tag_rules: The tag_rules of this TemplateSummarySummaryNotificationRules. - :type: list[TemplateSummarySummaryTagRules] - """ # noqa: E501 - self._tag_rules = tag_rules - - @property - def label_associations(self): - """Get the label_associations of this TemplateSummarySummaryNotificationRules. - - :return: The label_associations of this TemplateSummarySummaryNotificationRules. - :rtype: list[TemplateSummaryLabel] - """ # noqa: E501 - return self._label_associations - - @label_associations.setter - def label_associations(self, label_associations): - """Set the label_associations of this TemplateSummarySummaryNotificationRules. - - :param label_associations: The label_associations of this TemplateSummarySummaryNotificationRules. - :type: list[TemplateSummaryLabel] - """ # noqa: E501 - self._label_associations = label_associations - - @property - def env_references(self): - """Get the env_references of this TemplateSummarySummaryNotificationRules. - - :return: The env_references of this TemplateSummarySummaryNotificationRules. - :rtype: list[object] - """ # noqa: E501 - return self._env_references - - @env_references.setter - def env_references(self, env_references): - """Set the env_references of this TemplateSummarySummaryNotificationRules. - - :param env_references: The env_references of this TemplateSummarySummaryNotificationRules. - :type: list[object] - """ # noqa: E501 - self._env_references = env_references - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TemplateSummarySummaryNotificationRules): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/template_summary_summary_status_rules.py b/frogpilot/third_party/influxdb_client/domain/template_summary_summary_status_rules.py deleted file mode 100644 index 90a7c5a9..00000000 --- a/frogpilot/third_party/influxdb_client/domain/template_summary_summary_status_rules.py +++ /dev/null @@ -1,130 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TemplateSummarySummaryStatusRules(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'current_level': 'str', - 'previous_level': 'str' - } - - attribute_map = { - 'current_level': 'currentLevel', - 'previous_level': 'previousLevel' - } - - def __init__(self, current_level=None, previous_level=None): # noqa: E501,D401,D403 - """TemplateSummarySummaryStatusRules - a model defined in OpenAPI.""" # noqa: E501 - self._current_level = None - self._previous_level = None - self.discriminator = None - - if current_level is not None: - self.current_level = current_level - if previous_level is not None: - self.previous_level = previous_level - - @property - def current_level(self): - """Get the current_level of this TemplateSummarySummaryStatusRules. - - :return: The current_level of this TemplateSummarySummaryStatusRules. - :rtype: str - """ # noqa: E501 - return self._current_level - - @current_level.setter - def current_level(self, current_level): - """Set the current_level of this TemplateSummarySummaryStatusRules. - - :param current_level: The current_level of this TemplateSummarySummaryStatusRules. - :type: str - """ # noqa: E501 - self._current_level = current_level - - @property - def previous_level(self): - """Get the previous_level of this TemplateSummarySummaryStatusRules. - - :return: The previous_level of this TemplateSummarySummaryStatusRules. - :rtype: str - """ # noqa: E501 - return self._previous_level - - @previous_level.setter - def previous_level(self, previous_level): - """Set the previous_level of this TemplateSummarySummaryStatusRules. - - :param previous_level: The previous_level of this TemplateSummarySummaryStatusRules. - :type: str - """ # noqa: E501 - self._previous_level = previous_level - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TemplateSummarySummaryStatusRules): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/template_summary_summary_tag_rules.py b/frogpilot/third_party/influxdb_client/domain/template_summary_summary_tag_rules.py deleted file mode 100644 index 3c1a4475..00000000 --- a/frogpilot/third_party/influxdb_client/domain/template_summary_summary_tag_rules.py +++ /dev/null @@ -1,153 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TemplateSummarySummaryTagRules(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'key': 'str', - 'value': 'str', - 'operator': 'str' - } - - attribute_map = { - 'key': 'key', - 'value': 'value', - 'operator': 'operator' - } - - def __init__(self, key=None, value=None, operator=None): # noqa: E501,D401,D403 - """TemplateSummarySummaryTagRules - a model defined in OpenAPI.""" # noqa: E501 - self._key = None - self._value = None - self._operator = None - self.discriminator = None - - if key is not None: - self.key = key - if value is not None: - self.value = value - if operator is not None: - self.operator = operator - - @property - def key(self): - """Get the key of this TemplateSummarySummaryTagRules. - - :return: The key of this TemplateSummarySummaryTagRules. - :rtype: str - """ # noqa: E501 - return self._key - - @key.setter - def key(self, key): - """Set the key of this TemplateSummarySummaryTagRules. - - :param key: The key of this TemplateSummarySummaryTagRules. - :type: str - """ # noqa: E501 - self._key = key - - @property - def value(self): - """Get the value of this TemplateSummarySummaryTagRules. - - :return: The value of this TemplateSummarySummaryTagRules. - :rtype: str - """ # noqa: E501 - return self._value - - @value.setter - def value(self, value): - """Set the value of this TemplateSummarySummaryTagRules. - - :param value: The value of this TemplateSummarySummaryTagRules. - :type: str - """ # noqa: E501 - self._value = value - - @property - def operator(self): - """Get the operator of this TemplateSummarySummaryTagRules. - - :return: The operator of this TemplateSummarySummaryTagRules. - :rtype: str - """ # noqa: E501 - return self._operator - - @operator.setter - def operator(self, operator): - """Set the operator of this TemplateSummarySummaryTagRules. - - :param operator: The operator of this TemplateSummarySummaryTagRules. - :type: str - """ # noqa: E501 - self._operator = operator - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TemplateSummarySummaryTagRules): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/template_summary_summary_tasks.py b/frogpilot/third_party/influxdb_client/domain/template_summary_summary_tasks.py deleted file mode 100644 index 7b8db751..00000000 --- a/frogpilot/third_party/influxdb_client/domain/template_summary_summary_tasks.py +++ /dev/null @@ -1,337 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TemplateSummarySummaryTasks(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'kind': 'TemplateKind', - 'template_meta_name': 'str', - 'id': 'str', - 'name': 'str', - 'cron': 'str', - 'description': 'str', - 'every': 'str', - 'offset': 'str', - 'query': 'str', - 'status': 'str', - 'env_references': 'list[object]' - } - - attribute_map = { - 'kind': 'kind', - 'template_meta_name': 'templateMetaName', - 'id': 'id', - 'name': 'name', - 'cron': 'cron', - 'description': 'description', - 'every': 'every', - 'offset': 'offset', - 'query': 'query', - 'status': 'status', - 'env_references': 'envReferences' - } - - def __init__(self, kind=None, template_meta_name=None, id=None, name=None, cron=None, description=None, every=None, offset=None, query=None, status=None, env_references=None): # noqa: E501,D401,D403 - """TemplateSummarySummaryTasks - a model defined in OpenAPI.""" # noqa: E501 - self._kind = None - self._template_meta_name = None - self._id = None - self._name = None - self._cron = None - self._description = None - self._every = None - self._offset = None - self._query = None - self._status = None - self._env_references = None - self.discriminator = None - - if kind is not None: - self.kind = kind - if template_meta_name is not None: - self.template_meta_name = template_meta_name - if id is not None: - self.id = id - if name is not None: - self.name = name - if cron is not None: - self.cron = cron - if description is not None: - self.description = description - if every is not None: - self.every = every - if offset is not None: - self.offset = offset - if query is not None: - self.query = query - if status is not None: - self.status = status - if env_references is not None: - self.env_references = env_references - - @property - def kind(self): - """Get the kind of this TemplateSummarySummaryTasks. - - :return: The kind of this TemplateSummarySummaryTasks. - :rtype: TemplateKind - """ # noqa: E501 - return self._kind - - @kind.setter - def kind(self, kind): - """Set the kind of this TemplateSummarySummaryTasks. - - :param kind: The kind of this TemplateSummarySummaryTasks. - :type: TemplateKind - """ # noqa: E501 - self._kind = kind - - @property - def template_meta_name(self): - """Get the template_meta_name of this TemplateSummarySummaryTasks. - - :return: The template_meta_name of this TemplateSummarySummaryTasks. - :rtype: str - """ # noqa: E501 - return self._template_meta_name - - @template_meta_name.setter - def template_meta_name(self, template_meta_name): - """Set the template_meta_name of this TemplateSummarySummaryTasks. - - :param template_meta_name: The template_meta_name of this TemplateSummarySummaryTasks. - :type: str - """ # noqa: E501 - self._template_meta_name = template_meta_name - - @property - def id(self): - """Get the id of this TemplateSummarySummaryTasks. - - :return: The id of this TemplateSummarySummaryTasks. - :rtype: str - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this TemplateSummarySummaryTasks. - - :param id: The id of this TemplateSummarySummaryTasks. - :type: str - """ # noqa: E501 - self._id = id - - @property - def name(self): - """Get the name of this TemplateSummarySummaryTasks. - - :return: The name of this TemplateSummarySummaryTasks. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this TemplateSummarySummaryTasks. - - :param name: The name of this TemplateSummarySummaryTasks. - :type: str - """ # noqa: E501 - self._name = name - - @property - def cron(self): - """Get the cron of this TemplateSummarySummaryTasks. - - :return: The cron of this TemplateSummarySummaryTasks. - :rtype: str - """ # noqa: E501 - return self._cron - - @cron.setter - def cron(self, cron): - """Set the cron of this TemplateSummarySummaryTasks. - - :param cron: The cron of this TemplateSummarySummaryTasks. - :type: str - """ # noqa: E501 - self._cron = cron - - @property - def description(self): - """Get the description of this TemplateSummarySummaryTasks. - - :return: The description of this TemplateSummarySummaryTasks. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this TemplateSummarySummaryTasks. - - :param description: The description of this TemplateSummarySummaryTasks. - :type: str - """ # noqa: E501 - self._description = description - - @property - def every(self): - """Get the every of this TemplateSummarySummaryTasks. - - :return: The every of this TemplateSummarySummaryTasks. - :rtype: str - """ # noqa: E501 - return self._every - - @every.setter - def every(self, every): - """Set the every of this TemplateSummarySummaryTasks. - - :param every: The every of this TemplateSummarySummaryTasks. - :type: str - """ # noqa: E501 - self._every = every - - @property - def offset(self): - """Get the offset of this TemplateSummarySummaryTasks. - - :return: The offset of this TemplateSummarySummaryTasks. - :rtype: str - """ # noqa: E501 - return self._offset - - @offset.setter - def offset(self, offset): - """Set the offset of this TemplateSummarySummaryTasks. - - :param offset: The offset of this TemplateSummarySummaryTasks. - :type: str - """ # noqa: E501 - self._offset = offset - - @property - def query(self): - """Get the query of this TemplateSummarySummaryTasks. - - :return: The query of this TemplateSummarySummaryTasks. - :rtype: str - """ # noqa: E501 - return self._query - - @query.setter - def query(self, query): - """Set the query of this TemplateSummarySummaryTasks. - - :param query: The query of this TemplateSummarySummaryTasks. - :type: str - """ # noqa: E501 - self._query = query - - @property - def status(self): - """Get the status of this TemplateSummarySummaryTasks. - - :return: The status of this TemplateSummarySummaryTasks. - :rtype: str - """ # noqa: E501 - return self._status - - @status.setter - def status(self, status): - """Set the status of this TemplateSummarySummaryTasks. - - :param status: The status of this TemplateSummarySummaryTasks. - :type: str - """ # noqa: E501 - self._status = status - - @property - def env_references(self): - """Get the env_references of this TemplateSummarySummaryTasks. - - :return: The env_references of this TemplateSummarySummaryTasks. - :rtype: list[object] - """ # noqa: E501 - return self._env_references - - @env_references.setter - def env_references(self, env_references): - """Set the env_references of this TemplateSummarySummaryTasks. - - :param env_references: The env_references of this TemplateSummarySummaryTasks. - :type: list[object] - """ # noqa: E501 - self._env_references = env_references - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TemplateSummarySummaryTasks): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/template_summary_summary_variables.py b/frogpilot/third_party/influxdb_client/domain/template_summary_summary_variables.py deleted file mode 100644 index 458ea473..00000000 --- a/frogpilot/third_party/influxdb_client/domain/template_summary_summary_variables.py +++ /dev/null @@ -1,291 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class TemplateSummarySummaryVariables(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'kind': 'TemplateKind', - 'template_meta_name': 'str', - 'id': 'str', - 'org_id': 'str', - 'name': 'str', - 'description': 'str', - 'arguments': 'VariableProperties', - 'label_associations': 'list[TemplateSummaryLabel]', - 'env_references': 'list[object]' - } - - attribute_map = { - 'kind': 'kind', - 'template_meta_name': 'templateMetaName', - 'id': 'id', - 'org_id': 'orgID', - 'name': 'name', - 'description': 'description', - 'arguments': 'arguments', - 'label_associations': 'labelAssociations', - 'env_references': 'envReferences' - } - - def __init__(self, kind=None, template_meta_name=None, id=None, org_id=None, name=None, description=None, arguments=None, label_associations=None, env_references=None): # noqa: E501,D401,D403 - """TemplateSummarySummaryVariables - a model defined in OpenAPI.""" # noqa: E501 - self._kind = None - self._template_meta_name = None - self._id = None - self._org_id = None - self._name = None - self._description = None - self._arguments = None - self._label_associations = None - self._env_references = None - self.discriminator = None - - if kind is not None: - self.kind = kind - if template_meta_name is not None: - self.template_meta_name = template_meta_name - if id is not None: - self.id = id - if org_id is not None: - self.org_id = org_id - if name is not None: - self.name = name - if description is not None: - self.description = description - if arguments is not None: - self.arguments = arguments - if label_associations is not None: - self.label_associations = label_associations - if env_references is not None: - self.env_references = env_references - - @property - def kind(self): - """Get the kind of this TemplateSummarySummaryVariables. - - :return: The kind of this TemplateSummarySummaryVariables. - :rtype: TemplateKind - """ # noqa: E501 - return self._kind - - @kind.setter - def kind(self, kind): - """Set the kind of this TemplateSummarySummaryVariables. - - :param kind: The kind of this TemplateSummarySummaryVariables. - :type: TemplateKind - """ # noqa: E501 - self._kind = kind - - @property - def template_meta_name(self): - """Get the template_meta_name of this TemplateSummarySummaryVariables. - - :return: The template_meta_name of this TemplateSummarySummaryVariables. - :rtype: str - """ # noqa: E501 - return self._template_meta_name - - @template_meta_name.setter - def template_meta_name(self, template_meta_name): - """Set the template_meta_name of this TemplateSummarySummaryVariables. - - :param template_meta_name: The template_meta_name of this TemplateSummarySummaryVariables. - :type: str - """ # noqa: E501 - self._template_meta_name = template_meta_name - - @property - def id(self): - """Get the id of this TemplateSummarySummaryVariables. - - :return: The id of this TemplateSummarySummaryVariables. - :rtype: str - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this TemplateSummarySummaryVariables. - - :param id: The id of this TemplateSummarySummaryVariables. - :type: str - """ # noqa: E501 - self._id = id - - @property - def org_id(self): - """Get the org_id of this TemplateSummarySummaryVariables. - - :return: The org_id of this TemplateSummarySummaryVariables. - :rtype: str - """ # noqa: E501 - return self._org_id - - @org_id.setter - def org_id(self, org_id): - """Set the org_id of this TemplateSummarySummaryVariables. - - :param org_id: The org_id of this TemplateSummarySummaryVariables. - :type: str - """ # noqa: E501 - self._org_id = org_id - - @property - def name(self): - """Get the name of this TemplateSummarySummaryVariables. - - :return: The name of this TemplateSummarySummaryVariables. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this TemplateSummarySummaryVariables. - - :param name: The name of this TemplateSummarySummaryVariables. - :type: str - """ # noqa: E501 - self._name = name - - @property - def description(self): - """Get the description of this TemplateSummarySummaryVariables. - - :return: The description of this TemplateSummarySummaryVariables. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this TemplateSummarySummaryVariables. - - :param description: The description of this TemplateSummarySummaryVariables. - :type: str - """ # noqa: E501 - self._description = description - - @property - def arguments(self): - """Get the arguments of this TemplateSummarySummaryVariables. - - :return: The arguments of this TemplateSummarySummaryVariables. - :rtype: VariableProperties - """ # noqa: E501 - return self._arguments - - @arguments.setter - def arguments(self, arguments): - """Set the arguments of this TemplateSummarySummaryVariables. - - :param arguments: The arguments of this TemplateSummarySummaryVariables. - :type: VariableProperties - """ # noqa: E501 - self._arguments = arguments - - @property - def label_associations(self): - """Get the label_associations of this TemplateSummarySummaryVariables. - - :return: The label_associations of this TemplateSummarySummaryVariables. - :rtype: list[TemplateSummaryLabel] - """ # noqa: E501 - return self._label_associations - - @label_associations.setter - def label_associations(self, label_associations): - """Set the label_associations of this TemplateSummarySummaryVariables. - - :param label_associations: The label_associations of this TemplateSummarySummaryVariables. - :type: list[TemplateSummaryLabel] - """ # noqa: E501 - self._label_associations = label_associations - - @property - def env_references(self): - """Get the env_references of this TemplateSummarySummaryVariables. - - :return: The env_references of this TemplateSummarySummaryVariables. - :rtype: list[object] - """ # noqa: E501 - return self._env_references - - @env_references.setter - def env_references(self, env_references): - """Set the env_references of this TemplateSummarySummaryVariables. - - :param env_references: The env_references of this TemplateSummarySummaryVariables. - :type: list[object] - """ # noqa: E501 - self._env_references = env_references - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TemplateSummarySummaryVariables): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/test_statement.py b/frogpilot/third_party/influxdb_client/domain/test_statement.py deleted file mode 100644 index e9575365..00000000 --- a/frogpilot/third_party/influxdb_client/domain/test_statement.py +++ /dev/null @@ -1,138 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.statement import Statement - - -class TestStatement(Statement): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'assignment': 'VariableAssignment' - } - - attribute_map = { - 'type': 'type', - 'assignment': 'assignment' - } - - def __init__(self, type=None, assignment=None): # noqa: E501,D401,D403 - """TestStatement - a model defined in OpenAPI.""" # noqa: E501 - Statement.__init__(self) # noqa: E501 - - self._type = None - self._assignment = None - self.discriminator = None - - if type is not None: - self.type = type - if assignment is not None: - self.assignment = assignment - - @property - def type(self): - """Get the type of this TestStatement. - - Type of AST node - - :return: The type of this TestStatement. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this TestStatement. - - Type of AST node - - :param type: The type of this TestStatement. - :type: str - """ # noqa: E501 - self._type = type - - @property - def assignment(self): - """Get the assignment of this TestStatement. - - :return: The assignment of this TestStatement. - :rtype: VariableAssignment - """ # noqa: E501 - return self._assignment - - @assignment.setter - def assignment(self, assignment): - """Set the assignment of this TestStatement. - - :param assignment: The assignment of this TestStatement. - :type: VariableAssignment - """ # noqa: E501 - self._assignment = assignment - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, TestStatement): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/threshold.py b/frogpilot/third_party/influxdb_client/domain/threshold.py deleted file mode 100644 index 0999dc79..00000000 --- a/frogpilot/third_party/influxdb_client/domain/threshold.py +++ /dev/null @@ -1,120 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class Threshold(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - } - - attribute_map = { - 'type': 'type', - } - - discriminator_value_class_map = { - 'greater': 'GreaterThreshold', - 'lesser': 'LesserThreshold', - 'range': 'RangeThreshold' - } - - def __init__(self, type=None): # noqa: E501,D401,D403 - """Threshold - a model defined in OpenAPI.""" # noqa: E501 - self._type = None - self.discriminator = 'type' - - self.type = type - - @property - def type(self): - """Get the type of this Threshold. - - :return: The type of this Threshold. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this Threshold. - - :param type: The type of this Threshold. - :type: str - """ # noqa: E501 - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - self._type = type - - def get_real_child_model(self, data): - """Return the real base class specified by the discriminator.""" - discriminator_key = self.attribute_map[self.discriminator] - discriminator_value = data[discriminator_key] - return self.discriminator_value_class_map.get(discriminator_value) - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Threshold): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/threshold_base.py b/frogpilot/third_party/influxdb_client/domain/threshold_base.py deleted file mode 100644 index dad715ca..00000000 --- a/frogpilot/third_party/influxdb_client/domain/threshold_base.py +++ /dev/null @@ -1,134 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class ThresholdBase(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'level': 'CheckStatusLevel', - 'all_values': 'bool' - } - - attribute_map = { - 'level': 'level', - 'all_values': 'allValues' - } - - def __init__(self, level=None, all_values=None): # noqa: E501,D401,D403 - """ThresholdBase - a model defined in OpenAPI.""" # noqa: E501 - self._level = None - self._all_values = None - self.discriminator = None - - if level is not None: - self.level = level - if all_values is not None: - self.all_values = all_values - - @property - def level(self): - """Get the level of this ThresholdBase. - - :return: The level of this ThresholdBase. - :rtype: CheckStatusLevel - """ # noqa: E501 - return self._level - - @level.setter - def level(self, level): - """Set the level of this ThresholdBase. - - :param level: The level of this ThresholdBase. - :type: CheckStatusLevel - """ # noqa: E501 - self._level = level - - @property - def all_values(self): - """Get the all_values of this ThresholdBase. - - If true, only alert if all values meet threshold. - - :return: The all_values of this ThresholdBase. - :rtype: bool - """ # noqa: E501 - return self._all_values - - @all_values.setter - def all_values(self, all_values): - """Set the all_values of this ThresholdBase. - - If true, only alert if all values meet threshold. - - :param all_values: The all_values of this ThresholdBase. - :type: bool - """ # noqa: E501 - self._all_values = all_values - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, ThresholdBase): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/threshold_check.py b/frogpilot/third_party/influxdb_client/domain/threshold_check.py deleted file mode 100644 index 30504cb0..00000000 --- a/frogpilot/third_party/influxdb_client/domain/threshold_check.py +++ /dev/null @@ -1,273 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.check_discriminator import CheckDiscriminator - - -class ThresholdCheck(CheckDiscriminator): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'thresholds': 'list[Threshold]', - 'every': 'str', - 'offset': 'str', - 'tags': 'list[object]', - 'status_message_template': 'str', - 'id': 'str', - 'name': 'str', - 'org_id': 'str', - 'task_id': 'str', - 'owner_id': 'str', - 'created_at': 'datetime', - 'updated_at': 'datetime', - 'query': 'DashboardQuery', - 'status': 'TaskStatusType', - 'description': 'str', - 'latest_completed': 'datetime', - 'last_run_status': 'str', - 'last_run_error': 'str', - 'labels': 'list[Label]', - 'links': 'CheckBaseLinks' - } - - attribute_map = { - 'type': 'type', - 'thresholds': 'thresholds', - 'every': 'every', - 'offset': 'offset', - 'tags': 'tags', - 'status_message_template': 'statusMessageTemplate', - 'id': 'id', - 'name': 'name', - 'org_id': 'orgID', - 'task_id': 'taskID', - 'owner_id': 'ownerID', - 'created_at': 'createdAt', - 'updated_at': 'updatedAt', - 'query': 'query', - 'status': 'status', - 'description': 'description', - 'latest_completed': 'latestCompleted', - 'last_run_status': 'lastRunStatus', - 'last_run_error': 'lastRunError', - 'labels': 'labels', - 'links': 'links' - } - - def __init__(self, type="threshold", thresholds=None, every=None, offset=None, tags=None, status_message_template=None, id=None, name=None, org_id=None, task_id=None, owner_id=None, created_at=None, updated_at=None, query=None, status=None, description=None, latest_completed=None, last_run_status=None, last_run_error=None, labels=None, links=None): # noqa: E501,D401,D403 - """ThresholdCheck - a model defined in OpenAPI.""" # noqa: E501 - CheckDiscriminator.__init__(self, id=id, name=name, org_id=org_id, task_id=task_id, owner_id=owner_id, created_at=created_at, updated_at=updated_at, query=query, status=status, description=description, latest_completed=latest_completed, last_run_status=last_run_status, last_run_error=last_run_error, labels=labels, links=links) # noqa: E501 - - self._type = None - self._thresholds = None - self._every = None - self._offset = None - self._tags = None - self._status_message_template = None - self.discriminator = None - - self.type = type - if thresholds is not None: - self.thresholds = thresholds - if every is not None: - self.every = every - if offset is not None: - self.offset = offset - if tags is not None: - self.tags = tags - if status_message_template is not None: - self.status_message_template = status_message_template - - @property - def type(self): - """Get the type of this ThresholdCheck. - - :return: The type of this ThresholdCheck. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this ThresholdCheck. - - :param type: The type of this ThresholdCheck. - :type: str - """ # noqa: E501 - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - self._type = type - - @property - def thresholds(self): - """Get the thresholds of this ThresholdCheck. - - :return: The thresholds of this ThresholdCheck. - :rtype: list[Threshold] - """ # noqa: E501 - return self._thresholds - - @thresholds.setter - def thresholds(self, thresholds): - """Set the thresholds of this ThresholdCheck. - - :param thresholds: The thresholds of this ThresholdCheck. - :type: list[Threshold] - """ # noqa: E501 - self._thresholds = thresholds - - @property - def every(self): - """Get the every of this ThresholdCheck. - - Check repetition interval. - - :return: The every of this ThresholdCheck. - :rtype: str - """ # noqa: E501 - return self._every - - @every.setter - def every(self, every): - """Set the every of this ThresholdCheck. - - Check repetition interval. - - :param every: The every of this ThresholdCheck. - :type: str - """ # noqa: E501 - self._every = every - - @property - def offset(self): - """Get the offset of this ThresholdCheck. - - Duration to delay after the schedule, before executing check. - - :return: The offset of this ThresholdCheck. - :rtype: str - """ # noqa: E501 - return self._offset - - @offset.setter - def offset(self, offset): - """Set the offset of this ThresholdCheck. - - Duration to delay after the schedule, before executing check. - - :param offset: The offset of this ThresholdCheck. - :type: str - """ # noqa: E501 - self._offset = offset - - @property - def tags(self): - """Get the tags of this ThresholdCheck. - - List of tags to write to each status. - - :return: The tags of this ThresholdCheck. - :rtype: list[object] - """ # noqa: E501 - return self._tags - - @tags.setter - def tags(self, tags): - """Set the tags of this ThresholdCheck. - - List of tags to write to each status. - - :param tags: The tags of this ThresholdCheck. - :type: list[object] - """ # noqa: E501 - self._tags = tags - - @property - def status_message_template(self): - """Get the status_message_template of this ThresholdCheck. - - The template used to generate and write a status message. - - :return: The status_message_template of this ThresholdCheck. - :rtype: str - """ # noqa: E501 - return self._status_message_template - - @status_message_template.setter - def status_message_template(self, status_message_template): - """Set the status_message_template of this ThresholdCheck. - - The template used to generate and write a status message. - - :param status_message_template: The status_message_template of this ThresholdCheck. - :type: str - """ # noqa: E501 - self._status_message_template = status_message_template - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, ThresholdCheck): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/unary_expression.py b/frogpilot/third_party/influxdb_client/domain/unary_expression.py deleted file mode 100644 index 0d6fae08..00000000 --- a/frogpilot/third_party/influxdb_client/domain/unary_expression.py +++ /dev/null @@ -1,161 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.expression import Expression - - -class UnaryExpression(Expression): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'operator': 'str', - 'argument': 'Expression' - } - - attribute_map = { - 'type': 'type', - 'operator': 'operator', - 'argument': 'argument' - } - - def __init__(self, type=None, operator=None, argument=None): # noqa: E501,D401,D403 - """UnaryExpression - a model defined in OpenAPI.""" # noqa: E501 - Expression.__init__(self) # noqa: E501 - - self._type = None - self._operator = None - self._argument = None - self.discriminator = None - - if type is not None: - self.type = type - if operator is not None: - self.operator = operator - if argument is not None: - self.argument = argument - - @property - def type(self): - """Get the type of this UnaryExpression. - - Type of AST node - - :return: The type of this UnaryExpression. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this UnaryExpression. - - Type of AST node - - :param type: The type of this UnaryExpression. - :type: str - """ # noqa: E501 - self._type = type - - @property - def operator(self): - """Get the operator of this UnaryExpression. - - :return: The operator of this UnaryExpression. - :rtype: str - """ # noqa: E501 - return self._operator - - @operator.setter - def operator(self, operator): - """Set the operator of this UnaryExpression. - - :param operator: The operator of this UnaryExpression. - :type: str - """ # noqa: E501 - self._operator = operator - - @property - def argument(self): - """Get the argument of this UnaryExpression. - - :return: The argument of this UnaryExpression. - :rtype: Expression - """ # noqa: E501 - return self._argument - - @argument.setter - def argument(self, argument): - """Set the argument of this UnaryExpression. - - :param argument: The argument of this UnaryExpression. - :type: Expression - """ # noqa: E501 - self._argument = argument - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, UnaryExpression): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/unsigned_integer_literal.py b/frogpilot/third_party/influxdb_client/domain/unsigned_integer_literal.py deleted file mode 100644 index b7692a15..00000000 --- a/frogpilot/third_party/influxdb_client/domain/unsigned_integer_literal.py +++ /dev/null @@ -1,138 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.expression import Expression - - -class UnsignedIntegerLiteral(Expression): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'value': 'str' - } - - attribute_map = { - 'type': 'type', - 'value': 'value' - } - - def __init__(self, type=None, value=None): # noqa: E501,D401,D403 - """UnsignedIntegerLiteral - a model defined in OpenAPI.""" # noqa: E501 - Expression.__init__(self) # noqa: E501 - - self._type = None - self._value = None - self.discriminator = None - - if type is not None: - self.type = type - if value is not None: - self.value = value - - @property - def type(self): - """Get the type of this UnsignedIntegerLiteral. - - Type of AST node - - :return: The type of this UnsignedIntegerLiteral. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this UnsignedIntegerLiteral. - - Type of AST node - - :param type: The type of this UnsignedIntegerLiteral. - :type: str - """ # noqa: E501 - self._type = type - - @property - def value(self): - """Get the value of this UnsignedIntegerLiteral. - - :return: The value of this UnsignedIntegerLiteral. - :rtype: str - """ # noqa: E501 - return self._value - - @value.setter - def value(self, value): - """Set the value of this UnsignedIntegerLiteral. - - :param value: The value of this UnsignedIntegerLiteral. - :type: str - """ # noqa: E501 - self._value = value - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, UnsignedIntegerLiteral): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/user.py b/frogpilot/third_party/influxdb_client/domain/user.py deleted file mode 100644 index 6b7a28c6..00000000 --- a/frogpilot/third_party/influxdb_client/domain/user.py +++ /dev/null @@ -1,166 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class User(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'str', - 'name': 'str', - 'status': 'str' - } - - attribute_map = { - 'id': 'id', - 'name': 'name', - 'status': 'status' - } - - def __init__(self, id=None, name=None, status='active'): # noqa: E501,D401,D403 - """User - a model defined in OpenAPI.""" # noqa: E501 - self._id = None - self._name = None - self._status = None - self.discriminator = None - - if id is not None: - self.id = id - self.name = name - if status is not None: - self.status = status - - @property - def id(self): - """Get the id of this User. - - The user ID. - - :return: The id of this User. - :rtype: str - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this User. - - The user ID. - - :param id: The id of this User. - :type: str - """ # noqa: E501 - self._id = id - - @property - def name(self): - """Get the name of this User. - - The user name. - - :return: The name of this User. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this User. - - The user name. - - :param name: The name of this User. - :type: str - """ # noqa: E501 - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - self._name = name - - @property - def status(self): - """Get the status of this User. - - If `inactive`, the user is inactive. Default is `active`. - - :return: The status of this User. - :rtype: str - """ # noqa: E501 - return self._status - - @status.setter - def status(self, status): - """Set the status of this User. - - If `inactive`, the user is inactive. Default is `active`. - - :param status: The status of this User. - :type: str - """ # noqa: E501 - self._status = status - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, User): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/user_response.py b/frogpilot/third_party/influxdb_client/domain/user_response.py deleted file mode 100644 index a4a163f7..00000000 --- a/frogpilot/third_party/influxdb_client/domain/user_response.py +++ /dev/null @@ -1,189 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class UserResponse(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'str', - 'name': 'str', - 'status': 'str', - 'links': 'UserResponseLinks' - } - - attribute_map = { - 'id': 'id', - 'name': 'name', - 'status': 'status', - 'links': 'links' - } - - def __init__(self, id=None, name=None, status='active', links=None): # noqa: E501,D401,D403 - """UserResponse - a model defined in OpenAPI.""" # noqa: E501 - self._id = None - self._name = None - self._status = None - self._links = None - self.discriminator = None - - if id is not None: - self.id = id - self.name = name - if status is not None: - self.status = status - if links is not None: - self.links = links - - @property - def id(self): - """Get the id of this UserResponse. - - The user ID. - - :return: The id of this UserResponse. - :rtype: str - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this UserResponse. - - The user ID. - - :param id: The id of this UserResponse. - :type: str - """ # noqa: E501 - self._id = id - - @property - def name(self): - """Get the name of this UserResponse. - - The user name. - - :return: The name of this UserResponse. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this UserResponse. - - The user name. - - :param name: The name of this UserResponse. - :type: str - """ # noqa: E501 - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - self._name = name - - @property - def status(self): - """Get the status of this UserResponse. - - The status of a user. An inactive user can't read or write resources. - - :return: The status of this UserResponse. - :rtype: str - """ # noqa: E501 - return self._status - - @status.setter - def status(self, status): - """Set the status of this UserResponse. - - The status of a user. An inactive user can't read or write resources. - - :param status: The status of this UserResponse. - :type: str - """ # noqa: E501 - self._status = status - - @property - def links(self): - """Get the links of this UserResponse. - - :return: The links of this UserResponse. - :rtype: UserResponseLinks - """ # noqa: E501 - return self._links - - @links.setter - def links(self, links): - """Set the links of this UserResponse. - - :param links: The links of this UserResponse. - :type: UserResponseLinks - """ # noqa: E501 - self._links = links - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, UserResponse): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/user_response_links.py b/frogpilot/third_party/influxdb_client/domain/user_response_links.py deleted file mode 100644 index bf825cf2..00000000 --- a/frogpilot/third_party/influxdb_client/domain/user_response_links.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class UserResponseLinks(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - '_self': 'str' - } - - attribute_map = { - '_self': 'self' - } - - def __init__(self, _self=None): # noqa: E501,D401,D403 - """UserResponseLinks - a model defined in OpenAPI.""" # noqa: E501 - self.__self = None - self.discriminator = None - - if _self is not None: - self._self = _self - - @property - def _self(self): - """Get the _self of this UserResponseLinks. - - :return: The _self of this UserResponseLinks. - :rtype: str - """ # noqa: E501 - return self.__self - - @_self.setter - def _self(self, _self): - """Set the _self of this UserResponseLinks. - - :param _self: The _self of this UserResponseLinks. - :type: str - """ # noqa: E501 - self.__self = _self - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, UserResponseLinks): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/users.py b/frogpilot/third_party/influxdb_client/domain/users.py deleted file mode 100644 index 067116c9..00000000 --- a/frogpilot/third_party/influxdb_client/domain/users.py +++ /dev/null @@ -1,130 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class Users(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'links': 'ResourceMembersLinks', - 'users': 'list[UserResponse]' - } - - attribute_map = { - 'links': 'links', - 'users': 'users' - } - - def __init__(self, links=None, users=None): # noqa: E501,D401,D403 - """Users - a model defined in OpenAPI.""" # noqa: E501 - self._links = None - self._users = None - self.discriminator = None - - if links is not None: - self.links = links - if users is not None: - self.users = users - - @property - def links(self): - """Get the links of this Users. - - :return: The links of this Users. - :rtype: ResourceMembersLinks - """ # noqa: E501 - return self._links - - @links.setter - def links(self, links): - """Set the links of this Users. - - :param links: The links of this Users. - :type: ResourceMembersLinks - """ # noqa: E501 - self._links = links - - @property - def users(self): - """Get the users of this Users. - - :return: The users of this Users. - :rtype: list[UserResponse] - """ # noqa: E501 - return self._users - - @users.setter - def users(self, users): - """Set the users of this Users. - - :param users: The users of this Users. - :type: list[UserResponse] - """ # noqa: E501 - self._users = users - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Users): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/variable.py b/frogpilot/third_party/influxdb_client/domain/variable.py deleted file mode 100644 index 4c1b2800..00000000 --- a/frogpilot/third_party/influxdb_client/domain/variable.py +++ /dev/null @@ -1,317 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class Variable(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'links': 'VariableLinks', - 'id': 'str', - 'org_id': 'str', - 'name': 'str', - 'description': 'str', - 'selected': 'list[str]', - 'labels': 'list[Label]', - 'arguments': 'VariableProperties', - 'created_at': 'datetime', - 'updated_at': 'datetime' - } - - attribute_map = { - 'links': 'links', - 'id': 'id', - 'org_id': 'orgID', - 'name': 'name', - 'description': 'description', - 'selected': 'selected', - 'labels': 'labels', - 'arguments': 'arguments', - 'created_at': 'createdAt', - 'updated_at': 'updatedAt' - } - - def __init__(self, links=None, id=None, org_id=None, name=None, description=None, selected=None, labels=None, arguments=None, created_at=None, updated_at=None): # noqa: E501,D401,D403 - """Variable - a model defined in OpenAPI.""" # noqa: E501 - self._links = None - self._id = None - self._org_id = None - self._name = None - self._description = None - self._selected = None - self._labels = None - self._arguments = None - self._created_at = None - self._updated_at = None - self.discriminator = None - - if links is not None: - self.links = links - if id is not None: - self.id = id - self.org_id = org_id - self.name = name - if description is not None: - self.description = description - if selected is not None: - self.selected = selected - if labels is not None: - self.labels = labels - self.arguments = arguments - if created_at is not None: - self.created_at = created_at - if updated_at is not None: - self.updated_at = updated_at - - @property - def links(self): - """Get the links of this Variable. - - :return: The links of this Variable. - :rtype: VariableLinks - """ # noqa: E501 - return self._links - - @links.setter - def links(self, links): - """Set the links of this Variable. - - :param links: The links of this Variable. - :type: VariableLinks - """ # noqa: E501 - self._links = links - - @property - def id(self): - """Get the id of this Variable. - - :return: The id of this Variable. - :rtype: str - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this Variable. - - :param id: The id of this Variable. - :type: str - """ # noqa: E501 - self._id = id - - @property - def org_id(self): - """Get the org_id of this Variable. - - :return: The org_id of this Variable. - :rtype: str - """ # noqa: E501 - return self._org_id - - @org_id.setter - def org_id(self, org_id): - """Set the org_id of this Variable. - - :param org_id: The org_id of this Variable. - :type: str - """ # noqa: E501 - if org_id is None: - raise ValueError("Invalid value for `org_id`, must not be `None`") # noqa: E501 - self._org_id = org_id - - @property - def name(self): - """Get the name of this Variable. - - :return: The name of this Variable. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this Variable. - - :param name: The name of this Variable. - :type: str - """ # noqa: E501 - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - self._name = name - - @property - def description(self): - """Get the description of this Variable. - - :return: The description of this Variable. - :rtype: str - """ # noqa: E501 - return self._description - - @description.setter - def description(self, description): - """Set the description of this Variable. - - :param description: The description of this Variable. - :type: str - """ # noqa: E501 - self._description = description - - @property - def selected(self): - """Get the selected of this Variable. - - :return: The selected of this Variable. - :rtype: list[str] - """ # noqa: E501 - return self._selected - - @selected.setter - def selected(self, selected): - """Set the selected of this Variable. - - :param selected: The selected of this Variable. - :type: list[str] - """ # noqa: E501 - self._selected = selected - - @property - def labels(self): - """Get the labels of this Variable. - - :return: The labels of this Variable. - :rtype: list[Label] - """ # noqa: E501 - return self._labels - - @labels.setter - def labels(self, labels): - """Set the labels of this Variable. - - :param labels: The labels of this Variable. - :type: list[Label] - """ # noqa: E501 - self._labels = labels - - @property - def arguments(self): - """Get the arguments of this Variable. - - :return: The arguments of this Variable. - :rtype: VariableProperties - """ # noqa: E501 - return self._arguments - - @arguments.setter - def arguments(self, arguments): - """Set the arguments of this Variable. - - :param arguments: The arguments of this Variable. - :type: VariableProperties - """ # noqa: E501 - if arguments is None: - raise ValueError("Invalid value for `arguments`, must not be `None`") # noqa: E501 - self._arguments = arguments - - @property - def created_at(self): - """Get the created_at of this Variable. - - :return: The created_at of this Variable. - :rtype: datetime - """ # noqa: E501 - return self._created_at - - @created_at.setter - def created_at(self, created_at): - """Set the created_at of this Variable. - - :param created_at: The created_at of this Variable. - :type: datetime - """ # noqa: E501 - self._created_at = created_at - - @property - def updated_at(self): - """Get the updated_at of this Variable. - - :return: The updated_at of this Variable. - :rtype: datetime - """ # noqa: E501 - return self._updated_at - - @updated_at.setter - def updated_at(self, updated_at): - """Set the updated_at of this Variable. - - :param updated_at: The updated_at of this Variable. - :type: datetime - """ # noqa: E501 - self._updated_at = updated_at - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Variable): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/variable_assignment.py b/frogpilot/third_party/influxdb_client/domain/variable_assignment.py deleted file mode 100644 index c13e5493..00000000 --- a/frogpilot/third_party/influxdb_client/domain/variable_assignment.py +++ /dev/null @@ -1,161 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.statement import Statement - - -class VariableAssignment(Statement): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'str', - 'id': 'Identifier', - 'init': 'Expression' - } - - attribute_map = { - 'type': 'type', - 'id': 'id', - 'init': 'init' - } - - def __init__(self, type=None, id=None, init=None): # noqa: E501,D401,D403 - """VariableAssignment - a model defined in OpenAPI.""" # noqa: E501 - Statement.__init__(self) # noqa: E501 - - self._type = None - self._id = None - self._init = None - self.discriminator = None - - if type is not None: - self.type = type - if id is not None: - self.id = id - if init is not None: - self.init = init - - @property - def type(self): - """Get the type of this VariableAssignment. - - Type of AST node - - :return: The type of this VariableAssignment. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this VariableAssignment. - - Type of AST node - - :param type: The type of this VariableAssignment. - :type: str - """ # noqa: E501 - self._type = type - - @property - def id(self): - """Get the id of this VariableAssignment. - - :return: The id of this VariableAssignment. - :rtype: Identifier - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this VariableAssignment. - - :param id: The id of this VariableAssignment. - :type: Identifier - """ # noqa: E501 - self._id = id - - @property - def init(self): - """Get the init of this VariableAssignment. - - :return: The init of this VariableAssignment. - :rtype: Expression - """ # noqa: E501 - return self._init - - @init.setter - def init(self, init): - """Set the init of this VariableAssignment. - - :param init: The init of this VariableAssignment. - :type: Expression - """ # noqa: E501 - self._init = init - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, VariableAssignment): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/variable_links.py b/frogpilot/third_party/influxdb_client/domain/variable_links.py deleted file mode 100644 index 44a8237d..00000000 --- a/frogpilot/third_party/influxdb_client/domain/variable_links.py +++ /dev/null @@ -1,153 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class VariableLinks(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - '_self': 'str', - 'org': 'str', - 'labels': 'str' - } - - attribute_map = { - '_self': 'self', - 'org': 'org', - 'labels': 'labels' - } - - def __init__(self, _self=None, org=None, labels=None): # noqa: E501,D401,D403 - """VariableLinks - a model defined in OpenAPI.""" # noqa: E501 - self.__self = None - self._org = None - self._labels = None - self.discriminator = None - - if _self is not None: - self._self = _self - if org is not None: - self.org = org - if labels is not None: - self.labels = labels - - @property - def _self(self): - """Get the _self of this VariableLinks. - - :return: The _self of this VariableLinks. - :rtype: str - """ # noqa: E501 - return self.__self - - @_self.setter - def _self(self, _self): - """Set the _self of this VariableLinks. - - :param _self: The _self of this VariableLinks. - :type: str - """ # noqa: E501 - self.__self = _self - - @property - def org(self): - """Get the org of this VariableLinks. - - :return: The org of this VariableLinks. - :rtype: str - """ # noqa: E501 - return self._org - - @org.setter - def org(self, org): - """Set the org of this VariableLinks. - - :param org: The org of this VariableLinks. - :type: str - """ # noqa: E501 - self._org = org - - @property - def labels(self): - """Get the labels of this VariableLinks. - - :return: The labels of this VariableLinks. - :rtype: str - """ # noqa: E501 - return self._labels - - @labels.setter - def labels(self, labels): - """Set the labels of this VariableLinks. - - :param labels: The labels of this VariableLinks. - :type: str - """ # noqa: E501 - self._labels = labels - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, VariableLinks): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/variable_properties.py b/frogpilot/third_party/influxdb_client/domain/variable_properties.py deleted file mode 100644 index c9d9d153..00000000 --- a/frogpilot/third_party/influxdb_client/domain/variable_properties.py +++ /dev/null @@ -1,82 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class VariableProperties(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501,D401,D403 - """VariableProperties - a model defined in OpenAPI.""" # noqa: E501 self.discriminator = None - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, VariableProperties): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/variables.py b/frogpilot/third_party/influxdb_client/domain/variables.py deleted file mode 100644 index 50ebbf3c..00000000 --- a/frogpilot/third_party/influxdb_client/domain/variables.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class Variables(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'variables': 'list[Variable]' - } - - attribute_map = { - 'variables': 'variables' - } - - def __init__(self, variables=None): # noqa: E501,D401,D403 - """Variables - a model defined in OpenAPI.""" # noqa: E501 - self._variables = None - self.discriminator = None - - if variables is not None: - self.variables = variables - - @property - def variables(self): - """Get the variables of this Variables. - - :return: The variables of this Variables. - :rtype: list[Variable] - """ # noqa: E501 - return self._variables - - @variables.setter - def variables(self, variables): - """Set the variables of this Variables. - - :param variables: The variables of this Variables. - :type: list[Variable] - """ # noqa: E501 - self._variables = variables - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Variables): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/view.py b/frogpilot/third_party/influxdb_client/domain/view.py deleted file mode 100644 index 56712536..00000000 --- a/frogpilot/third_party/influxdb_client/domain/view.py +++ /dev/null @@ -1,178 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class View(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'links': 'ViewLinks', - 'id': 'str', - 'name': 'str', - 'properties': 'ViewProperties' - } - - attribute_map = { - 'links': 'links', - 'id': 'id', - 'name': 'name', - 'properties': 'properties' - } - - def __init__(self, links=None, id=None, name=None, properties=None): # noqa: E501,D401,D403 - """View - a model defined in OpenAPI.""" # noqa: E501 - self._links = None - self._id = None - self._name = None - self._properties = None - self.discriminator = None - - if links is not None: - self.links = links - if id is not None: - self.id = id - self.name = name - self.properties = properties - - @property - def links(self): - """Get the links of this View. - - :return: The links of this View. - :rtype: ViewLinks - """ # noqa: E501 - return self._links - - @links.setter - def links(self, links): - """Set the links of this View. - - :param links: The links of this View. - :type: ViewLinks - """ # noqa: E501 - self._links = links - - @property - def id(self): - """Get the id of this View. - - :return: The id of this View. - :rtype: str - """ # noqa: E501 - return self._id - - @id.setter - def id(self, id): - """Set the id of this View. - - :param id: The id of this View. - :type: str - """ # noqa: E501 - self._id = id - - @property - def name(self): - """Get the name of this View. - - :return: The name of this View. - :rtype: str - """ # noqa: E501 - return self._name - - @name.setter - def name(self, name): - """Set the name of this View. - - :param name: The name of this View. - :type: str - """ # noqa: E501 - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - self._name = name - - @property - def properties(self): - """Get the properties of this View. - - :return: The properties of this View. - :rtype: ViewProperties - """ # noqa: E501 - return self._properties - - @properties.setter - def properties(self, properties): - """Set the properties of this View. - - :param properties: The properties of this View. - :type: ViewProperties - """ # noqa: E501 - if properties is None: - raise ValueError("Invalid value for `properties`, must not be `None`") # noqa: E501 - self._properties = properties - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, View): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/view_links.py b/frogpilot/third_party/influxdb_client/domain/view_links.py deleted file mode 100644 index 8705bc1f..00000000 --- a/frogpilot/third_party/influxdb_client/domain/view_links.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class ViewLinks(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - '_self': 'str' - } - - attribute_map = { - '_self': 'self' - } - - def __init__(self, _self=None): # noqa: E501,D401,D403 - """ViewLinks - a model defined in OpenAPI.""" # noqa: E501 - self.__self = None - self.discriminator = None - - if _self is not None: - self._self = _self - - @property - def _self(self): - """Get the _self of this ViewLinks. - - :return: The _self of this ViewLinks. - :rtype: str - """ # noqa: E501 - return self.__self - - @_self.setter - def _self(self, _self): - """Set the _self of this ViewLinks. - - :param _self: The _self of this ViewLinks. - :type: str - """ # noqa: E501 - self.__self = _self - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, ViewLinks): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/view_properties.py b/frogpilot/third_party/influxdb_client/domain/view_properties.py deleted file mode 100644 index e08c354a..00000000 --- a/frogpilot/third_party/influxdb_client/domain/view_properties.py +++ /dev/null @@ -1,82 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class ViewProperties(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501,D401,D403 - """ViewProperties - a model defined in OpenAPI.""" # noqa: E501 self.discriminator = None - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, ViewProperties): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/views.py b/frogpilot/third_party/influxdb_client/domain/views.py deleted file mode 100644 index a9bbb649..00000000 --- a/frogpilot/third_party/influxdb_client/domain/views.py +++ /dev/null @@ -1,130 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class Views(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'links': 'ViewLinks', - 'views': 'list[View]' - } - - attribute_map = { - 'links': 'links', - 'views': 'views' - } - - def __init__(self, links=None, views=None): # noqa: E501,D401,D403 - """Views - a model defined in OpenAPI.""" # noqa: E501 - self._links = None - self._views = None - self.discriminator = None - - if links is not None: - self.links = links - if views is not None: - self.views = views - - @property - def links(self): - """Get the links of this Views. - - :return: The links of this Views. - :rtype: ViewLinks - """ # noqa: E501 - return self._links - - @links.setter - def links(self, links): - """Set the links of this Views. - - :param links: The links of this Views. - :type: ViewLinks - """ # noqa: E501 - self._links = links - - @property - def views(self): - """Get the views of this Views. - - :return: The views of this Views. - :rtype: list[View] - """ # noqa: E501 - return self._views - - @views.setter - def views(self, views): - """Set the views of this Views. - - :param views: The views of this Views. - :type: list[View] - """ # noqa: E501 - self._views = views - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, Views): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/write_precision.py b/frogpilot/third_party/influxdb_client/domain/write_precision.py deleted file mode 100644 index 41a0db93..00000000 --- a/frogpilot/third_party/influxdb_client/domain/write_precision.py +++ /dev/null @@ -1,90 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class WritePrecision(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - allowed enum values - """ - MS = "ms" - S = "s" - US = "us" - NS = "ns" - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501,D401,D403 - """WritePrecision - a model defined in OpenAPI.""" # noqa: E501 self.discriminator = None - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, WritePrecision): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/xy_geom.py b/frogpilot/third_party/influxdb_client/domain/xy_geom.py deleted file mode 100644 index 367806b4..00000000 --- a/frogpilot/third_party/influxdb_client/domain/xy_geom.py +++ /dev/null @@ -1,93 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - - -class XYGeom(object): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - allowed enum values - """ - LINE = "line" - STEP = "step" - STACKED = "stacked" - BAR = "bar" - MONOTONEX = "monotoneX" - STEPBEFORE = "stepBefore" - STEPAFTER = "stepAfter" - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501,D401,D403 - """XYGeom - a model defined in OpenAPI.""" # noqa: E501 self.discriminator = None - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, XYGeom): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/domain/xy_view_properties.py b/frogpilot/third_party/influxdb_client/domain/xy_view_properties.py deleted file mode 100644 index 817967c2..00000000 --- a/frogpilot/third_party/influxdb_client/domain/xy_view_properties.py +++ /dev/null @@ -1,776 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -from influxdb_client.domain.view_properties import ViewProperties - - -class XYViewProperties(ViewProperties): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'adaptive_zoom_hide': 'bool', - 'time_format': 'str', - 'type': 'str', - 'queries': 'list[DashboardQuery]', - 'colors': 'list[DashboardColor]', - 'color_mapping': 'dict(str, str)', - 'shape': 'str', - 'note': 'str', - 'show_note_when_empty': 'bool', - 'axes': 'Axes', - 'static_legend': 'StaticLegend', - 'x_column': 'str', - 'generate_x_axis_ticks': 'list[str]', - 'x_total_ticks': 'int', - 'x_tick_start': 'float', - 'x_tick_step': 'float', - 'y_column': 'str', - 'generate_y_axis_ticks': 'list[str]', - 'y_total_ticks': 'int', - 'y_tick_start': 'float', - 'y_tick_step': 'float', - 'shade_below': 'bool', - 'hover_dimension': 'str', - 'position': 'str', - 'geom': 'XYGeom', - 'legend_colorize_rows': 'bool', - 'legend_hide': 'bool', - 'legend_opacity': 'float', - 'legend_orientation_threshold': 'int' - } - - attribute_map = { - 'adaptive_zoom_hide': 'adaptiveZoomHide', - 'time_format': 'timeFormat', - 'type': 'type', - 'queries': 'queries', - 'colors': 'colors', - 'color_mapping': 'colorMapping', - 'shape': 'shape', - 'note': 'note', - 'show_note_when_empty': 'showNoteWhenEmpty', - 'axes': 'axes', - 'static_legend': 'staticLegend', - 'x_column': 'xColumn', - 'generate_x_axis_ticks': 'generateXAxisTicks', - 'x_total_ticks': 'xTotalTicks', - 'x_tick_start': 'xTickStart', - 'x_tick_step': 'xTickStep', - 'y_column': 'yColumn', - 'generate_y_axis_ticks': 'generateYAxisTicks', - 'y_total_ticks': 'yTotalTicks', - 'y_tick_start': 'yTickStart', - 'y_tick_step': 'yTickStep', - 'shade_below': 'shadeBelow', - 'hover_dimension': 'hoverDimension', - 'position': 'position', - 'geom': 'geom', - 'legend_colorize_rows': 'legendColorizeRows', - 'legend_hide': 'legendHide', - 'legend_opacity': 'legendOpacity', - 'legend_orientation_threshold': 'legendOrientationThreshold' - } - - def __init__(self, adaptive_zoom_hide=None, time_format=None, type=None, queries=None, colors=None, color_mapping=None, shape=None, note=None, show_note_when_empty=None, axes=None, static_legend=None, x_column=None, generate_x_axis_ticks=None, x_total_ticks=None, x_tick_start=None, x_tick_step=None, y_column=None, generate_y_axis_ticks=None, y_total_ticks=None, y_tick_start=None, y_tick_step=None, shade_below=None, hover_dimension=None, position=None, geom=None, legend_colorize_rows=None, legend_hide=None, legend_opacity=None, legend_orientation_threshold=None): # noqa: E501,D401,D403 - """XYViewProperties - a model defined in OpenAPI.""" # noqa: E501 - ViewProperties.__init__(self) # noqa: E501 - - self._adaptive_zoom_hide = None - self._time_format = None - self._type = None - self._queries = None - self._colors = None - self._color_mapping = None - self._shape = None - self._note = None - self._show_note_when_empty = None - self._axes = None - self._static_legend = None - self._x_column = None - self._generate_x_axis_ticks = None - self._x_total_ticks = None - self._x_tick_start = None - self._x_tick_step = None - self._y_column = None - self._generate_y_axis_ticks = None - self._y_total_ticks = None - self._y_tick_start = None - self._y_tick_step = None - self._shade_below = None - self._hover_dimension = None - self._position = None - self._geom = None - self._legend_colorize_rows = None - self._legend_hide = None - self._legend_opacity = None - self._legend_orientation_threshold = None - self.discriminator = None - - if adaptive_zoom_hide is not None: - self.adaptive_zoom_hide = adaptive_zoom_hide - if time_format is not None: - self.time_format = time_format - self.type = type - self.queries = queries - self.colors = colors - if color_mapping is not None: - self.color_mapping = color_mapping - self.shape = shape - self.note = note - self.show_note_when_empty = show_note_when_empty - self.axes = axes - if static_legend is not None: - self.static_legend = static_legend - if x_column is not None: - self.x_column = x_column - if generate_x_axis_ticks is not None: - self.generate_x_axis_ticks = generate_x_axis_ticks - if x_total_ticks is not None: - self.x_total_ticks = x_total_ticks - if x_tick_start is not None: - self.x_tick_start = x_tick_start - if x_tick_step is not None: - self.x_tick_step = x_tick_step - if y_column is not None: - self.y_column = y_column - if generate_y_axis_ticks is not None: - self.generate_y_axis_ticks = generate_y_axis_ticks - if y_total_ticks is not None: - self.y_total_ticks = y_total_ticks - if y_tick_start is not None: - self.y_tick_start = y_tick_start - if y_tick_step is not None: - self.y_tick_step = y_tick_step - if shade_below is not None: - self.shade_below = shade_below - if hover_dimension is not None: - self.hover_dimension = hover_dimension - self.position = position - self.geom = geom - if legend_colorize_rows is not None: - self.legend_colorize_rows = legend_colorize_rows - if legend_hide is not None: - self.legend_hide = legend_hide - if legend_opacity is not None: - self.legend_opacity = legend_opacity - if legend_orientation_threshold is not None: - self.legend_orientation_threshold = legend_orientation_threshold - - @property - def adaptive_zoom_hide(self): - """Get the adaptive_zoom_hide of this XYViewProperties. - - :return: The adaptive_zoom_hide of this XYViewProperties. - :rtype: bool - """ # noqa: E501 - return self._adaptive_zoom_hide - - @adaptive_zoom_hide.setter - def adaptive_zoom_hide(self, adaptive_zoom_hide): - """Set the adaptive_zoom_hide of this XYViewProperties. - - :param adaptive_zoom_hide: The adaptive_zoom_hide of this XYViewProperties. - :type: bool - """ # noqa: E501 - self._adaptive_zoom_hide = adaptive_zoom_hide - - @property - def time_format(self): - """Get the time_format of this XYViewProperties. - - :return: The time_format of this XYViewProperties. - :rtype: str - """ # noqa: E501 - return self._time_format - - @time_format.setter - def time_format(self, time_format): - """Set the time_format of this XYViewProperties. - - :param time_format: The time_format of this XYViewProperties. - :type: str - """ # noqa: E501 - self._time_format = time_format - - @property - def type(self): - """Get the type of this XYViewProperties. - - :return: The type of this XYViewProperties. - :rtype: str - """ # noqa: E501 - return self._type - - @type.setter - def type(self, type): - """Set the type of this XYViewProperties. - - :param type: The type of this XYViewProperties. - :type: str - """ # noqa: E501 - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - self._type = type - - @property - def queries(self): - """Get the queries of this XYViewProperties. - - :return: The queries of this XYViewProperties. - :rtype: list[DashboardQuery] - """ # noqa: E501 - return self._queries - - @queries.setter - def queries(self, queries): - """Set the queries of this XYViewProperties. - - :param queries: The queries of this XYViewProperties. - :type: list[DashboardQuery] - """ # noqa: E501 - if queries is None: - raise ValueError("Invalid value for `queries`, must not be `None`") # noqa: E501 - self._queries = queries - - @property - def colors(self): - """Get the colors of this XYViewProperties. - - Colors define color encoding of data into a visualization - - :return: The colors of this XYViewProperties. - :rtype: list[DashboardColor] - """ # noqa: E501 - return self._colors - - @colors.setter - def colors(self, colors): - """Set the colors of this XYViewProperties. - - Colors define color encoding of data into a visualization - - :param colors: The colors of this XYViewProperties. - :type: list[DashboardColor] - """ # noqa: E501 - if colors is None: - raise ValueError("Invalid value for `colors`, must not be `None`") # noqa: E501 - self._colors = colors - - @property - def color_mapping(self): - """Get the color_mapping of this XYViewProperties. - - A color mapping is an object that maps time series data to a UI color scheme to allow the UI to render graphs consistent colors across reloads. - - :return: The color_mapping of this XYViewProperties. - :rtype: dict(str, str) - """ # noqa: E501 - return self._color_mapping - - @color_mapping.setter - def color_mapping(self, color_mapping): - """Set the color_mapping of this XYViewProperties. - - A color mapping is an object that maps time series data to a UI color scheme to allow the UI to render graphs consistent colors across reloads. - - :param color_mapping: The color_mapping of this XYViewProperties. - :type: dict(str, str) - """ # noqa: E501 - self._color_mapping = color_mapping - - @property - def shape(self): - """Get the shape of this XYViewProperties. - - :return: The shape of this XYViewProperties. - :rtype: str - """ # noqa: E501 - return self._shape - - @shape.setter - def shape(self, shape): - """Set the shape of this XYViewProperties. - - :param shape: The shape of this XYViewProperties. - :type: str - """ # noqa: E501 - if shape is None: - raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 - self._shape = shape - - @property - def note(self): - """Get the note of this XYViewProperties. - - :return: The note of this XYViewProperties. - :rtype: str - """ # noqa: E501 - return self._note - - @note.setter - def note(self, note): - """Set the note of this XYViewProperties. - - :param note: The note of this XYViewProperties. - :type: str - """ # noqa: E501 - if note is None: - raise ValueError("Invalid value for `note`, must not be `None`") # noqa: E501 - self._note = note - - @property - def show_note_when_empty(self): - """Get the show_note_when_empty of this XYViewProperties. - - If true, will display note when empty - - :return: The show_note_when_empty of this XYViewProperties. - :rtype: bool - """ # noqa: E501 - return self._show_note_when_empty - - @show_note_when_empty.setter - def show_note_when_empty(self, show_note_when_empty): - """Set the show_note_when_empty of this XYViewProperties. - - If true, will display note when empty - - :param show_note_when_empty: The show_note_when_empty of this XYViewProperties. - :type: bool - """ # noqa: E501 - if show_note_when_empty is None: - raise ValueError("Invalid value for `show_note_when_empty`, must not be `None`") # noqa: E501 - self._show_note_when_empty = show_note_when_empty - - @property - def axes(self): - """Get the axes of this XYViewProperties. - - :return: The axes of this XYViewProperties. - :rtype: Axes - """ # noqa: E501 - return self._axes - - @axes.setter - def axes(self, axes): - """Set the axes of this XYViewProperties. - - :param axes: The axes of this XYViewProperties. - :type: Axes - """ # noqa: E501 - if axes is None: - raise ValueError("Invalid value for `axes`, must not be `None`") # noqa: E501 - self._axes = axes - - @property - def static_legend(self): - """Get the static_legend of this XYViewProperties. - - :return: The static_legend of this XYViewProperties. - :rtype: StaticLegend - """ # noqa: E501 - return self._static_legend - - @static_legend.setter - def static_legend(self, static_legend): - """Set the static_legend of this XYViewProperties. - - :param static_legend: The static_legend of this XYViewProperties. - :type: StaticLegend - """ # noqa: E501 - self._static_legend = static_legend - - @property - def x_column(self): - """Get the x_column of this XYViewProperties. - - :return: The x_column of this XYViewProperties. - :rtype: str - """ # noqa: E501 - return self._x_column - - @x_column.setter - def x_column(self, x_column): - """Set the x_column of this XYViewProperties. - - :param x_column: The x_column of this XYViewProperties. - :type: str - """ # noqa: E501 - self._x_column = x_column - - @property - def generate_x_axis_ticks(self): - """Get the generate_x_axis_ticks of this XYViewProperties. - - :return: The generate_x_axis_ticks of this XYViewProperties. - :rtype: list[str] - """ # noqa: E501 - return self._generate_x_axis_ticks - - @generate_x_axis_ticks.setter - def generate_x_axis_ticks(self, generate_x_axis_ticks): - """Set the generate_x_axis_ticks of this XYViewProperties. - - :param generate_x_axis_ticks: The generate_x_axis_ticks of this XYViewProperties. - :type: list[str] - """ # noqa: E501 - self._generate_x_axis_ticks = generate_x_axis_ticks - - @property - def x_total_ticks(self): - """Get the x_total_ticks of this XYViewProperties. - - :return: The x_total_ticks of this XYViewProperties. - :rtype: int - """ # noqa: E501 - return self._x_total_ticks - - @x_total_ticks.setter - def x_total_ticks(self, x_total_ticks): - """Set the x_total_ticks of this XYViewProperties. - - :param x_total_ticks: The x_total_ticks of this XYViewProperties. - :type: int - """ # noqa: E501 - self._x_total_ticks = x_total_ticks - - @property - def x_tick_start(self): - """Get the x_tick_start of this XYViewProperties. - - :return: The x_tick_start of this XYViewProperties. - :rtype: float - """ # noqa: E501 - return self._x_tick_start - - @x_tick_start.setter - def x_tick_start(self, x_tick_start): - """Set the x_tick_start of this XYViewProperties. - - :param x_tick_start: The x_tick_start of this XYViewProperties. - :type: float - """ # noqa: E501 - self._x_tick_start = x_tick_start - - @property - def x_tick_step(self): - """Get the x_tick_step of this XYViewProperties. - - :return: The x_tick_step of this XYViewProperties. - :rtype: float - """ # noqa: E501 - return self._x_tick_step - - @x_tick_step.setter - def x_tick_step(self, x_tick_step): - """Set the x_tick_step of this XYViewProperties. - - :param x_tick_step: The x_tick_step of this XYViewProperties. - :type: float - """ # noqa: E501 - self._x_tick_step = x_tick_step - - @property - def y_column(self): - """Get the y_column of this XYViewProperties. - - :return: The y_column of this XYViewProperties. - :rtype: str - """ # noqa: E501 - return self._y_column - - @y_column.setter - def y_column(self, y_column): - """Set the y_column of this XYViewProperties. - - :param y_column: The y_column of this XYViewProperties. - :type: str - """ # noqa: E501 - self._y_column = y_column - - @property - def generate_y_axis_ticks(self): - """Get the generate_y_axis_ticks of this XYViewProperties. - - :return: The generate_y_axis_ticks of this XYViewProperties. - :rtype: list[str] - """ # noqa: E501 - return self._generate_y_axis_ticks - - @generate_y_axis_ticks.setter - def generate_y_axis_ticks(self, generate_y_axis_ticks): - """Set the generate_y_axis_ticks of this XYViewProperties. - - :param generate_y_axis_ticks: The generate_y_axis_ticks of this XYViewProperties. - :type: list[str] - """ # noqa: E501 - self._generate_y_axis_ticks = generate_y_axis_ticks - - @property - def y_total_ticks(self): - """Get the y_total_ticks of this XYViewProperties. - - :return: The y_total_ticks of this XYViewProperties. - :rtype: int - """ # noqa: E501 - return self._y_total_ticks - - @y_total_ticks.setter - def y_total_ticks(self, y_total_ticks): - """Set the y_total_ticks of this XYViewProperties. - - :param y_total_ticks: The y_total_ticks of this XYViewProperties. - :type: int - """ # noqa: E501 - self._y_total_ticks = y_total_ticks - - @property - def y_tick_start(self): - """Get the y_tick_start of this XYViewProperties. - - :return: The y_tick_start of this XYViewProperties. - :rtype: float - """ # noqa: E501 - return self._y_tick_start - - @y_tick_start.setter - def y_tick_start(self, y_tick_start): - """Set the y_tick_start of this XYViewProperties. - - :param y_tick_start: The y_tick_start of this XYViewProperties. - :type: float - """ # noqa: E501 - self._y_tick_start = y_tick_start - - @property - def y_tick_step(self): - """Get the y_tick_step of this XYViewProperties. - - :return: The y_tick_step of this XYViewProperties. - :rtype: float - """ # noqa: E501 - return self._y_tick_step - - @y_tick_step.setter - def y_tick_step(self, y_tick_step): - """Set the y_tick_step of this XYViewProperties. - - :param y_tick_step: The y_tick_step of this XYViewProperties. - :type: float - """ # noqa: E501 - self._y_tick_step = y_tick_step - - @property - def shade_below(self): - """Get the shade_below of this XYViewProperties. - - :return: The shade_below of this XYViewProperties. - :rtype: bool - """ # noqa: E501 - return self._shade_below - - @shade_below.setter - def shade_below(self, shade_below): - """Set the shade_below of this XYViewProperties. - - :param shade_below: The shade_below of this XYViewProperties. - :type: bool - """ # noqa: E501 - self._shade_below = shade_below - - @property - def hover_dimension(self): - """Get the hover_dimension of this XYViewProperties. - - :return: The hover_dimension of this XYViewProperties. - :rtype: str - """ # noqa: E501 - return self._hover_dimension - - @hover_dimension.setter - def hover_dimension(self, hover_dimension): - """Set the hover_dimension of this XYViewProperties. - - :param hover_dimension: The hover_dimension of this XYViewProperties. - :type: str - """ # noqa: E501 - self._hover_dimension = hover_dimension - - @property - def position(self): - """Get the position of this XYViewProperties. - - :return: The position of this XYViewProperties. - :rtype: str - """ # noqa: E501 - return self._position - - @position.setter - def position(self, position): - """Set the position of this XYViewProperties. - - :param position: The position of this XYViewProperties. - :type: str - """ # noqa: E501 - if position is None: - raise ValueError("Invalid value for `position`, must not be `None`") # noqa: E501 - self._position = position - - @property - def geom(self): - """Get the geom of this XYViewProperties. - - :return: The geom of this XYViewProperties. - :rtype: XYGeom - """ # noqa: E501 - return self._geom - - @geom.setter - def geom(self, geom): - """Set the geom of this XYViewProperties. - - :param geom: The geom of this XYViewProperties. - :type: XYGeom - """ # noqa: E501 - if geom is None: - raise ValueError("Invalid value for `geom`, must not be `None`") # noqa: E501 - self._geom = geom - - @property - def legend_colorize_rows(self): - """Get the legend_colorize_rows of this XYViewProperties. - - :return: The legend_colorize_rows of this XYViewProperties. - :rtype: bool - """ # noqa: E501 - return self._legend_colorize_rows - - @legend_colorize_rows.setter - def legend_colorize_rows(self, legend_colorize_rows): - """Set the legend_colorize_rows of this XYViewProperties. - - :param legend_colorize_rows: The legend_colorize_rows of this XYViewProperties. - :type: bool - """ # noqa: E501 - self._legend_colorize_rows = legend_colorize_rows - - @property - def legend_hide(self): - """Get the legend_hide of this XYViewProperties. - - :return: The legend_hide of this XYViewProperties. - :rtype: bool - """ # noqa: E501 - return self._legend_hide - - @legend_hide.setter - def legend_hide(self, legend_hide): - """Set the legend_hide of this XYViewProperties. - - :param legend_hide: The legend_hide of this XYViewProperties. - :type: bool - """ # noqa: E501 - self._legend_hide = legend_hide - - @property - def legend_opacity(self): - """Get the legend_opacity of this XYViewProperties. - - :return: The legend_opacity of this XYViewProperties. - :rtype: float - """ # noqa: E501 - return self._legend_opacity - - @legend_opacity.setter - def legend_opacity(self, legend_opacity): - """Set the legend_opacity of this XYViewProperties. - - :param legend_opacity: The legend_opacity of this XYViewProperties. - :type: float - """ # noqa: E501 - self._legend_opacity = legend_opacity - - @property - def legend_orientation_threshold(self): - """Get the legend_orientation_threshold of this XYViewProperties. - - :return: The legend_orientation_threshold of this XYViewProperties. - :rtype: int - """ # noqa: E501 - return self._legend_orientation_threshold - - @legend_orientation_threshold.setter - def legend_orientation_threshold(self, legend_orientation_threshold): - """Set the legend_orientation_threshold of this XYViewProperties. - - :param legend_orientation_threshold: The legend_orientation_threshold of this XYViewProperties. - :type: int - """ # noqa: E501 - self._legend_orientation_threshold = legend_orientation_threshold - - def to_dict(self): - """Return the model properties as a dict.""" - result = {} - - for attr, _ in self.openapi_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Return the string representation of the model.""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`.""" - return self.to_str() - - def __eq__(self, other): - """Return true if both objects are equal.""" - if not isinstance(other, XYViewProperties): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Return true if both objects are not equal.""" - return not self == other diff --git a/frogpilot/third_party/influxdb_client/extras.py b/frogpilot/third_party/influxdb_client/extras.py deleted file mode 100644 index 63ceb3b3..00000000 --- a/frogpilot/third_party/influxdb_client/extras.py +++ /dev/null @@ -1,13 +0,0 @@ -"""Extras to selectively import Pandas or NumPy.""" - -try: - import pandas as pd -except ModuleNotFoundError as err: - raise ImportError(f"`query_data_frame` requires Pandas which couldn't be imported due: {err}") - -try: - import numpy as np -except ModuleNotFoundError as err: - raise ImportError(f"`data_frame` requires numpy which couldn't be imported due: {err}") - -__all__ = ['pd', 'np'] diff --git a/frogpilot/third_party/influxdb_client/py.typed b/frogpilot/third_party/influxdb_client/py.typed deleted file mode 100644 index e69de29b..00000000 diff --git a/frogpilot/third_party/influxdb_client/rest.py b/frogpilot/third_party/influxdb_client/rest.py deleted file mode 100644 index cd4dbff4..00000000 --- a/frogpilot/third_party/influxdb_client/rest.py +++ /dev/null @@ -1,91 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - -from __future__ import absolute_import - -import logging -from typing import Dict -from urllib3 import HTTPResponse -from influxdb_client.client.exceptions import InfluxDBError -from influxdb_client.configuration import Configuration - -_UTF_8_encoding = 'utf-8' - - -class ApiException(InfluxDBError): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - Do not edit the class manually. - """ - - def __init__(self, status=None, reason=None, http_resp=None): - """Initialize with HTTP response.""" - super().__init__(response=http_resp) - if http_resp: - self.status = http_resp.status - self.reason = http_resp.reason - self.body = http_resp.data - if isinstance(http_resp, HTTPResponse): # response is HTTPResponse - self.headers = http_resp.headers - else: # response is RESTResponse - self.headers = http_resp.getheaders() - else: - self.status = status - self.reason = reason - self.body = None - self.headers = None - - def __str__(self): - """Get custom error messages for exception.""" - error_message = "({0})\n" \ - "Reason: {1}\n".format(self.status, self.reason) - if self.headers: - error_message += "HTTP response headers: {0}\n".format( - self.headers) - - if self.body: - error_message += "HTTP response body: {0}\n".format(self.body) - - return error_message - - -class _BaseRESTClient(object): - logger = logging.getLogger('influxdb_client.client.http') - - @staticmethod - def log_request(method: str, url: str): - _BaseRESTClient.logger.debug(f">>> Request: '{method} {url}'") - - @staticmethod - def log_response(status: str): - _BaseRESTClient.logger.debug(f"<<< Response: {status}") - - @staticmethod - def log_body(body: object, prefix: str): - _BaseRESTClient.logger.debug(f"{prefix} Body: {body}") - - @staticmethod - def log_headers(headers: Dict[str, str], prefix: str): - for key, v in headers.items(): - value = v - if 'authorization' == key.lower(): - value = '***' - _BaseRESTClient.logger.debug(f"{prefix} {key}: {value}") - - -def _requires_create_user_session(configuration: Configuration, cookie: str, resource_path: str): - _unauthorized = ['/api/v2/signin', '/api/v2/signout'] - return configuration.username and configuration.password and not cookie and resource_path not in _unauthorized - - -def _requires_expire_user_session(configuration: Configuration, cookie: str): - return configuration.username and configuration.password and cookie diff --git a/frogpilot/third_party/influxdb_client/service/__init__.py b/frogpilot/third_party/influxdb_client/service/__init__.py deleted file mode 100644 index 0d21a438..00000000 --- a/frogpilot/third_party/influxdb_client/service/__init__.py +++ /dev/null @@ -1,56 +0,0 @@ -# flake8: noqa - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -# import apis into api package -from influxdb_client.service.authorizations_service import AuthorizationsService -from influxdb_client.service.backup_service import BackupService -from influxdb_client.service.bucket_schemas_service import BucketSchemasService -from influxdb_client.service.buckets_service import BucketsService -from influxdb_client.service.cells_service import CellsService -from influxdb_client.service.checks_service import ChecksService -from influxdb_client.service.config_service import ConfigService -from influxdb_client.service.dbr_ps_service import DBRPsService -from influxdb_client.service.dashboards_service import DashboardsService -from influxdb_client.service.delete_service import DeleteService -from influxdb_client.service.health_service import HealthService -from influxdb_client.service.invokable_scripts_service import InvokableScriptsService -from influxdb_client.service.labels_service import LabelsService -from influxdb_client.service.legacy_authorizations_service import LegacyAuthorizationsService -from influxdb_client.service.metrics_service import MetricsService -from influxdb_client.service.notification_endpoints_service import NotificationEndpointsService -from influxdb_client.service.notification_rules_service import NotificationRulesService -from influxdb_client.service.organizations_service import OrganizationsService -from influxdb_client.service.ping_service import PingService -from influxdb_client.service.query_service import QueryService -from influxdb_client.service.ready_service import ReadyService -from influxdb_client.service.remote_connections_service import RemoteConnectionsService -from influxdb_client.service.replications_service import ReplicationsService -from influxdb_client.service.resources_service import ResourcesService -from influxdb_client.service.restore_service import RestoreService -from influxdb_client.service.routes_service import RoutesService -from influxdb_client.service.rules_service import RulesService -from influxdb_client.service.scraper_targets_service import ScraperTargetsService -from influxdb_client.service.secrets_service import SecretsService -from influxdb_client.service.setup_service import SetupService -from influxdb_client.service.signin_service import SigninService -from influxdb_client.service.signout_service import SignoutService -from influxdb_client.service.sources_service import SourcesService -from influxdb_client.service.tasks_service import TasksService -from influxdb_client.service.telegraf_plugins_service import TelegrafPluginsService -from influxdb_client.service.telegrafs_service import TelegrafsService -from influxdb_client.service.templates_service import TemplatesService -from influxdb_client.service.users_service import UsersService -from influxdb_client.service.variables_service import VariablesService -from influxdb_client.service.views_service import ViewsService -from influxdb_client.service.write_service import WriteService diff --git a/frogpilot/third_party/influxdb_client/service/_base_service.py b/frogpilot/third_party/influxdb_client/service/_base_service.py deleted file mode 100644 index d3e8f995..00000000 --- a/frogpilot/third_party/influxdb_client/service/_base_service.py +++ /dev/null @@ -1,67 +0,0 @@ - - -# noinspection PyMethodMayBeStatic -class _BaseService(object): - - def __init__(self, api_client=None): - """Init common services operation.""" - if api_client is None: - raise ValueError("Invalid value for `api_client`, must be defined.") - self.api_client = api_client - self._build_type = None - - def _check_operation_params(self, operation_id, supported_params, local_params): - supported_params.append('async_req') - supported_params.append('_return_http_data_only') - supported_params.append('_preload_content') - supported_params.append('_request_timeout') - supported_params.append('urlopen_kw') - for key, val in local_params['kwargs'].items(): - if key not in supported_params: - raise TypeError( - f"Got an unexpected keyword argument '{key}'" - f" to method {operation_id}" - ) - local_params[key] = val - del local_params['kwargs'] - - def _is_cloud_instance(self) -> bool: - if not self._build_type: - self._build_type = self.build_type() - return 'cloud' in self._build_type.lower() - - async def _is_cloud_instance_async(self) -> bool: - if not self._build_type: - self._build_type = await self.build_type_async() - return 'cloud' in self._build_type.lower() - - def build_type(self) -> str: - """ - Return the build type of the connected InfluxDB Server. - - :return: The type of InfluxDB build. - """ - from influxdb_client import PingService - ping_service = PingService(self.api_client) - - response = ping_service.get_ping_with_http_info(_return_http_data_only=False) - return self.response_header(response, header_name='X-Influxdb-Build') - - async def build_type_async(self) -> str: - """ - Return the build type of the connected InfluxDB Server. - - :return: The type of InfluxDB build. - """ - from influxdb_client import PingService - ping_service = PingService(self.api_client) - - response = await ping_service.get_ping_async(_return_http_data_only=False) - return self.response_header(response, header_name='X-Influxdb-Build') - - def response_header(self, response, header_name='X-Influxdb-Version') -> str: - if response is not None and len(response) >= 3: - if header_name in response[2]: - return response[2][header_name] - - return "unknown" diff --git a/frogpilot/third_party/influxdb_client/service/authorizations_service.py b/frogpilot/third_party/influxdb_client/service/authorizations_service.py deleted file mode 100644 index 100160e2..00000000 --- a/frogpilot/third_party/influxdb_client/service/authorizations_service.py +++ /dev/null @@ -1,658 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -from influxdb_client.service._base_service import _BaseService - - -class AuthorizationsService(_BaseService): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): # noqa: E501,D401,D403 - """AuthorizationsService - a operation defined in OpenAPI.""" - super().__init__(api_client) - - def delete_authorizations_id(self, auth_id, **kwargs): # noqa: E501,D401,D403 - """Delete an authorization. - - Deletes an authorization. Use the endpoint to delete an API token. If you want to disable an API token instead of delete it, [update the authorization's status to `inactive`](#operation/PatchAuthorizationsID). - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_authorizations_id(auth_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str auth_id: An authorization ID. Specifies the authorization to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_authorizations_id_with_http_info(auth_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_authorizations_id_with_http_info(auth_id, **kwargs) # noqa: E501 - return data - - def delete_authorizations_id_with_http_info(self, auth_id, **kwargs): # noqa: E501,D401,D403 - """Delete an authorization. - - Deletes an authorization. Use the endpoint to delete an API token. If you want to disable an API token instead of delete it, [update the authorization's status to `inactive`](#operation/PatchAuthorizationsID). - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_authorizations_id_with_http_info(auth_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str auth_id: An authorization ID. Specifies the authorization to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_authorizations_id_prepare(auth_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/authorizations/{authID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def delete_authorizations_id_async(self, auth_id, **kwargs): # noqa: E501,D401,D403 - """Delete an authorization. - - Deletes an authorization. Use the endpoint to delete an API token. If you want to disable an API token instead of delete it, [update the authorization's status to `inactive`](#operation/PatchAuthorizationsID). - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str auth_id: An authorization ID. Specifies the authorization to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_authorizations_id_prepare(auth_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/authorizations/{authID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _delete_authorizations_id_prepare(self, auth_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['auth_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('delete_authorizations_id', all_params, local_var_params) - # verify the required parameter 'auth_id' is set - if ('auth_id' not in local_var_params or - local_var_params['auth_id'] is None): - raise ValueError("Missing the required parameter `auth_id` when calling `delete_authorizations_id`") # noqa: E501 - - path_params = {} - if 'auth_id' in local_var_params: - path_params['authID'] = local_var_params['auth_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_authorizations(self, **kwargs): # noqa: E501,D401,D403 - """List authorizations. - - Lists authorizations. To limit which authorizations are returned, pass query parameters in your request. If no query parameters are passed, InfluxDB returns all authorizations. #### InfluxDB Cloud - InfluxDB Cloud doesn't expose [API token](https://docs.influxdata.com/influxdb/latest/reference/glossary/#token) values in `GET /api/v2/authorizations` responses; returns `token: redacted` for all authorizations. #### Required permissions To retrieve an authorization, the request must use an API token that has the following permissions: - `read-authorizations` - `read-user` for the user that the authorization is scoped to #### Related guides - [View tokens](https://docs.influxdata.com/influxdb/latest/security/tokens/view-tokens/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_authorizations(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param str user_id: A user ID. Only returns authorizations scoped to the specified [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user). - :param str user: A user name. Only returns authorizations scoped to the specified [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user). - :param str org_id: An organization ID. Only returns authorizations that belong to the specified [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization). - :param str org: An organization name. Only returns authorizations that belong to the specified [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization). - :param str token: An API [token](https://docs.influxdata.com/influxdb/latest/reference/glossary/#token) value. Specifies an authorization by its `token` property value and returns the authorization. #### InfluxDB OSS - Doesn't support this parameter. InfluxDB OSS ignores the `token=` parameter, applies other parameters, and then returns the result. #### Limitations - The parameter is non-repeatable. If you specify more than one, only the first one is used. If a resource with the specified property value doesn't exist, then the response body contains an empty list. - :return: Authorizations - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_authorizations_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_authorizations_with_http_info(**kwargs) # noqa: E501 - return data - - def get_authorizations_with_http_info(self, **kwargs): # noqa: E501,D401,D403 - """List authorizations. - - Lists authorizations. To limit which authorizations are returned, pass query parameters in your request. If no query parameters are passed, InfluxDB returns all authorizations. #### InfluxDB Cloud - InfluxDB Cloud doesn't expose [API token](https://docs.influxdata.com/influxdb/latest/reference/glossary/#token) values in `GET /api/v2/authorizations` responses; returns `token: redacted` for all authorizations. #### Required permissions To retrieve an authorization, the request must use an API token that has the following permissions: - `read-authorizations` - `read-user` for the user that the authorization is scoped to #### Related guides - [View tokens](https://docs.influxdata.com/influxdb/latest/security/tokens/view-tokens/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_authorizations_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param str user_id: A user ID. Only returns authorizations scoped to the specified [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user). - :param str user: A user name. Only returns authorizations scoped to the specified [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user). - :param str org_id: An organization ID. Only returns authorizations that belong to the specified [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization). - :param str org: An organization name. Only returns authorizations that belong to the specified [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization). - :param str token: An API [token](https://docs.influxdata.com/influxdb/latest/reference/glossary/#token) value. Specifies an authorization by its `token` property value and returns the authorization. #### InfluxDB OSS - Doesn't support this parameter. InfluxDB OSS ignores the `token=` parameter, applies other parameters, and then returns the result. #### Limitations - The parameter is non-repeatable. If you specify more than one, only the first one is used. If a resource with the specified property value doesn't exist, then the response body contains an empty list. - :return: Authorizations - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_authorizations_prepare(**kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/authorizations', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Authorizations', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_authorizations_async(self, **kwargs): # noqa: E501,D401,D403 - """List authorizations. - - Lists authorizations. To limit which authorizations are returned, pass query parameters in your request. If no query parameters are passed, InfluxDB returns all authorizations. #### InfluxDB Cloud - InfluxDB Cloud doesn't expose [API token](https://docs.influxdata.com/influxdb/latest/reference/glossary/#token) values in `GET /api/v2/authorizations` responses; returns `token: redacted` for all authorizations. #### Required permissions To retrieve an authorization, the request must use an API token that has the following permissions: - `read-authorizations` - `read-user` for the user that the authorization is scoped to #### Related guides - [View tokens](https://docs.influxdata.com/influxdb/latest/security/tokens/view-tokens/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param str user_id: A user ID. Only returns authorizations scoped to the specified [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user). - :param str user: A user name. Only returns authorizations scoped to the specified [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user). - :param str org_id: An organization ID. Only returns authorizations that belong to the specified [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization). - :param str org: An organization name. Only returns authorizations that belong to the specified [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization). - :param str token: An API [token](https://docs.influxdata.com/influxdb/latest/reference/glossary/#token) value. Specifies an authorization by its `token` property value and returns the authorization. #### InfluxDB OSS - Doesn't support this parameter. InfluxDB OSS ignores the `token=` parameter, applies other parameters, and then returns the result. #### Limitations - The parameter is non-repeatable. If you specify more than one, only the first one is used. If a resource with the specified property value doesn't exist, then the response body contains an empty list. - :return: Authorizations - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_authorizations_prepare(**kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/authorizations', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Authorizations', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_authorizations_prepare(self, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['zap_trace_span', 'user_id', 'user', 'org_id', 'org', 'token'] # noqa: E501 - self._check_operation_params('get_authorizations', all_params, local_var_params) - - path_params = {} - - query_params = [] - if 'user_id' in local_var_params: - query_params.append(('userID', local_var_params['user_id'])) # noqa: E501 - if 'user' in local_var_params: - query_params.append(('user', local_var_params['user'])) # noqa: E501 - if 'org_id' in local_var_params: - query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501 - if 'org' in local_var_params: - query_params.append(('org', local_var_params['org'])) # noqa: E501 - if 'token' in local_var_params: - query_params.append(('token', local_var_params['token'])) # noqa: E501 - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_authorizations_id(self, auth_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve an authorization. - - Retrieves an authorization. Use this endpoint to retrieve information about an API token, including the token's permissions and the user that the token is scoped to. #### InfluxDB OSS - InfluxDB OSS returns [API token](https://docs.influxdata.com/influxdb/latest/reference/glossary/#token) values in authorizations. - If the request uses an _[operator token](https://docs.influxdata.com/influxdb/latest/security/tokens/#operator-token)_, InfluxDB OSS returns authorizations for all organizations in the instance. #### Related guides - [View tokens](https://docs.influxdata.com/influxdb/latest/security/tokens/view-tokens/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_authorizations_id(auth_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str auth_id: An authorization ID. Specifies the authorization to retrieve. (required) - :param str zap_trace_span: OpenTracing span context - :return: Authorization - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_authorizations_id_with_http_info(auth_id, **kwargs) # noqa: E501 - else: - (data) = self.get_authorizations_id_with_http_info(auth_id, **kwargs) # noqa: E501 - return data - - def get_authorizations_id_with_http_info(self, auth_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve an authorization. - - Retrieves an authorization. Use this endpoint to retrieve information about an API token, including the token's permissions and the user that the token is scoped to. #### InfluxDB OSS - InfluxDB OSS returns [API token](https://docs.influxdata.com/influxdb/latest/reference/glossary/#token) values in authorizations. - If the request uses an _[operator token](https://docs.influxdata.com/influxdb/latest/security/tokens/#operator-token)_, InfluxDB OSS returns authorizations for all organizations in the instance. #### Related guides - [View tokens](https://docs.influxdata.com/influxdb/latest/security/tokens/view-tokens/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_authorizations_id_with_http_info(auth_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str auth_id: An authorization ID. Specifies the authorization to retrieve. (required) - :param str zap_trace_span: OpenTracing span context - :return: Authorization - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_authorizations_id_prepare(auth_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/authorizations/{authID}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Authorization', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_authorizations_id_async(self, auth_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve an authorization. - - Retrieves an authorization. Use this endpoint to retrieve information about an API token, including the token's permissions and the user that the token is scoped to. #### InfluxDB OSS - InfluxDB OSS returns [API token](https://docs.influxdata.com/influxdb/latest/reference/glossary/#token) values in authorizations. - If the request uses an _[operator token](https://docs.influxdata.com/influxdb/latest/security/tokens/#operator-token)_, InfluxDB OSS returns authorizations for all organizations in the instance. #### Related guides - [View tokens](https://docs.influxdata.com/influxdb/latest/security/tokens/view-tokens/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str auth_id: An authorization ID. Specifies the authorization to retrieve. (required) - :param str zap_trace_span: OpenTracing span context - :return: Authorization - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_authorizations_id_prepare(auth_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/authorizations/{authID}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Authorization', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_authorizations_id_prepare(self, auth_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['auth_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_authorizations_id', all_params, local_var_params) - # verify the required parameter 'auth_id' is set - if ('auth_id' not in local_var_params or - local_var_params['auth_id'] is None): - raise ValueError("Missing the required parameter `auth_id` when calling `get_authorizations_id`") # noqa: E501 - - path_params = {} - if 'auth_id' in local_var_params: - path_params['authID'] = local_var_params['auth_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def patch_authorizations_id(self, auth_id, authorization_update_request, **kwargs): # noqa: E501,D401,D403 - """Update an API token to be active or inactive. - - Updates an authorization. Use this endpoint to set an API token's status to be _active_ or _inactive_. InfluxDB rejects requests that use inactive API tokens. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_authorizations_id(auth_id, authorization_update_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str auth_id: An authorization ID. Specifies the authorization to update. (required) - :param AuthorizationUpdateRequest authorization_update_request: In the request body, provide the authorization properties to update. (required) - :param str zap_trace_span: OpenTracing span context - :return: Authorization - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.patch_authorizations_id_with_http_info(auth_id, authorization_update_request, **kwargs) # noqa: E501 - else: - (data) = self.patch_authorizations_id_with_http_info(auth_id, authorization_update_request, **kwargs) # noqa: E501 - return data - - def patch_authorizations_id_with_http_info(self, auth_id, authorization_update_request, **kwargs): # noqa: E501,D401,D403 - """Update an API token to be active or inactive. - - Updates an authorization. Use this endpoint to set an API token's status to be _active_ or _inactive_. InfluxDB rejects requests that use inactive API tokens. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_authorizations_id_with_http_info(auth_id, authorization_update_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str auth_id: An authorization ID. Specifies the authorization to update. (required) - :param AuthorizationUpdateRequest authorization_update_request: In the request body, provide the authorization properties to update. (required) - :param str zap_trace_span: OpenTracing span context - :return: Authorization - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_authorizations_id_prepare(auth_id, authorization_update_request, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/authorizations/{authID}', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Authorization', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def patch_authorizations_id_async(self, auth_id, authorization_update_request, **kwargs): # noqa: E501,D401,D403 - """Update an API token to be active or inactive. - - Updates an authorization. Use this endpoint to set an API token's status to be _active_ or _inactive_. InfluxDB rejects requests that use inactive API tokens. - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str auth_id: An authorization ID. Specifies the authorization to update. (required) - :param AuthorizationUpdateRequest authorization_update_request: In the request body, provide the authorization properties to update. (required) - :param str zap_trace_span: OpenTracing span context - :return: Authorization - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_authorizations_id_prepare(auth_id, authorization_update_request, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/authorizations/{authID}', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Authorization', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _patch_authorizations_id_prepare(self, auth_id, authorization_update_request, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['auth_id', 'authorization_update_request', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('patch_authorizations_id', all_params, local_var_params) - # verify the required parameter 'auth_id' is set - if ('auth_id' not in local_var_params or - local_var_params['auth_id'] is None): - raise ValueError("Missing the required parameter `auth_id` when calling `patch_authorizations_id`") # noqa: E501 - # verify the required parameter 'authorization_update_request' is set - if ('authorization_update_request' not in local_var_params or - local_var_params['authorization_update_request'] is None): - raise ValueError("Missing the required parameter `authorization_update_request` when calling `patch_authorizations_id`") # noqa: E501 - - path_params = {} - if 'auth_id' in local_var_params: - path_params['authID'] = local_var_params['auth_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'authorization_update_request' in local_var_params: - body_params = local_var_params['authorization_update_request'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_authorizations(self, authorization_post_request, **kwargs): # noqa: E501,D401,D403 - """Create an authorization. - - Creates an authorization and returns the authorization with the generated API [token](https://docs.influxdata.com/influxdb/latest/reference/glossary/#token). Use this endpoint to create an authorization, which generates an API token with permissions to `read` or `write` to a specific resource or `type` of resource. The API token is the authorization's `token` property value. To follow best practices for secure API token generation and retrieval, InfluxDB enforces access restrictions on API tokens. - InfluxDB allows access to the API token value immediately after the authorization is created. - You can’t change access (read/write) permissions for an API token after it’s created. - Tokens stop working when the user who created the token is deleted. We recommend the following for managing your tokens: - Create a generic user to create and manage tokens for writing data. - Store your tokens in a secure password vault for future access. #### Required permissions - `write-authorizations` - `write-user` for the user that the authorization is scoped to #### Related guides - [Create a token](https://docs.influxdata.com/influxdb/latest/security/tokens/create-token/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_authorizations(authorization_post_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param AuthorizationPostRequest authorization_post_request: The authorization to create. (required) - :param str zap_trace_span: OpenTracing span context - :return: Authorization - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_authorizations_with_http_info(authorization_post_request, **kwargs) # noqa: E501 - else: - (data) = self.post_authorizations_with_http_info(authorization_post_request, **kwargs) # noqa: E501 - return data - - def post_authorizations_with_http_info(self, authorization_post_request, **kwargs): # noqa: E501,D401,D403 - """Create an authorization. - - Creates an authorization and returns the authorization with the generated API [token](https://docs.influxdata.com/influxdb/latest/reference/glossary/#token). Use this endpoint to create an authorization, which generates an API token with permissions to `read` or `write` to a specific resource or `type` of resource. The API token is the authorization's `token` property value. To follow best practices for secure API token generation and retrieval, InfluxDB enforces access restrictions on API tokens. - InfluxDB allows access to the API token value immediately after the authorization is created. - You can’t change access (read/write) permissions for an API token after it’s created. - Tokens stop working when the user who created the token is deleted. We recommend the following for managing your tokens: - Create a generic user to create and manage tokens for writing data. - Store your tokens in a secure password vault for future access. #### Required permissions - `write-authorizations` - `write-user` for the user that the authorization is scoped to #### Related guides - [Create a token](https://docs.influxdata.com/influxdb/latest/security/tokens/create-token/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_authorizations_with_http_info(authorization_post_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param AuthorizationPostRequest authorization_post_request: The authorization to create. (required) - :param str zap_trace_span: OpenTracing span context - :return: Authorization - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_authorizations_prepare(authorization_post_request, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/authorizations', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Authorization', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_authorizations_async(self, authorization_post_request, **kwargs): # noqa: E501,D401,D403 - """Create an authorization. - - Creates an authorization and returns the authorization with the generated API [token](https://docs.influxdata.com/influxdb/latest/reference/glossary/#token). Use this endpoint to create an authorization, which generates an API token with permissions to `read` or `write` to a specific resource or `type` of resource. The API token is the authorization's `token` property value. To follow best practices for secure API token generation and retrieval, InfluxDB enforces access restrictions on API tokens. - InfluxDB allows access to the API token value immediately after the authorization is created. - You can’t change access (read/write) permissions for an API token after it’s created. - Tokens stop working when the user who created the token is deleted. We recommend the following for managing your tokens: - Create a generic user to create and manage tokens for writing data. - Store your tokens in a secure password vault for future access. #### Required permissions - `write-authorizations` - `write-user` for the user that the authorization is scoped to #### Related guides - [Create a token](https://docs.influxdata.com/influxdb/latest/security/tokens/create-token/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param AuthorizationPostRequest authorization_post_request: The authorization to create. (required) - :param str zap_trace_span: OpenTracing span context - :return: Authorization - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_authorizations_prepare(authorization_post_request, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/authorizations', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Authorization', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_authorizations_prepare(self, authorization_post_request, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['authorization_post_request', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('post_authorizations', all_params, local_var_params) - # verify the required parameter 'authorization_post_request' is set - if ('authorization_post_request' not in local_var_params or - local_var_params['authorization_post_request'] is None): - raise ValueError("Missing the required parameter `authorization_post_request` when calling `post_authorizations`") # noqa: E501 - - path_params = {} - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'authorization_post_request' in local_var_params: - body_params = local_var_params['authorization_post_request'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params diff --git a/frogpilot/third_party/influxdb_client/service/backup_service.py b/frogpilot/third_party/influxdb_client/service/backup_service.py deleted file mode 100644 index 0bc520c9..00000000 --- a/frogpilot/third_party/influxdb_client/service/backup_service.py +++ /dev/null @@ -1,378 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -from influxdb_client.service._base_service import _BaseService - - -class BackupService(_BaseService): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): # noqa: E501,D401,D403 - """BackupService - a operation defined in OpenAPI.""" - super().__init__(api_client) - - def get_backup_kv(self, **kwargs): # noqa: E501,D401,D403 - """Download snapshot of metadata stored in the server's embedded KV store. Don't use with InfluxDB versions greater than InfluxDB 2.1.x.. - - Retrieves a snapshot of metadata stored in the server's embedded KV store. InfluxDB versions greater than 2.1.x don't include metadata stored in embedded SQL; avoid using this endpoint with versions greater than 2.1.x. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_backup_kv(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :return: file - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_backup_kv_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_backup_kv_with_http_info(**kwargs) # noqa: E501 - return data - - def get_backup_kv_with_http_info(self, **kwargs): # noqa: E501,D401,D403 - """Download snapshot of metadata stored in the server's embedded KV store. Don't use with InfluxDB versions greater than InfluxDB 2.1.x.. - - Retrieves a snapshot of metadata stored in the server's embedded KV store. InfluxDB versions greater than 2.1.x don't include metadata stored in embedded SQL; avoid using this endpoint with versions greater than 2.1.x. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_backup_kv_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :return: file - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_backup_kv_prepare(**kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/backup/kv', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='file', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_backup_kv_async(self, **kwargs): # noqa: E501,D401,D403 - """Download snapshot of metadata stored in the server's embedded KV store. Don't use with InfluxDB versions greater than InfluxDB 2.1.x.. - - Retrieves a snapshot of metadata stored in the server's embedded KV store. InfluxDB versions greater than 2.1.x don't include metadata stored in embedded SQL; avoid using this endpoint with versions greater than 2.1.x. - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :return: file - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_backup_kv_prepare(**kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/backup/kv', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='file', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_backup_kv_prepare(self, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['zap_trace_span'] # noqa: E501 - self._check_operation_params('get_backup_kv', all_params, local_var_params) - - path_params = {} - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/octet-stream', 'application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_backup_metadata(self, **kwargs): # noqa: E501,D401,D403 - """Download snapshot of all metadata in the server. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_backup_metadata(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param str accept_encoding: Indicates the content encoding (usually a compression algorithm) that the client can understand. - :return: MetadataBackup - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_backup_metadata_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_backup_metadata_with_http_info(**kwargs) # noqa: E501 - return data - - def get_backup_metadata_with_http_info(self, **kwargs): # noqa: E501,D401,D403 - """Download snapshot of all metadata in the server. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_backup_metadata_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param str accept_encoding: Indicates the content encoding (usually a compression algorithm) that the client can understand. - :return: MetadataBackup - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_backup_metadata_prepare(**kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/backup/metadata', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='MetadataBackup', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_backup_metadata_async(self, **kwargs): # noqa: E501,D401,D403 - """Download snapshot of all metadata in the server. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param str accept_encoding: Indicates the content encoding (usually a compression algorithm) that the client can understand. - :return: MetadataBackup - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_backup_metadata_prepare(**kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/backup/metadata', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='MetadataBackup', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_backup_metadata_prepare(self, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['zap_trace_span', 'accept_encoding'] # noqa: E501 - self._check_operation_params('get_backup_metadata', all_params, local_var_params) - - path_params = {} - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - if 'accept_encoding' in local_var_params: - header_params['Accept-Encoding'] = local_var_params['accept_encoding'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['multipart/mixed', 'application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_backup_shard_id(self, shard_id, **kwargs): # noqa: E501,D401,D403 - """Download snapshot of all TSM data in a shard. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_backup_shard_id(shard_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param int shard_id: The shard ID. (required) - :param str zap_trace_span: OpenTracing span context - :param str accept_encoding: Indicates the content encoding (usually a compression algorithm) that the client can understand. - :param datetime since: The earliest time [RFC3339 date/time format](https://docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339-timestamp) to include in the snapshot. - :return: file - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_backup_shard_id_with_http_info(shard_id, **kwargs) # noqa: E501 - else: - (data) = self.get_backup_shard_id_with_http_info(shard_id, **kwargs) # noqa: E501 - return data - - def get_backup_shard_id_with_http_info(self, shard_id, **kwargs): # noqa: E501,D401,D403 - """Download snapshot of all TSM data in a shard. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_backup_shard_id_with_http_info(shard_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param int shard_id: The shard ID. (required) - :param str zap_trace_span: OpenTracing span context - :param str accept_encoding: Indicates the content encoding (usually a compression algorithm) that the client can understand. - :param datetime since: The earliest time [RFC3339 date/time format](https://docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339-timestamp) to include in the snapshot. - :return: file - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_backup_shard_id_prepare(shard_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/backup/shards/{shardID}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='file', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_backup_shard_id_async(self, shard_id, **kwargs): # noqa: E501,D401,D403 - """Download snapshot of all TSM data in a shard. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param int shard_id: The shard ID. (required) - :param str zap_trace_span: OpenTracing span context - :param str accept_encoding: Indicates the content encoding (usually a compression algorithm) that the client can understand. - :param datetime since: The earliest time [RFC3339 date/time format](https://docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339-timestamp) to include in the snapshot. - :return: file - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_backup_shard_id_prepare(shard_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/backup/shards/{shardID}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='file', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_backup_shard_id_prepare(self, shard_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['shard_id', 'zap_trace_span', 'accept_encoding', 'since'] # noqa: E501 - self._check_operation_params('get_backup_shard_id', all_params, local_var_params) - # verify the required parameter 'shard_id' is set - if ('shard_id' not in local_var_params or - local_var_params['shard_id'] is None): - raise ValueError("Missing the required parameter `shard_id` when calling `get_backup_shard_id`") # noqa: E501 - - path_params = {} - if 'shard_id' in local_var_params: - path_params['shardID'] = local_var_params['shard_id'] # noqa: E501 - - query_params = [] - if 'since' in local_var_params: - query_params.append(('since', local_var_params['since'])) # noqa: E501 - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - if 'accept_encoding' in local_var_params: - header_params['Accept-Encoding'] = local_var_params['accept_encoding'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/octet-stream', 'application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params diff --git a/frogpilot/third_party/influxdb_client/service/bucket_schemas_service.py b/frogpilot/third_party/influxdb_client/service/bucket_schemas_service.py deleted file mode 100644 index 7a25338c..00000000 --- a/frogpilot/third_party/influxdb_client/service/bucket_schemas_service.py +++ /dev/null @@ -1,607 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -from influxdb_client.service._base_service import _BaseService - - -class BucketSchemasService(_BaseService): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): # noqa: E501,D401,D403 - """BucketSchemasService - a operation defined in OpenAPI.""" - super().__init__(api_client) - - def create_measurement_schema(self, bucket_id, measurement_schema_create_request, **kwargs): # noqa: E501,D401,D403 - """Create a measurement schema for a bucket. - - Creates an _explict_ measurement [schema](https://docs.influxdata.com/influxdb/cloud/reference/glossary/#schema) for a bucket. _Explicit_ schemas are used to enforce column names, tags, fields, and data types for your data. By default, buckets have an _implicit_ schema-type (`"schemaType": "implicit"`) that conforms to your data. Use this endpoint to create schemas that prevent non-conforming write requests. #### Limitations - Buckets must be created with the "explict" `schemaType` in order to use schemas. #### Related guides - [Manage bucket schemas](https://docs.influxdata.com/influxdb/cloud/organizations/buckets/bucket-schema/). - [Create a bucket with an explicit schema](https://docs.influxdata.com/influxdb/cloud/organizations/buckets/create-bucket/#create-a-bucket-with-an-explicit-schema) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_measurement_schema(bucket_id, measurement_schema_create_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str bucket_id: A bucket ID. Adds a schema for the specified bucket. (required) - :param MeasurementSchemaCreateRequest measurement_schema_create_request: (required) - :param str org: An organization name. Specifies the organization that owns the schema. - :param str org_id: An organization ID. Specifies the organization that owns the schema. - :return: MeasurementSchema - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_measurement_schema_with_http_info(bucket_id, measurement_schema_create_request, **kwargs) # noqa: E501 - else: - (data) = self.create_measurement_schema_with_http_info(bucket_id, measurement_schema_create_request, **kwargs) # noqa: E501 - return data - - def create_measurement_schema_with_http_info(self, bucket_id, measurement_schema_create_request, **kwargs): # noqa: E501,D401,D403 - """Create a measurement schema for a bucket. - - Creates an _explict_ measurement [schema](https://docs.influxdata.com/influxdb/cloud/reference/glossary/#schema) for a bucket. _Explicit_ schemas are used to enforce column names, tags, fields, and data types for your data. By default, buckets have an _implicit_ schema-type (`"schemaType": "implicit"`) that conforms to your data. Use this endpoint to create schemas that prevent non-conforming write requests. #### Limitations - Buckets must be created with the "explict" `schemaType` in order to use schemas. #### Related guides - [Manage bucket schemas](https://docs.influxdata.com/influxdb/cloud/organizations/buckets/bucket-schema/). - [Create a bucket with an explicit schema](https://docs.influxdata.com/influxdb/cloud/organizations/buckets/create-bucket/#create-a-bucket-with-an-explicit-schema) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_measurement_schema_with_http_info(bucket_id, measurement_schema_create_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str bucket_id: A bucket ID. Adds a schema for the specified bucket. (required) - :param MeasurementSchemaCreateRequest measurement_schema_create_request: (required) - :param str org: An organization name. Specifies the organization that owns the schema. - :param str org_id: An organization ID. Specifies the organization that owns the schema. - :return: MeasurementSchema - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - if not self._is_cloud_instance(): - from influxdb_client.client.warnings import CloudOnlyWarning - CloudOnlyWarning.print_warning('BucketSchemasService', - 'https://docs.influxdata.com/influxdb/cloud/organizations/buckets/bucket-schema/') # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._create_measurement_schema_prepare(bucket_id, measurement_schema_create_request, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/buckets/{bucketID}/schema/measurements', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='MeasurementSchema', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def create_measurement_schema_async(self, bucket_id, measurement_schema_create_request, **kwargs): # noqa: E501,D401,D403 - """Create a measurement schema for a bucket. - - Creates an _explict_ measurement [schema](https://docs.influxdata.com/influxdb/cloud/reference/glossary/#schema) for a bucket. _Explicit_ schemas are used to enforce column names, tags, fields, and data types for your data. By default, buckets have an _implicit_ schema-type (`"schemaType": "implicit"`) that conforms to your data. Use this endpoint to create schemas that prevent non-conforming write requests. #### Limitations - Buckets must be created with the "explict" `schemaType` in order to use schemas. #### Related guides - [Manage bucket schemas](https://docs.influxdata.com/influxdb/cloud/organizations/buckets/bucket-schema/). - [Create a bucket with an explicit schema](https://docs.influxdata.com/influxdb/cloud/organizations/buckets/create-bucket/#create-a-bucket-with-an-explicit-schema) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str bucket_id: A bucket ID. Adds a schema for the specified bucket. (required) - :param MeasurementSchemaCreateRequest measurement_schema_create_request: (required) - :param str org: An organization name. Specifies the organization that owns the schema. - :param str org_id: An organization ID. Specifies the organization that owns the schema. - :return: MeasurementSchema - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - if not await self._is_cloud_instance_async(): - from influxdb_client.client.warnings import CloudOnlyWarning - CloudOnlyWarning.print_warning('BucketSchemasService', - 'https://docs.influxdata.com/influxdb/cloud/organizations/buckets/bucket-schema/') # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._create_measurement_schema_prepare(bucket_id, measurement_schema_create_request, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/buckets/{bucketID}/schema/measurements', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='MeasurementSchema', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _create_measurement_schema_prepare(self, bucket_id, measurement_schema_create_request, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['bucket_id', 'measurement_schema_create_request', 'org', 'org_id'] # noqa: E501 - self._check_operation_params('create_measurement_schema', all_params, local_var_params) - # verify the required parameter 'bucket_id' is set - if ('bucket_id' not in local_var_params or - local_var_params['bucket_id'] is None): - raise ValueError("Missing the required parameter `bucket_id` when calling `create_measurement_schema`") # noqa: E501 - # verify the required parameter 'measurement_schema_create_request' is set - if ('measurement_schema_create_request' not in local_var_params or - local_var_params['measurement_schema_create_request'] is None): - raise ValueError("Missing the required parameter `measurement_schema_create_request` when calling `create_measurement_schema`") # noqa: E501 - - path_params = {} - if 'bucket_id' in local_var_params: - path_params['bucketID'] = local_var_params['bucket_id'] # noqa: E501 - - query_params = [] - if 'org' in local_var_params: - query_params.append(('org', local_var_params['org'])) # noqa: E501 - if 'org_id' in local_var_params: - query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501 - - header_params = {} - - body_params = None - if 'measurement_schema_create_request' in local_var_params: - body_params = local_var_params['measurement_schema_create_request'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_measurement_schema(self, bucket_id, measurement_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a measurement schema. - - Retrieves an explicit measurement [schema](https://docs.influxdata.com/influxdb/cloud/reference/glossary/#schema). - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_measurement_schema(bucket_id, measurement_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str bucket_id: A bucket ID. Retrieves schemas for the specified bucket. (required) - :param str measurement_id: The measurement schema ID. Specifies the measurement schema to retrieve. (required) - :param str org: Organization name. Specifies the organization that owns the schema. - :param str org_id: Organization ID. Specifies the organization that owns the schema. - :return: MeasurementSchema - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_measurement_schema_with_http_info(bucket_id, measurement_id, **kwargs) # noqa: E501 - else: - (data) = self.get_measurement_schema_with_http_info(bucket_id, measurement_id, **kwargs) # noqa: E501 - return data - - def get_measurement_schema_with_http_info(self, bucket_id, measurement_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a measurement schema. - - Retrieves an explicit measurement [schema](https://docs.influxdata.com/influxdb/cloud/reference/glossary/#schema). - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_measurement_schema_with_http_info(bucket_id, measurement_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str bucket_id: A bucket ID. Retrieves schemas for the specified bucket. (required) - :param str measurement_id: The measurement schema ID. Specifies the measurement schema to retrieve. (required) - :param str org: Organization name. Specifies the organization that owns the schema. - :param str org_id: Organization ID. Specifies the organization that owns the schema. - :return: MeasurementSchema - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - if not self._is_cloud_instance(): - from influxdb_client.client.warnings import CloudOnlyWarning - CloudOnlyWarning.print_warning('BucketSchemasService', - 'https://docs.influxdata.com/influxdb/cloud/organizations/buckets/bucket-schema/') # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_measurement_schema_prepare(bucket_id, measurement_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/buckets/{bucketID}/schema/measurements/{measurementID}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='MeasurementSchema', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_measurement_schema_async(self, bucket_id, measurement_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a measurement schema. - - Retrieves an explicit measurement [schema](https://docs.influxdata.com/influxdb/cloud/reference/glossary/#schema). - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str bucket_id: A bucket ID. Retrieves schemas for the specified bucket. (required) - :param str measurement_id: The measurement schema ID. Specifies the measurement schema to retrieve. (required) - :param str org: Organization name. Specifies the organization that owns the schema. - :param str org_id: Organization ID. Specifies the organization that owns the schema. - :return: MeasurementSchema - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - if not await self._is_cloud_instance_async(): - from influxdb_client.client.warnings import CloudOnlyWarning - CloudOnlyWarning.print_warning('BucketSchemasService', - 'https://docs.influxdata.com/influxdb/cloud/organizations/buckets/bucket-schema/') # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_measurement_schema_prepare(bucket_id, measurement_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/buckets/{bucketID}/schema/measurements/{measurementID}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='MeasurementSchema', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_measurement_schema_prepare(self, bucket_id, measurement_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['bucket_id', 'measurement_id', 'org', 'org_id'] # noqa: E501 - self._check_operation_params('get_measurement_schema', all_params, local_var_params) - # verify the required parameter 'bucket_id' is set - if ('bucket_id' not in local_var_params or - local_var_params['bucket_id'] is None): - raise ValueError("Missing the required parameter `bucket_id` when calling `get_measurement_schema`") # noqa: E501 - # verify the required parameter 'measurement_id' is set - if ('measurement_id' not in local_var_params or - local_var_params['measurement_id'] is None): - raise ValueError("Missing the required parameter `measurement_id` when calling `get_measurement_schema`") # noqa: E501 - - path_params = {} - if 'bucket_id' in local_var_params: - path_params['bucketID'] = local_var_params['bucket_id'] # noqa: E501 - if 'measurement_id' in local_var_params: - path_params['measurementID'] = local_var_params['measurement_id'] # noqa: E501 - - query_params = [] - if 'org' in local_var_params: - query_params.append(('org', local_var_params['org'])) # noqa: E501 - if 'org_id' in local_var_params: - query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501 - - header_params = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_measurement_schemas(self, bucket_id, **kwargs): # noqa: E501,D401,D403 - """List measurement schemas of a bucket. - - Lists _explicit_ [schemas](https://docs.influxdata.com/influxdb/cloud/reference/glossary/#schema) (`"schemaType": "explicit"`) for a bucket. _Explicit_ schemas are used to enforce column names, tags, fields, and data types for your data. By default, buckets have an _implicit_ schema-type (`"schemaType": "implicit"`) that conforms to your data. #### Related guides - [Using bucket schemas](https://www.influxdata.com/blog/new-bucket-schema-option-protect-from-unwanted-schema-changes/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_measurement_schemas(bucket_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str bucket_id: A bucket ID. Lists measurement schemas for the specified bucket. (required) - :param str org: An organization name. Specifies the organization that owns the schema. - :param str org_id: An organization ID. Specifies the organization that owns the schema. - :param str name: A measurement name. Only returns measurement schemas with the specified name. - :return: MeasurementSchemaList - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_measurement_schemas_with_http_info(bucket_id, **kwargs) # noqa: E501 - else: - (data) = self.get_measurement_schemas_with_http_info(bucket_id, **kwargs) # noqa: E501 - return data - - def get_measurement_schemas_with_http_info(self, bucket_id, **kwargs): # noqa: E501,D401,D403 - """List measurement schemas of a bucket. - - Lists _explicit_ [schemas](https://docs.influxdata.com/influxdb/cloud/reference/glossary/#schema) (`"schemaType": "explicit"`) for a bucket. _Explicit_ schemas are used to enforce column names, tags, fields, and data types for your data. By default, buckets have an _implicit_ schema-type (`"schemaType": "implicit"`) that conforms to your data. #### Related guides - [Using bucket schemas](https://www.influxdata.com/blog/new-bucket-schema-option-protect-from-unwanted-schema-changes/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_measurement_schemas_with_http_info(bucket_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str bucket_id: A bucket ID. Lists measurement schemas for the specified bucket. (required) - :param str org: An organization name. Specifies the organization that owns the schema. - :param str org_id: An organization ID. Specifies the organization that owns the schema. - :param str name: A measurement name. Only returns measurement schemas with the specified name. - :return: MeasurementSchemaList - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - if not self._is_cloud_instance(): - from influxdb_client.client.warnings import CloudOnlyWarning - CloudOnlyWarning.print_warning('BucketSchemasService', - 'https://docs.influxdata.com/influxdb/cloud/organizations/buckets/bucket-schema/') # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_measurement_schemas_prepare(bucket_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/buckets/{bucketID}/schema/measurements', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='MeasurementSchemaList', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_measurement_schemas_async(self, bucket_id, **kwargs): # noqa: E501,D401,D403 - """List measurement schemas of a bucket. - - Lists _explicit_ [schemas](https://docs.influxdata.com/influxdb/cloud/reference/glossary/#schema) (`"schemaType": "explicit"`) for a bucket. _Explicit_ schemas are used to enforce column names, tags, fields, and data types for your data. By default, buckets have an _implicit_ schema-type (`"schemaType": "implicit"`) that conforms to your data. #### Related guides - [Using bucket schemas](https://www.influxdata.com/blog/new-bucket-schema-option-protect-from-unwanted-schema-changes/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str bucket_id: A bucket ID. Lists measurement schemas for the specified bucket. (required) - :param str org: An organization name. Specifies the organization that owns the schema. - :param str org_id: An organization ID. Specifies the organization that owns the schema. - :param str name: A measurement name. Only returns measurement schemas with the specified name. - :return: MeasurementSchemaList - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - if not await self._is_cloud_instance_async(): - from influxdb_client.client.warnings import CloudOnlyWarning - CloudOnlyWarning.print_warning('BucketSchemasService', - 'https://docs.influxdata.com/influxdb/cloud/organizations/buckets/bucket-schema/') # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_measurement_schemas_prepare(bucket_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/buckets/{bucketID}/schema/measurements', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='MeasurementSchemaList', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_measurement_schemas_prepare(self, bucket_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['bucket_id', 'org', 'org_id', 'name'] # noqa: E501 - self._check_operation_params('get_measurement_schemas', all_params, local_var_params) - # verify the required parameter 'bucket_id' is set - if ('bucket_id' not in local_var_params or - local_var_params['bucket_id'] is None): - raise ValueError("Missing the required parameter `bucket_id` when calling `get_measurement_schemas`") # noqa: E501 - - path_params = {} - if 'bucket_id' in local_var_params: - path_params['bucketID'] = local_var_params['bucket_id'] # noqa: E501 - - query_params = [] - if 'org' in local_var_params: - query_params.append(('org', local_var_params['org'])) # noqa: E501 - if 'org_id' in local_var_params: - query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501 - if 'name' in local_var_params: - query_params.append(('name', local_var_params['name'])) # noqa: E501 - - header_params = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def update_measurement_schema(self, bucket_id, measurement_id, measurement_schema_update_request, **kwargs): # noqa: E501,D401,D403 - """Update a measurement schema. - - Updates a measurement [schema](https://docs.influxdata.com/influxdb/cloud/reference/glossary/#schema). Use this endpoint to update the fields (`name`, `type`, and `dataType`) of a measurement schema. #### Limitations - You can't update the `name` of a measurement. #### Related guides - [Manage bucket schemas](https://docs.influxdata.com/influxdb/cloud/organizations/buckets/bucket-schema/). - [Using bucket schemas](https://www.influxdata.com/blog/new-bucket-schema-option-protect-from-unwanted-schema-changes/). - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_measurement_schema(bucket_id, measurement_id, measurement_schema_update_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str bucket_id: A bucket ID. Specifies the bucket to retrieve schemas for. (required) - :param str measurement_id: A measurement schema ID. Retrieves the specified measurement schema. (required) - :param MeasurementSchemaUpdateRequest measurement_schema_update_request: (required) - :param str org: An organization name. Specifies the organization that owns the schema. - :param str org_id: An organization ID. Specifies the organization that owns the schema. - :return: MeasurementSchema - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.update_measurement_schema_with_http_info(bucket_id, measurement_id, measurement_schema_update_request, **kwargs) # noqa: E501 - else: - (data) = self.update_measurement_schema_with_http_info(bucket_id, measurement_id, measurement_schema_update_request, **kwargs) # noqa: E501 - return data - - def update_measurement_schema_with_http_info(self, bucket_id, measurement_id, measurement_schema_update_request, **kwargs): # noqa: E501,D401,D403 - """Update a measurement schema. - - Updates a measurement [schema](https://docs.influxdata.com/influxdb/cloud/reference/glossary/#schema). Use this endpoint to update the fields (`name`, `type`, and `dataType`) of a measurement schema. #### Limitations - You can't update the `name` of a measurement. #### Related guides - [Manage bucket schemas](https://docs.influxdata.com/influxdb/cloud/organizations/buckets/bucket-schema/). - [Using bucket schemas](https://www.influxdata.com/blog/new-bucket-schema-option-protect-from-unwanted-schema-changes/). - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_measurement_schema_with_http_info(bucket_id, measurement_id, measurement_schema_update_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str bucket_id: A bucket ID. Specifies the bucket to retrieve schemas for. (required) - :param str measurement_id: A measurement schema ID. Retrieves the specified measurement schema. (required) - :param MeasurementSchemaUpdateRequest measurement_schema_update_request: (required) - :param str org: An organization name. Specifies the organization that owns the schema. - :param str org_id: An organization ID. Specifies the organization that owns the schema. - :return: MeasurementSchema - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - if not self._is_cloud_instance(): - from influxdb_client.client.warnings import CloudOnlyWarning - CloudOnlyWarning.print_warning('BucketSchemasService', - 'https://docs.influxdata.com/influxdb/cloud/organizations/buckets/bucket-schema/') # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._update_measurement_schema_prepare(bucket_id, measurement_id, measurement_schema_update_request, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/buckets/{bucketID}/schema/measurements/{measurementID}', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='MeasurementSchema', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def update_measurement_schema_async(self, bucket_id, measurement_id, measurement_schema_update_request, **kwargs): # noqa: E501,D401,D403 - """Update a measurement schema. - - Updates a measurement [schema](https://docs.influxdata.com/influxdb/cloud/reference/glossary/#schema). Use this endpoint to update the fields (`name`, `type`, and `dataType`) of a measurement schema. #### Limitations - You can't update the `name` of a measurement. #### Related guides - [Manage bucket schemas](https://docs.influxdata.com/influxdb/cloud/organizations/buckets/bucket-schema/). - [Using bucket schemas](https://www.influxdata.com/blog/new-bucket-schema-option-protect-from-unwanted-schema-changes/). - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str bucket_id: A bucket ID. Specifies the bucket to retrieve schemas for. (required) - :param str measurement_id: A measurement schema ID. Retrieves the specified measurement schema. (required) - :param MeasurementSchemaUpdateRequest measurement_schema_update_request: (required) - :param str org: An organization name. Specifies the organization that owns the schema. - :param str org_id: An organization ID. Specifies the organization that owns the schema. - :return: MeasurementSchema - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - if not await self._is_cloud_instance_async(): - from influxdb_client.client.warnings import CloudOnlyWarning - CloudOnlyWarning.print_warning('BucketSchemasService', - 'https://docs.influxdata.com/influxdb/cloud/organizations/buckets/bucket-schema/') # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._update_measurement_schema_prepare(bucket_id, measurement_id, measurement_schema_update_request, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/buckets/{bucketID}/schema/measurements/{measurementID}', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='MeasurementSchema', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _update_measurement_schema_prepare(self, bucket_id, measurement_id, measurement_schema_update_request, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['bucket_id', 'measurement_id', 'measurement_schema_update_request', 'org', 'org_id'] # noqa: E501 - self._check_operation_params('update_measurement_schema', all_params, local_var_params) - # verify the required parameter 'bucket_id' is set - if ('bucket_id' not in local_var_params or - local_var_params['bucket_id'] is None): - raise ValueError("Missing the required parameter `bucket_id` when calling `update_measurement_schema`") # noqa: E501 - # verify the required parameter 'measurement_id' is set - if ('measurement_id' not in local_var_params or - local_var_params['measurement_id'] is None): - raise ValueError("Missing the required parameter `measurement_id` when calling `update_measurement_schema`") # noqa: E501 - # verify the required parameter 'measurement_schema_update_request' is set - if ('measurement_schema_update_request' not in local_var_params or - local_var_params['measurement_schema_update_request'] is None): - raise ValueError("Missing the required parameter `measurement_schema_update_request` when calling `update_measurement_schema`") # noqa: E501 - - path_params = {} - if 'bucket_id' in local_var_params: - path_params['bucketID'] = local_var_params['bucket_id'] # noqa: E501 - if 'measurement_id' in local_var_params: - path_params['measurementID'] = local_var_params['measurement_id'] # noqa: E501 - - query_params = [] - if 'org' in local_var_params: - query_params.append(('org', local_var_params['org'])) # noqa: E501 - if 'org_id' in local_var_params: - query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501 - - header_params = {} - - body_params = None - if 'measurement_schema_update_request' in local_var_params: - body_params = local_var_params['measurement_schema_update_request'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params diff --git a/frogpilot/third_party/influxdb_client/service/buckets_service.py b/frogpilot/third_party/influxdb_client/service/buckets_service.py deleted file mode 100644 index 05cf0e1f..00000000 --- a/frogpilot/third_party/influxdb_client/service/buckets_service.py +++ /dev/null @@ -1,1929 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -from influxdb_client.service._base_service import _BaseService - - -class BucketsService(_BaseService): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): # noqa: E501,D401,D403 - """BucketsService - a operation defined in OpenAPI.""" - super().__init__(api_client) - - def delete_buckets_id(self, bucket_id, **kwargs): # noqa: E501,D401,D403 - """Delete a bucket. - - Deletes a bucket and all associated records. #### InfluxDB Cloud - Does the following when you send a delete request: 1. Validates the request and queues the delete. 2. Returns an HTTP `204` status code if queued; _error_ otherwise. 3. Handles the delete asynchronously. #### InfluxDB OSS - Validates the request, handles the delete synchronously, and then responds with success or failure. #### Limitations - Only one bucket can be deleted per request. #### Related Guides - [Delete a bucket](https://docs.influxdata.com/influxdb/latest/organizations/buckets/delete-bucket/#delete-a-bucket-in-the-influxdb-ui) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_buckets_id(bucket_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str bucket_id: Bucket ID. The ID of the bucket to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_buckets_id_with_http_info(bucket_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_buckets_id_with_http_info(bucket_id, **kwargs) # noqa: E501 - return data - - def delete_buckets_id_with_http_info(self, bucket_id, **kwargs): # noqa: E501,D401,D403 - """Delete a bucket. - - Deletes a bucket and all associated records. #### InfluxDB Cloud - Does the following when you send a delete request: 1. Validates the request and queues the delete. 2. Returns an HTTP `204` status code if queued; _error_ otherwise. 3. Handles the delete asynchronously. #### InfluxDB OSS - Validates the request, handles the delete synchronously, and then responds with success or failure. #### Limitations - Only one bucket can be deleted per request. #### Related Guides - [Delete a bucket](https://docs.influxdata.com/influxdb/latest/organizations/buckets/delete-bucket/#delete-a-bucket-in-the-influxdb-ui) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_buckets_id_with_http_info(bucket_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str bucket_id: Bucket ID. The ID of the bucket to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_buckets_id_prepare(bucket_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/buckets/{bucketID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def delete_buckets_id_async(self, bucket_id, **kwargs): # noqa: E501,D401,D403 - """Delete a bucket. - - Deletes a bucket and all associated records. #### InfluxDB Cloud - Does the following when you send a delete request: 1. Validates the request and queues the delete. 2. Returns an HTTP `204` status code if queued; _error_ otherwise. 3. Handles the delete asynchronously. #### InfluxDB OSS - Validates the request, handles the delete synchronously, and then responds with success or failure. #### Limitations - Only one bucket can be deleted per request. #### Related Guides - [Delete a bucket](https://docs.influxdata.com/influxdb/latest/organizations/buckets/delete-bucket/#delete-a-bucket-in-the-influxdb-ui) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str bucket_id: Bucket ID. The ID of the bucket to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_buckets_id_prepare(bucket_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/buckets/{bucketID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _delete_buckets_id_prepare(self, bucket_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['bucket_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('delete_buckets_id', all_params, local_var_params) - # verify the required parameter 'bucket_id' is set - if ('bucket_id' not in local_var_params or - local_var_params['bucket_id'] is None): - raise ValueError("Missing the required parameter `bucket_id` when calling `delete_buckets_id`") # noqa: E501 - - path_params = {} - if 'bucket_id' in local_var_params: - path_params['bucketID'] = local_var_params['bucket_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def delete_buckets_id_labels_id(self, bucket_id, label_id, **kwargs): # noqa: E501,D401,D403 - """Delete a label from a bucket. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_buckets_id_labels_id(bucket_id, label_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str bucket_id: The bucket ID. (required) - :param str label_id: The ID of the label to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_buckets_id_labels_id_with_http_info(bucket_id, label_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_buckets_id_labels_id_with_http_info(bucket_id, label_id, **kwargs) # noqa: E501 - return data - - def delete_buckets_id_labels_id_with_http_info(self, bucket_id, label_id, **kwargs): # noqa: E501,D401,D403 - """Delete a label from a bucket. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_buckets_id_labels_id_with_http_info(bucket_id, label_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str bucket_id: The bucket ID. (required) - :param str label_id: The ID of the label to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_buckets_id_labels_id_prepare(bucket_id, label_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/buckets/{bucketID}/labels/{labelID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def delete_buckets_id_labels_id_async(self, bucket_id, label_id, **kwargs): # noqa: E501,D401,D403 - """Delete a label from a bucket. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str bucket_id: The bucket ID. (required) - :param str label_id: The ID of the label to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_buckets_id_labels_id_prepare(bucket_id, label_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/buckets/{bucketID}/labels/{labelID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _delete_buckets_id_labels_id_prepare(self, bucket_id, label_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['bucket_id', 'label_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('delete_buckets_id_labels_id', all_params, local_var_params) - # verify the required parameter 'bucket_id' is set - if ('bucket_id' not in local_var_params or - local_var_params['bucket_id'] is None): - raise ValueError("Missing the required parameter `bucket_id` when calling `delete_buckets_id_labels_id`") # noqa: E501 - # verify the required parameter 'label_id' is set - if ('label_id' not in local_var_params or - local_var_params['label_id'] is None): - raise ValueError("Missing the required parameter `label_id` when calling `delete_buckets_id_labels_id`") # noqa: E501 - - path_params = {} - if 'bucket_id' in local_var_params: - path_params['bucketID'] = local_var_params['bucket_id'] # noqa: E501 - if 'label_id' in local_var_params: - path_params['labelID'] = local_var_params['label_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def delete_buckets_id_members_id(self, user_id, bucket_id, **kwargs): # noqa: E501,D401,D403 - """Remove a member from a bucket. - - Removes a member from a bucket. Use this endpoint to remove a user's member privileges from a bucket. This removes the user's `read` and `write` permissions for the bucket. #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/users/) - [Manage members](https://docs.influxdata.com/influxdb/latest/organizations/members/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_buckets_id_members_id(user_id, bucket_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_id: The ID of the user to remove. (required) - :param str bucket_id: The ID of the bucket to remove a user from. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_buckets_id_members_id_with_http_info(user_id, bucket_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_buckets_id_members_id_with_http_info(user_id, bucket_id, **kwargs) # noqa: E501 - return data - - def delete_buckets_id_members_id_with_http_info(self, user_id, bucket_id, **kwargs): # noqa: E501,D401,D403 - """Remove a member from a bucket. - - Removes a member from a bucket. Use this endpoint to remove a user's member privileges from a bucket. This removes the user's `read` and `write` permissions for the bucket. #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/users/) - [Manage members](https://docs.influxdata.com/influxdb/latest/organizations/members/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_buckets_id_members_id_with_http_info(user_id, bucket_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_id: The ID of the user to remove. (required) - :param str bucket_id: The ID of the bucket to remove a user from. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_buckets_id_members_id_prepare(user_id, bucket_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/buckets/{bucketID}/members/{userID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def delete_buckets_id_members_id_async(self, user_id, bucket_id, **kwargs): # noqa: E501,D401,D403 - """Remove a member from a bucket. - - Removes a member from a bucket. Use this endpoint to remove a user's member privileges from a bucket. This removes the user's `read` and `write` permissions for the bucket. #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/users/) - [Manage members](https://docs.influxdata.com/influxdb/latest/organizations/members/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str user_id: The ID of the user to remove. (required) - :param str bucket_id: The ID of the bucket to remove a user from. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_buckets_id_members_id_prepare(user_id, bucket_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/buckets/{bucketID}/members/{userID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _delete_buckets_id_members_id_prepare(self, user_id, bucket_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['user_id', 'bucket_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('delete_buckets_id_members_id', all_params, local_var_params) - # verify the required parameter 'user_id' is set - if ('user_id' not in local_var_params or - local_var_params['user_id'] is None): - raise ValueError("Missing the required parameter `user_id` when calling `delete_buckets_id_members_id`") # noqa: E501 - # verify the required parameter 'bucket_id' is set - if ('bucket_id' not in local_var_params or - local_var_params['bucket_id'] is None): - raise ValueError("Missing the required parameter `bucket_id` when calling `delete_buckets_id_members_id`") # noqa: E501 - - path_params = {} - if 'user_id' in local_var_params: - path_params['userID'] = local_var_params['user_id'] # noqa: E501 - if 'bucket_id' in local_var_params: - path_params['bucketID'] = local_var_params['bucket_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def delete_buckets_id_owners_id(self, user_id, bucket_id, **kwargs): # noqa: E501,D401,D403 - """Remove an owner from a bucket. - - Removes an owner from a bucket. Use this endpoint to remove a user's `owner` role for a bucket. #### InfluxDB Cloud - Doesn't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. #### Limitations - Owner permissions are separate from API token permissions. - Owner permissions are used in the context of the InfluxDB UI. #### Required permissions - `write-orgs INFLUX_ORG_ID` *`INFLUX_ORG_ID`* is the ID of the organization that you want to remove an owner from. #### Related endpoints - [Authorizations](#tag/Authorizations-(API-tokens)) #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/users/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_buckets_id_owners_id(user_id, bucket_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_id: The ID of the owner to remove. (required) - :param str bucket_id: The ID of the bucket to remove an owner from. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_buckets_id_owners_id_with_http_info(user_id, bucket_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_buckets_id_owners_id_with_http_info(user_id, bucket_id, **kwargs) # noqa: E501 - return data - - def delete_buckets_id_owners_id_with_http_info(self, user_id, bucket_id, **kwargs): # noqa: E501,D401,D403 - """Remove an owner from a bucket. - - Removes an owner from a bucket. Use this endpoint to remove a user's `owner` role for a bucket. #### InfluxDB Cloud - Doesn't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. #### Limitations - Owner permissions are separate from API token permissions. - Owner permissions are used in the context of the InfluxDB UI. #### Required permissions - `write-orgs INFLUX_ORG_ID` *`INFLUX_ORG_ID`* is the ID of the organization that you want to remove an owner from. #### Related endpoints - [Authorizations](#tag/Authorizations-(API-tokens)) #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/users/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_buckets_id_owners_id_with_http_info(user_id, bucket_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_id: The ID of the owner to remove. (required) - :param str bucket_id: The ID of the bucket to remove an owner from. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_buckets_id_owners_id_prepare(user_id, bucket_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/buckets/{bucketID}/owners/{userID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def delete_buckets_id_owners_id_async(self, user_id, bucket_id, **kwargs): # noqa: E501,D401,D403 - """Remove an owner from a bucket. - - Removes an owner from a bucket. Use this endpoint to remove a user's `owner` role for a bucket. #### InfluxDB Cloud - Doesn't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. #### Limitations - Owner permissions are separate from API token permissions. - Owner permissions are used in the context of the InfluxDB UI. #### Required permissions - `write-orgs INFLUX_ORG_ID` *`INFLUX_ORG_ID`* is the ID of the organization that you want to remove an owner from. #### Related endpoints - [Authorizations](#tag/Authorizations-(API-tokens)) #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/users/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str user_id: The ID of the owner to remove. (required) - :param str bucket_id: The ID of the bucket to remove an owner from. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_buckets_id_owners_id_prepare(user_id, bucket_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/buckets/{bucketID}/owners/{userID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _delete_buckets_id_owners_id_prepare(self, user_id, bucket_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['user_id', 'bucket_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('delete_buckets_id_owners_id', all_params, local_var_params) - # verify the required parameter 'user_id' is set - if ('user_id' not in local_var_params or - local_var_params['user_id'] is None): - raise ValueError("Missing the required parameter `user_id` when calling `delete_buckets_id_owners_id`") # noqa: E501 - # verify the required parameter 'bucket_id' is set - if ('bucket_id' not in local_var_params or - local_var_params['bucket_id'] is None): - raise ValueError("Missing the required parameter `bucket_id` when calling `delete_buckets_id_owners_id`") # noqa: E501 - - path_params = {} - if 'user_id' in local_var_params: - path_params['userID'] = local_var_params['user_id'] # noqa: E501 - if 'bucket_id' in local_var_params: - path_params['bucketID'] = local_var_params['bucket_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_buckets(self, **kwargs): # noqa: E501,D401,D403 - """List buckets. - - Lists [buckets](https://docs.influxdata.com/influxdb/latest/reference/glossary/#bucket). InfluxDB retrieves buckets owned by the [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization) associated with the authorization ([API token](https://docs.influxdata.com/influxdb/latest/reference/glossary/#token)). To limit which buckets are returned, pass query parameters in your request. If no query parameters are passed, InfluxDB returns all buckets up to the default `limit`. #### InfluxDB OSS - If you use an _[operator token](https://docs.influxdata.com/influxdb/latest/security/tokens/#operator-token)_ to authenticate your request, InfluxDB retrieves resources for _all organizations_ in the instance. To retrieve resources for only a specific organization, use the `org` parameter or the `orgID` parameter to specify the organization. #### Required permissions | Action | Permission required | |:--------------------------|:--------------------| | Retrieve _user buckets_ | `read-buckets` | | Retrieve [_system buckets_](https://docs.influxdata.com/influxdb/latest/reference/internals/system-buckets/) | `read-orgs` | #### Related Guides - [Manage buckets](https://docs.influxdata.com/influxdb/latest/organizations/buckets/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_buckets(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param int offset: The offset for pagination. The number of records to skip. For more information about pagination parameters, see [Pagination](https://docs.influxdata.com/influxdb/latest/api/#tag/Pagination). - :param int limit: Limits the number of records returned. Default is `20`. - :param str after: A resource ID to seek from. Returns records created after the specified record; results don't include the specified record. Use `after` instead of the `offset` parameter. For more information about pagination parameters, see [Pagination](https://docs.influxdata.com/influxdb/latest/api/#tag/Pagination). - :param str org: An organization name. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Lists buckets for the organization associated with the authorization (API token). #### InfluxDB OSS - Lists buckets for the specified organization. - :param str org_id: An organization ID. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Lists buckets for the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either the `org` parameter or `orgID` parameter. - Lists buckets for the specified organization. - :param str name: A bucket name. Only returns buckets with the specified name. - :param str id: A bucket ID. Only returns the bucket with the specified ID. - :return: Buckets - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_buckets_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_buckets_with_http_info(**kwargs) # noqa: E501 - return data - - def get_buckets_with_http_info(self, **kwargs): # noqa: E501,D401,D403 - """List buckets. - - Lists [buckets](https://docs.influxdata.com/influxdb/latest/reference/glossary/#bucket). InfluxDB retrieves buckets owned by the [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization) associated with the authorization ([API token](https://docs.influxdata.com/influxdb/latest/reference/glossary/#token)). To limit which buckets are returned, pass query parameters in your request. If no query parameters are passed, InfluxDB returns all buckets up to the default `limit`. #### InfluxDB OSS - If you use an _[operator token](https://docs.influxdata.com/influxdb/latest/security/tokens/#operator-token)_ to authenticate your request, InfluxDB retrieves resources for _all organizations_ in the instance. To retrieve resources for only a specific organization, use the `org` parameter or the `orgID` parameter to specify the organization. #### Required permissions | Action | Permission required | |:--------------------------|:--------------------| | Retrieve _user buckets_ | `read-buckets` | | Retrieve [_system buckets_](https://docs.influxdata.com/influxdb/latest/reference/internals/system-buckets/) | `read-orgs` | #### Related Guides - [Manage buckets](https://docs.influxdata.com/influxdb/latest/organizations/buckets/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_buckets_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param int offset: The offset for pagination. The number of records to skip. For more information about pagination parameters, see [Pagination](https://docs.influxdata.com/influxdb/latest/api/#tag/Pagination). - :param int limit: Limits the number of records returned. Default is `20`. - :param str after: A resource ID to seek from. Returns records created after the specified record; results don't include the specified record. Use `after` instead of the `offset` parameter. For more information about pagination parameters, see [Pagination](https://docs.influxdata.com/influxdb/latest/api/#tag/Pagination). - :param str org: An organization name. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Lists buckets for the organization associated with the authorization (API token). #### InfluxDB OSS - Lists buckets for the specified organization. - :param str org_id: An organization ID. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Lists buckets for the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either the `org` parameter or `orgID` parameter. - Lists buckets for the specified organization. - :param str name: A bucket name. Only returns buckets with the specified name. - :param str id: A bucket ID. Only returns the bucket with the specified ID. - :return: Buckets - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_buckets_prepare(**kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/buckets', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Buckets', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_buckets_async(self, **kwargs): # noqa: E501,D401,D403 - """List buckets. - - Lists [buckets](https://docs.influxdata.com/influxdb/latest/reference/glossary/#bucket). InfluxDB retrieves buckets owned by the [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization) associated with the authorization ([API token](https://docs.influxdata.com/influxdb/latest/reference/glossary/#token)). To limit which buckets are returned, pass query parameters in your request. If no query parameters are passed, InfluxDB returns all buckets up to the default `limit`. #### InfluxDB OSS - If you use an _[operator token](https://docs.influxdata.com/influxdb/latest/security/tokens/#operator-token)_ to authenticate your request, InfluxDB retrieves resources for _all organizations_ in the instance. To retrieve resources for only a specific organization, use the `org` parameter or the `orgID` parameter to specify the organization. #### Required permissions | Action | Permission required | |:--------------------------|:--------------------| | Retrieve _user buckets_ | `read-buckets` | | Retrieve [_system buckets_](https://docs.influxdata.com/influxdb/latest/reference/internals/system-buckets/) | `read-orgs` | #### Related Guides - [Manage buckets](https://docs.influxdata.com/influxdb/latest/organizations/buckets/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param int offset: The offset for pagination. The number of records to skip. For more information about pagination parameters, see [Pagination](https://docs.influxdata.com/influxdb/latest/api/#tag/Pagination). - :param int limit: Limits the number of records returned. Default is `20`. - :param str after: A resource ID to seek from. Returns records created after the specified record; results don't include the specified record. Use `after` instead of the `offset` parameter. For more information about pagination parameters, see [Pagination](https://docs.influxdata.com/influxdb/latest/api/#tag/Pagination). - :param str org: An organization name. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Lists buckets for the organization associated with the authorization (API token). #### InfluxDB OSS - Lists buckets for the specified organization. - :param str org_id: An organization ID. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Lists buckets for the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either the `org` parameter or `orgID` parameter. - Lists buckets for the specified organization. - :param str name: A bucket name. Only returns buckets with the specified name. - :param str id: A bucket ID. Only returns the bucket with the specified ID. - :return: Buckets - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_buckets_prepare(**kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/buckets', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Buckets', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_buckets_prepare(self, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['zap_trace_span', 'offset', 'limit', 'after', 'org', 'org_id', 'name', 'id'] # noqa: E501 - self._check_operation_params('get_buckets', all_params, local_var_params) - - if 'offset' in local_var_params and local_var_params['offset'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `offset` when calling `get_buckets`, must be a value greater than or equal to `0`") # noqa: E501 - if 'limit' in local_var_params and local_var_params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `get_buckets`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `get_buckets`, must be a value greater than or equal to `1`") # noqa: E501 - path_params = {} - - query_params = [] - if 'offset' in local_var_params: - query_params.append(('offset', local_var_params['offset'])) # noqa: E501 - if 'limit' in local_var_params: - query_params.append(('limit', local_var_params['limit'])) # noqa: E501 - if 'after' in local_var_params: - query_params.append(('after', local_var_params['after'])) # noqa: E501 - if 'org' in local_var_params: - query_params.append(('org', local_var_params['org'])) # noqa: E501 - if 'org_id' in local_var_params: - query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501 - if 'name' in local_var_params: - query_params.append(('name', local_var_params['name'])) # noqa: E501 - if 'id' in local_var_params: - query_params.append(('id', local_var_params['id'])) # noqa: E501 - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_buckets_id(self, bucket_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a bucket. - - Retrieves a bucket. Use this endpoint to retrieve information for a specific bucket. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_buckets_id(bucket_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str bucket_id: The ID of the bucket to retrieve. (required) - :param str zap_trace_span: OpenTracing span context - :return: Bucket - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_buckets_id_with_http_info(bucket_id, **kwargs) # noqa: E501 - else: - (data) = self.get_buckets_id_with_http_info(bucket_id, **kwargs) # noqa: E501 - return data - - def get_buckets_id_with_http_info(self, bucket_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a bucket. - - Retrieves a bucket. Use this endpoint to retrieve information for a specific bucket. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_buckets_id_with_http_info(bucket_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str bucket_id: The ID of the bucket to retrieve. (required) - :param str zap_trace_span: OpenTracing span context - :return: Bucket - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_buckets_id_prepare(bucket_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/buckets/{bucketID}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Bucket', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_buckets_id_async(self, bucket_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a bucket. - - Retrieves a bucket. Use this endpoint to retrieve information for a specific bucket. - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str bucket_id: The ID of the bucket to retrieve. (required) - :param str zap_trace_span: OpenTracing span context - :return: Bucket - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_buckets_id_prepare(bucket_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/buckets/{bucketID}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Bucket', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_buckets_id_prepare(self, bucket_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['bucket_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_buckets_id', all_params, local_var_params) - # verify the required parameter 'bucket_id' is set - if ('bucket_id' not in local_var_params or - local_var_params['bucket_id'] is None): - raise ValueError("Missing the required parameter `bucket_id` when calling `get_buckets_id`") # noqa: E501 - - path_params = {} - if 'bucket_id' in local_var_params: - path_params['bucketID'] = local_var_params['bucket_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_buckets_id_labels(self, bucket_id, **kwargs): # noqa: E501,D401,D403 - """List all labels for a bucket. - - Lists all labels for a bucket. Labels are objects that contain `labelID`, `name`, `description`, and `color` key-value pairs. They may be used for grouping and filtering InfluxDB resources. Labels are also capable of grouping across different resources--for example, you can apply a label named `air_sensor` to a bucket and a task to quickly organize resources. #### Related guides - Use the [`/api/v2/labels` InfluxDB API endpoint](#tag/Labels) to retrieve and manage labels. - [Manage labels in the InfluxDB UI](https://docs.influxdata.com/influxdb/latest/visualize-data/labels/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_buckets_id_labels(bucket_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str bucket_id: The ID of the bucket to retrieve labels for. (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelsResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_buckets_id_labels_with_http_info(bucket_id, **kwargs) # noqa: E501 - else: - (data) = self.get_buckets_id_labels_with_http_info(bucket_id, **kwargs) # noqa: E501 - return data - - def get_buckets_id_labels_with_http_info(self, bucket_id, **kwargs): # noqa: E501,D401,D403 - """List all labels for a bucket. - - Lists all labels for a bucket. Labels are objects that contain `labelID`, `name`, `description`, and `color` key-value pairs. They may be used for grouping and filtering InfluxDB resources. Labels are also capable of grouping across different resources--for example, you can apply a label named `air_sensor` to a bucket and a task to quickly organize resources. #### Related guides - Use the [`/api/v2/labels` InfluxDB API endpoint](#tag/Labels) to retrieve and manage labels. - [Manage labels in the InfluxDB UI](https://docs.influxdata.com/influxdb/latest/visualize-data/labels/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_buckets_id_labels_with_http_info(bucket_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str bucket_id: The ID of the bucket to retrieve labels for. (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelsResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_buckets_id_labels_prepare(bucket_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/buckets/{bucketID}/labels', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='LabelsResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_buckets_id_labels_async(self, bucket_id, **kwargs): # noqa: E501,D401,D403 - """List all labels for a bucket. - - Lists all labels for a bucket. Labels are objects that contain `labelID`, `name`, `description`, and `color` key-value pairs. They may be used for grouping and filtering InfluxDB resources. Labels are also capable of grouping across different resources--for example, you can apply a label named `air_sensor` to a bucket and a task to quickly organize resources. #### Related guides - Use the [`/api/v2/labels` InfluxDB API endpoint](#tag/Labels) to retrieve and manage labels. - [Manage labels in the InfluxDB UI](https://docs.influxdata.com/influxdb/latest/visualize-data/labels/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str bucket_id: The ID of the bucket to retrieve labels for. (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelsResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_buckets_id_labels_prepare(bucket_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/buckets/{bucketID}/labels', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='LabelsResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_buckets_id_labels_prepare(self, bucket_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['bucket_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_buckets_id_labels', all_params, local_var_params) - # verify the required parameter 'bucket_id' is set - if ('bucket_id' not in local_var_params or - local_var_params['bucket_id'] is None): - raise ValueError("Missing the required parameter `bucket_id` when calling `get_buckets_id_labels`") # noqa: E501 - - path_params = {} - if 'bucket_id' in local_var_params: - path_params['bucketID'] = local_var_params['bucket_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_buckets_id_members(self, bucket_id, **kwargs): # noqa: E501,D401,D403 - """List all users with member privileges for a bucket. - - Lists all users for a bucket. InfluxDB [users](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user) have permission to access InfluxDB. [Members](https://docs.influxdata.com/influxdb/latest/reference/glossary/#member) are users in an organization with access to the specified resource. Use this endpoint to retrieve all users with access to a bucket. #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/users/) - [Manage members](https://docs.influxdata.com/influxdb/latest/organizations/members/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_buckets_id_members(bucket_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str bucket_id: The ID of the bucket to retrieve users for. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceMembers - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_buckets_id_members_with_http_info(bucket_id, **kwargs) # noqa: E501 - else: - (data) = self.get_buckets_id_members_with_http_info(bucket_id, **kwargs) # noqa: E501 - return data - - def get_buckets_id_members_with_http_info(self, bucket_id, **kwargs): # noqa: E501,D401,D403 - """List all users with member privileges for a bucket. - - Lists all users for a bucket. InfluxDB [users](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user) have permission to access InfluxDB. [Members](https://docs.influxdata.com/influxdb/latest/reference/glossary/#member) are users in an organization with access to the specified resource. Use this endpoint to retrieve all users with access to a bucket. #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/users/) - [Manage members](https://docs.influxdata.com/influxdb/latest/organizations/members/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_buckets_id_members_with_http_info(bucket_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str bucket_id: The ID of the bucket to retrieve users for. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceMembers - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_buckets_id_members_prepare(bucket_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/buckets/{bucketID}/members', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceMembers', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_buckets_id_members_async(self, bucket_id, **kwargs): # noqa: E501,D401,D403 - """List all users with member privileges for a bucket. - - Lists all users for a bucket. InfluxDB [users](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user) have permission to access InfluxDB. [Members](https://docs.influxdata.com/influxdb/latest/reference/glossary/#member) are users in an organization with access to the specified resource. Use this endpoint to retrieve all users with access to a bucket. #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/users/) - [Manage members](https://docs.influxdata.com/influxdb/latest/organizations/members/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str bucket_id: The ID of the bucket to retrieve users for. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceMembers - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_buckets_id_members_prepare(bucket_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/buckets/{bucketID}/members', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceMembers', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_buckets_id_members_prepare(self, bucket_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['bucket_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_buckets_id_members', all_params, local_var_params) - # verify the required parameter 'bucket_id' is set - if ('bucket_id' not in local_var_params or - local_var_params['bucket_id'] is None): - raise ValueError("Missing the required parameter `bucket_id` when calling `get_buckets_id_members`") # noqa: E501 - - path_params = {} - if 'bucket_id' in local_var_params: - path_params['bucketID'] = local_var_params['bucket_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_buckets_id_owners(self, bucket_id, **kwargs): # noqa: E501,D401,D403 - """List all owners of a bucket. - - Lists all [owners](https://docs.influxdata.com/influxdb/latest/reference/glossary/#owner) of a bucket. Bucket owners have permission to delete buckets and remove user and member permissions from the bucket. #### InfluxDB Cloud - Doesn't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. #### Limitations - Owner permissions are separate from API token permissions. - Owner permissions are used in the context of the InfluxDB UI. #### Required permissions - `read-orgs INFLUX_ORG_ID` *`INFLUX_ORG_ID`* is the ID of the organization that you want to retrieve a list of owners for. #### Related endpoints - [Authorizations](#tag/Authorizations-(API-tokens)) #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/users/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_buckets_id_owners(bucket_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str bucket_id: The ID of the bucket to retrieve owners for. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceOwners - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_buckets_id_owners_with_http_info(bucket_id, **kwargs) # noqa: E501 - else: - (data) = self.get_buckets_id_owners_with_http_info(bucket_id, **kwargs) # noqa: E501 - return data - - def get_buckets_id_owners_with_http_info(self, bucket_id, **kwargs): # noqa: E501,D401,D403 - """List all owners of a bucket. - - Lists all [owners](https://docs.influxdata.com/influxdb/latest/reference/glossary/#owner) of a bucket. Bucket owners have permission to delete buckets and remove user and member permissions from the bucket. #### InfluxDB Cloud - Doesn't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. #### Limitations - Owner permissions are separate from API token permissions. - Owner permissions are used in the context of the InfluxDB UI. #### Required permissions - `read-orgs INFLUX_ORG_ID` *`INFLUX_ORG_ID`* is the ID of the organization that you want to retrieve a list of owners for. #### Related endpoints - [Authorizations](#tag/Authorizations-(API-tokens)) #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/users/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_buckets_id_owners_with_http_info(bucket_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str bucket_id: The ID of the bucket to retrieve owners for. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceOwners - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_buckets_id_owners_prepare(bucket_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/buckets/{bucketID}/owners', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceOwners', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_buckets_id_owners_async(self, bucket_id, **kwargs): # noqa: E501,D401,D403 - """List all owners of a bucket. - - Lists all [owners](https://docs.influxdata.com/influxdb/latest/reference/glossary/#owner) of a bucket. Bucket owners have permission to delete buckets and remove user and member permissions from the bucket. #### InfluxDB Cloud - Doesn't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. #### Limitations - Owner permissions are separate from API token permissions. - Owner permissions are used in the context of the InfluxDB UI. #### Required permissions - `read-orgs INFLUX_ORG_ID` *`INFLUX_ORG_ID`* is the ID of the organization that you want to retrieve a list of owners for. #### Related endpoints - [Authorizations](#tag/Authorizations-(API-tokens)) #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/users/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str bucket_id: The ID of the bucket to retrieve owners for. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceOwners - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_buckets_id_owners_prepare(bucket_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/buckets/{bucketID}/owners', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceOwners', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_buckets_id_owners_prepare(self, bucket_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['bucket_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_buckets_id_owners', all_params, local_var_params) - # verify the required parameter 'bucket_id' is set - if ('bucket_id' not in local_var_params or - local_var_params['bucket_id'] is None): - raise ValueError("Missing the required parameter `bucket_id` when calling `get_buckets_id_owners`") # noqa: E501 - - path_params = {} - if 'bucket_id' in local_var_params: - path_params['bucketID'] = local_var_params['bucket_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_sources_id_buckets(self, source_id, **kwargs): # noqa: E501,D401,D403 - """Get buckets in a source. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_sources_id_buckets(source_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str source_id: The source ID. (required) - :param str zap_trace_span: OpenTracing span context - :param str org: The name of the organization. - :return: Buckets - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_sources_id_buckets_with_http_info(source_id, **kwargs) # noqa: E501 - else: - (data) = self.get_sources_id_buckets_with_http_info(source_id, **kwargs) # noqa: E501 - return data - - def get_sources_id_buckets_with_http_info(self, source_id, **kwargs): # noqa: E501,D401,D403 - """Get buckets in a source. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_sources_id_buckets_with_http_info(source_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str source_id: The source ID. (required) - :param str zap_trace_span: OpenTracing span context - :param str org: The name of the organization. - :return: Buckets - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_sources_id_buckets_prepare(source_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/sources/{sourceID}/buckets', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Buckets', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_sources_id_buckets_async(self, source_id, **kwargs): # noqa: E501,D401,D403 - """Get buckets in a source. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str source_id: The source ID. (required) - :param str zap_trace_span: OpenTracing span context - :param str org: The name of the organization. - :return: Buckets - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_sources_id_buckets_prepare(source_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/sources/{sourceID}/buckets', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Buckets', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_sources_id_buckets_prepare(self, source_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['source_id', 'zap_trace_span', 'org'] # noqa: E501 - self._check_operation_params('get_sources_id_buckets', all_params, local_var_params) - # verify the required parameter 'source_id' is set - if ('source_id' not in local_var_params or - local_var_params['source_id'] is None): - raise ValueError("Missing the required parameter `source_id` when calling `get_sources_id_buckets`") # noqa: E501 - - path_params = {} - if 'source_id' in local_var_params: - path_params['sourceID'] = local_var_params['source_id'] # noqa: E501 - - query_params = [] - if 'org' in local_var_params: - query_params.append(('org', local_var_params['org'])) # noqa: E501 - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def patch_buckets_id(self, bucket_id, patch_bucket_request, **kwargs): # noqa: E501,D401,D403 - """Update a bucket. - - Updates a bucket. Use this endpoint to update properties (`name`, `description`, and `retentionRules`) of a bucket. #### InfluxDB Cloud - Requires the `retentionRules` property in the request body. If you don't provide `retentionRules`, InfluxDB responds with an HTTP `403` status code. #### InfluxDB OSS - Doesn't require `retentionRules`. #### Related Guides - [Update a bucket](https://docs.influxdata.com/influxdb/latest/organizations/buckets/update-bucket/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_buckets_id(bucket_id, patch_bucket_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str bucket_id: The bucket ID. (required) - :param PatchBucketRequest patch_bucket_request: The bucket update to apply. (required) - :param str zap_trace_span: OpenTracing span context - :return: Bucket - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.patch_buckets_id_with_http_info(bucket_id, patch_bucket_request, **kwargs) # noqa: E501 - else: - (data) = self.patch_buckets_id_with_http_info(bucket_id, patch_bucket_request, **kwargs) # noqa: E501 - return data - - def patch_buckets_id_with_http_info(self, bucket_id, patch_bucket_request, **kwargs): # noqa: E501,D401,D403 - """Update a bucket. - - Updates a bucket. Use this endpoint to update properties (`name`, `description`, and `retentionRules`) of a bucket. #### InfluxDB Cloud - Requires the `retentionRules` property in the request body. If you don't provide `retentionRules`, InfluxDB responds with an HTTP `403` status code. #### InfluxDB OSS - Doesn't require `retentionRules`. #### Related Guides - [Update a bucket](https://docs.influxdata.com/influxdb/latest/organizations/buckets/update-bucket/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_buckets_id_with_http_info(bucket_id, patch_bucket_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str bucket_id: The bucket ID. (required) - :param PatchBucketRequest patch_bucket_request: The bucket update to apply. (required) - :param str zap_trace_span: OpenTracing span context - :return: Bucket - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_buckets_id_prepare(bucket_id, patch_bucket_request, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/buckets/{bucketID}', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Bucket', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def patch_buckets_id_async(self, bucket_id, patch_bucket_request, **kwargs): # noqa: E501,D401,D403 - """Update a bucket. - - Updates a bucket. Use this endpoint to update properties (`name`, `description`, and `retentionRules`) of a bucket. #### InfluxDB Cloud - Requires the `retentionRules` property in the request body. If you don't provide `retentionRules`, InfluxDB responds with an HTTP `403` status code. #### InfluxDB OSS - Doesn't require `retentionRules`. #### Related Guides - [Update a bucket](https://docs.influxdata.com/influxdb/latest/organizations/buckets/update-bucket/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str bucket_id: The bucket ID. (required) - :param PatchBucketRequest patch_bucket_request: The bucket update to apply. (required) - :param str zap_trace_span: OpenTracing span context - :return: Bucket - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_buckets_id_prepare(bucket_id, patch_bucket_request, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/buckets/{bucketID}', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Bucket', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _patch_buckets_id_prepare(self, bucket_id, patch_bucket_request, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['bucket_id', 'patch_bucket_request', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('patch_buckets_id', all_params, local_var_params) - # verify the required parameter 'bucket_id' is set - if ('bucket_id' not in local_var_params or - local_var_params['bucket_id'] is None): - raise ValueError("Missing the required parameter `bucket_id` when calling `patch_buckets_id`") # noqa: E501 - # verify the required parameter 'patch_bucket_request' is set - if ('patch_bucket_request' not in local_var_params or - local_var_params['patch_bucket_request'] is None): - raise ValueError("Missing the required parameter `patch_bucket_request` when calling `patch_buckets_id`") # noqa: E501 - - path_params = {} - if 'bucket_id' in local_var_params: - path_params['bucketID'] = local_var_params['bucket_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'patch_bucket_request' in local_var_params: - body_params = local_var_params['patch_bucket_request'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_buckets(self, post_bucket_request, **kwargs): # noqa: E501,D401,D403 - """Create a bucket. - - Creates a [bucket](https://docs.influxdata.com/influxdb/latest/reference/glossary/#bucket) and returns the bucket resource. The default data [retention period](https://docs.influxdata.com/influxdb/latest/reference/glossary/#retention-period) is 30 days. #### InfluxDB OSS - A single InfluxDB OSS instance supports active writes or queries for approximately 20 buckets across all organizations at a given time. Reading or writing to more than 20 buckets at a time can adversely affect performance. #### Limitations - InfluxDB Cloud Free Plan allows users to create up to two buckets. Exceeding the bucket quota will result in an HTTP `403` status code. For additional information regarding InfluxDB Cloud offerings, see [InfluxDB Cloud Pricing](https://www.influxdata.com/influxdb-cloud-pricing/). #### Related Guides - [Create a bucket](https://docs.influxdata.com/influxdb/latest/organizations/buckets/create-bucket/) - [Create bucket CLI reference](https://docs.influxdata.com/influxdb/latest/reference/cli/influx/bucket/create) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_buckets(post_bucket_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param PostBucketRequest post_bucket_request: The bucket to create. (required) - :param str zap_trace_span: OpenTracing span context - :return: Bucket - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_buckets_with_http_info(post_bucket_request, **kwargs) # noqa: E501 - else: - (data) = self.post_buckets_with_http_info(post_bucket_request, **kwargs) # noqa: E501 - return data - - def post_buckets_with_http_info(self, post_bucket_request, **kwargs): # noqa: E501,D401,D403 - """Create a bucket. - - Creates a [bucket](https://docs.influxdata.com/influxdb/latest/reference/glossary/#bucket) and returns the bucket resource. The default data [retention period](https://docs.influxdata.com/influxdb/latest/reference/glossary/#retention-period) is 30 days. #### InfluxDB OSS - A single InfluxDB OSS instance supports active writes or queries for approximately 20 buckets across all organizations at a given time. Reading or writing to more than 20 buckets at a time can adversely affect performance. #### Limitations - InfluxDB Cloud Free Plan allows users to create up to two buckets. Exceeding the bucket quota will result in an HTTP `403` status code. For additional information regarding InfluxDB Cloud offerings, see [InfluxDB Cloud Pricing](https://www.influxdata.com/influxdb-cloud-pricing/). #### Related Guides - [Create a bucket](https://docs.influxdata.com/influxdb/latest/organizations/buckets/create-bucket/) - [Create bucket CLI reference](https://docs.influxdata.com/influxdb/latest/reference/cli/influx/bucket/create) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_buckets_with_http_info(post_bucket_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param PostBucketRequest post_bucket_request: The bucket to create. (required) - :param str zap_trace_span: OpenTracing span context - :return: Bucket - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_buckets_prepare(post_bucket_request, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/buckets', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Bucket', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_buckets_async(self, post_bucket_request, **kwargs): # noqa: E501,D401,D403 - """Create a bucket. - - Creates a [bucket](https://docs.influxdata.com/influxdb/latest/reference/glossary/#bucket) and returns the bucket resource. The default data [retention period](https://docs.influxdata.com/influxdb/latest/reference/glossary/#retention-period) is 30 days. #### InfluxDB OSS - A single InfluxDB OSS instance supports active writes or queries for approximately 20 buckets across all organizations at a given time. Reading or writing to more than 20 buckets at a time can adversely affect performance. #### Limitations - InfluxDB Cloud Free Plan allows users to create up to two buckets. Exceeding the bucket quota will result in an HTTP `403` status code. For additional information regarding InfluxDB Cloud offerings, see [InfluxDB Cloud Pricing](https://www.influxdata.com/influxdb-cloud-pricing/). #### Related Guides - [Create a bucket](https://docs.influxdata.com/influxdb/latest/organizations/buckets/create-bucket/) - [Create bucket CLI reference](https://docs.influxdata.com/influxdb/latest/reference/cli/influx/bucket/create) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param PostBucketRequest post_bucket_request: The bucket to create. (required) - :param str zap_trace_span: OpenTracing span context - :return: Bucket - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_buckets_prepare(post_bucket_request, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/buckets', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Bucket', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_buckets_prepare(self, post_bucket_request, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['post_bucket_request', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('post_buckets', all_params, local_var_params) - # verify the required parameter 'post_bucket_request' is set - if ('post_bucket_request' not in local_var_params or - local_var_params['post_bucket_request'] is None): - raise ValueError("Missing the required parameter `post_bucket_request` when calling `post_buckets`") # noqa: E501 - - path_params = {} - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'post_bucket_request' in local_var_params: - body_params = local_var_params['post_bucket_request'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_buckets_id_labels(self, bucket_id, label_mapping, **kwargs): # noqa: E501,D401,D403 - """Add a label to a bucket. - - Adds a label to a bucket and returns the new label information. Labels are objects that contain `labelID`, `name`, `description`, and `color` key-value pairs. They may be used for grouping and filtering across one or more kinds of **resources**--for example, you can apply a label named `air_sensor` to a bucket and a task to quickly organize resources. #### Limitations - Before adding a label to a bucket, you must create the label if you haven't already. To create a label with the InfluxDB API, send a `POST` request to the [`/api/v2/labels` endpoint](#operation/PostLabels)). #### Related guides - Use the [`/api/v2/labels` InfluxDB API endpoint](#tag/Labels) to retrieve and manage labels. - [Manage labels in the InfluxDB UI](https://docs.influxdata.com/influxdb/latest/visualize-data/labels/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_buckets_id_labels(bucket_id, label_mapping, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str bucket_id: Bucket ID. The ID of the bucket to label. (required) - :param LabelMapping label_mapping: An object that contains a _`labelID`_ to add to the bucket. (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_buckets_id_labels_with_http_info(bucket_id, label_mapping, **kwargs) # noqa: E501 - else: - (data) = self.post_buckets_id_labels_with_http_info(bucket_id, label_mapping, **kwargs) # noqa: E501 - return data - - def post_buckets_id_labels_with_http_info(self, bucket_id, label_mapping, **kwargs): # noqa: E501,D401,D403 - """Add a label to a bucket. - - Adds a label to a bucket and returns the new label information. Labels are objects that contain `labelID`, `name`, `description`, and `color` key-value pairs. They may be used for grouping and filtering across one or more kinds of **resources**--for example, you can apply a label named `air_sensor` to a bucket and a task to quickly organize resources. #### Limitations - Before adding a label to a bucket, you must create the label if you haven't already. To create a label with the InfluxDB API, send a `POST` request to the [`/api/v2/labels` endpoint](#operation/PostLabels)). #### Related guides - Use the [`/api/v2/labels` InfluxDB API endpoint](#tag/Labels) to retrieve and manage labels. - [Manage labels in the InfluxDB UI](https://docs.influxdata.com/influxdb/latest/visualize-data/labels/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_buckets_id_labels_with_http_info(bucket_id, label_mapping, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str bucket_id: Bucket ID. The ID of the bucket to label. (required) - :param LabelMapping label_mapping: An object that contains a _`labelID`_ to add to the bucket. (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_buckets_id_labels_prepare(bucket_id, label_mapping, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/buckets/{bucketID}/labels', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='LabelResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_buckets_id_labels_async(self, bucket_id, label_mapping, **kwargs): # noqa: E501,D401,D403 - """Add a label to a bucket. - - Adds a label to a bucket and returns the new label information. Labels are objects that contain `labelID`, `name`, `description`, and `color` key-value pairs. They may be used for grouping and filtering across one or more kinds of **resources**--for example, you can apply a label named `air_sensor` to a bucket and a task to quickly organize resources. #### Limitations - Before adding a label to a bucket, you must create the label if you haven't already. To create a label with the InfluxDB API, send a `POST` request to the [`/api/v2/labels` endpoint](#operation/PostLabels)). #### Related guides - Use the [`/api/v2/labels` InfluxDB API endpoint](#tag/Labels) to retrieve and manage labels. - [Manage labels in the InfluxDB UI](https://docs.influxdata.com/influxdb/latest/visualize-data/labels/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str bucket_id: Bucket ID. The ID of the bucket to label. (required) - :param LabelMapping label_mapping: An object that contains a _`labelID`_ to add to the bucket. (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_buckets_id_labels_prepare(bucket_id, label_mapping, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/buckets/{bucketID}/labels', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='LabelResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_buckets_id_labels_prepare(self, bucket_id, label_mapping, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['bucket_id', 'label_mapping', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('post_buckets_id_labels', all_params, local_var_params) - # verify the required parameter 'bucket_id' is set - if ('bucket_id' not in local_var_params or - local_var_params['bucket_id'] is None): - raise ValueError("Missing the required parameter `bucket_id` when calling `post_buckets_id_labels`") # noqa: E501 - # verify the required parameter 'label_mapping' is set - if ('label_mapping' not in local_var_params or - local_var_params['label_mapping'] is None): - raise ValueError("Missing the required parameter `label_mapping` when calling `post_buckets_id_labels`") # noqa: E501 - - path_params = {} - if 'bucket_id' in local_var_params: - path_params['bucketID'] = local_var_params['bucket_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'label_mapping' in local_var_params: - body_params = local_var_params['label_mapping'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_buckets_id_members(self, bucket_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - """Add a member to a bucket. - - Add a user to a bucket and return the new user information. InfluxDB [users](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user) have permission to access InfluxDB. [Members](https://docs.influxdata.com/influxdb/latest/reference/glossary/#member) are users in an organization. Use this endpoint to give a user member privileges to a bucket. #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/users/) - [Manage members](https://docs.influxdata.com/influxdb/latest/organizations/members/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_buckets_id_members(bucket_id, add_resource_member_request_body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str bucket_id: The ID of the bucket to retrieve users for. (required) - :param AddResourceMemberRequestBody add_resource_member_request_body: A user to add as a member to the bucket. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceMember - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_buckets_id_members_with_http_info(bucket_id, add_resource_member_request_body, **kwargs) # noqa: E501 - else: - (data) = self.post_buckets_id_members_with_http_info(bucket_id, add_resource_member_request_body, **kwargs) # noqa: E501 - return data - - def post_buckets_id_members_with_http_info(self, bucket_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - """Add a member to a bucket. - - Add a user to a bucket and return the new user information. InfluxDB [users](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user) have permission to access InfluxDB. [Members](https://docs.influxdata.com/influxdb/latest/reference/glossary/#member) are users in an organization. Use this endpoint to give a user member privileges to a bucket. #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/users/) - [Manage members](https://docs.influxdata.com/influxdb/latest/organizations/members/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_buckets_id_members_with_http_info(bucket_id, add_resource_member_request_body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str bucket_id: The ID of the bucket to retrieve users for. (required) - :param AddResourceMemberRequestBody add_resource_member_request_body: A user to add as a member to the bucket. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceMember - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_buckets_id_members_prepare(bucket_id, add_resource_member_request_body, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/buckets/{bucketID}/members', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceMember', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_buckets_id_members_async(self, bucket_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - """Add a member to a bucket. - - Add a user to a bucket and return the new user information. InfluxDB [users](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user) have permission to access InfluxDB. [Members](https://docs.influxdata.com/influxdb/latest/reference/glossary/#member) are users in an organization. Use this endpoint to give a user member privileges to a bucket. #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/users/) - [Manage members](https://docs.influxdata.com/influxdb/latest/organizations/members/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str bucket_id: The ID of the bucket to retrieve users for. (required) - :param AddResourceMemberRequestBody add_resource_member_request_body: A user to add as a member to the bucket. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceMember - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_buckets_id_members_prepare(bucket_id, add_resource_member_request_body, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/buckets/{bucketID}/members', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceMember', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_buckets_id_members_prepare(self, bucket_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['bucket_id', 'add_resource_member_request_body', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('post_buckets_id_members', all_params, local_var_params) - # verify the required parameter 'bucket_id' is set - if ('bucket_id' not in local_var_params or - local_var_params['bucket_id'] is None): - raise ValueError("Missing the required parameter `bucket_id` when calling `post_buckets_id_members`") # noqa: E501 - # verify the required parameter 'add_resource_member_request_body' is set - if ('add_resource_member_request_body' not in local_var_params or - local_var_params['add_resource_member_request_body'] is None): - raise ValueError("Missing the required parameter `add_resource_member_request_body` when calling `post_buckets_id_members`") # noqa: E501 - - path_params = {} - if 'bucket_id' in local_var_params: - path_params['bucketID'] = local_var_params['bucket_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'add_resource_member_request_body' in local_var_params: - body_params = local_var_params['add_resource_member_request_body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_buckets_id_owners(self, bucket_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - """Add an owner to a bucket. - - Adds an owner to a bucket and returns the [owners](https://docs.influxdata.com/influxdb/latest/reference/glossary/#owner) with role and user detail. Use this endpoint to create a _resource owner_ for the bucket. Bucket owners have permission to delete buckets and remove user and member permissions from the bucket. #### InfluxDB Cloud - Doesn't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. #### Limitations - Owner permissions are separate from API token permissions. - Owner permissions are used in the context of the InfluxDB UI. #### Required permissions - `write-orgs INFLUX_ORG_ID` *`INFLUX_ORG_ID`* is the ID of the organization that you want to add an owner for. #### Related endpoints - [Authorizations](#tag/Authorizations-(API-tokens)) #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/users/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_buckets_id_owners(bucket_id, add_resource_member_request_body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str bucket_id: The ID of the bucket to add an owner for. (required) - :param AddResourceMemberRequestBody add_resource_member_request_body: A user to add as an owner for the bucket. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceOwner - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_buckets_id_owners_with_http_info(bucket_id, add_resource_member_request_body, **kwargs) # noqa: E501 - else: - (data) = self.post_buckets_id_owners_with_http_info(bucket_id, add_resource_member_request_body, **kwargs) # noqa: E501 - return data - - def post_buckets_id_owners_with_http_info(self, bucket_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - """Add an owner to a bucket. - - Adds an owner to a bucket and returns the [owners](https://docs.influxdata.com/influxdb/latest/reference/glossary/#owner) with role and user detail. Use this endpoint to create a _resource owner_ for the bucket. Bucket owners have permission to delete buckets and remove user and member permissions from the bucket. #### InfluxDB Cloud - Doesn't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. #### Limitations - Owner permissions are separate from API token permissions. - Owner permissions are used in the context of the InfluxDB UI. #### Required permissions - `write-orgs INFLUX_ORG_ID` *`INFLUX_ORG_ID`* is the ID of the organization that you want to add an owner for. #### Related endpoints - [Authorizations](#tag/Authorizations-(API-tokens)) #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/users/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_buckets_id_owners_with_http_info(bucket_id, add_resource_member_request_body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str bucket_id: The ID of the bucket to add an owner for. (required) - :param AddResourceMemberRequestBody add_resource_member_request_body: A user to add as an owner for the bucket. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceOwner - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_buckets_id_owners_prepare(bucket_id, add_resource_member_request_body, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/buckets/{bucketID}/owners', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceOwner', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_buckets_id_owners_async(self, bucket_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - """Add an owner to a bucket. - - Adds an owner to a bucket and returns the [owners](https://docs.influxdata.com/influxdb/latest/reference/glossary/#owner) with role and user detail. Use this endpoint to create a _resource owner_ for the bucket. Bucket owners have permission to delete buckets and remove user and member permissions from the bucket. #### InfluxDB Cloud - Doesn't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. #### Limitations - Owner permissions are separate from API token permissions. - Owner permissions are used in the context of the InfluxDB UI. #### Required permissions - `write-orgs INFLUX_ORG_ID` *`INFLUX_ORG_ID`* is the ID of the organization that you want to add an owner for. #### Related endpoints - [Authorizations](#tag/Authorizations-(API-tokens)) #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/users/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str bucket_id: The ID of the bucket to add an owner for. (required) - :param AddResourceMemberRequestBody add_resource_member_request_body: A user to add as an owner for the bucket. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceOwner - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_buckets_id_owners_prepare(bucket_id, add_resource_member_request_body, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/buckets/{bucketID}/owners', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceOwner', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_buckets_id_owners_prepare(self, bucket_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['bucket_id', 'add_resource_member_request_body', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('post_buckets_id_owners', all_params, local_var_params) - # verify the required parameter 'bucket_id' is set - if ('bucket_id' not in local_var_params or - local_var_params['bucket_id'] is None): - raise ValueError("Missing the required parameter `bucket_id` when calling `post_buckets_id_owners`") # noqa: E501 - # verify the required parameter 'add_resource_member_request_body' is set - if ('add_resource_member_request_body' not in local_var_params or - local_var_params['add_resource_member_request_body'] is None): - raise ValueError("Missing the required parameter `add_resource_member_request_body` when calling `post_buckets_id_owners`") # noqa: E501 - - path_params = {} - if 'bucket_id' in local_var_params: - path_params['bucketID'] = local_var_params['bucket_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'add_resource_member_request_body' in local_var_params: - body_params = local_var_params['add_resource_member_request_body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params diff --git a/frogpilot/third_party/influxdb_client/service/cells_service.py b/frogpilot/third_party/influxdb_client/service/cells_service.py deleted file mode 100644 index 13c811b5..00000000 --- a/frogpilot/third_party/influxdb_client/service/cells_service.py +++ /dev/null @@ -1,820 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -from influxdb_client.service._base_service import _BaseService - - -class CellsService(_BaseService): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): # noqa: E501,D401,D403 - """CellsService - a operation defined in OpenAPI.""" - super().__init__(api_client) - - def delete_dashboards_id_cells_id(self, dashboard_id, cell_id, **kwargs): # noqa: E501,D401,D403 - """Delete a dashboard cell. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_dashboards_id_cells_id(dashboard_id, cell_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The ID of the dashboard to delete. (required) - :param str cell_id: The ID of the cell to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_dashboards_id_cells_id_with_http_info(dashboard_id, cell_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_dashboards_id_cells_id_with_http_info(dashboard_id, cell_id, **kwargs) # noqa: E501 - return data - - def delete_dashboards_id_cells_id_with_http_info(self, dashboard_id, cell_id, **kwargs): # noqa: E501,D401,D403 - """Delete a dashboard cell. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_dashboards_id_cells_id_with_http_info(dashboard_id, cell_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The ID of the dashboard to delete. (required) - :param str cell_id: The ID of the cell to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_dashboards_id_cells_id_prepare(dashboard_id, cell_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}/cells/{cellID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def delete_dashboards_id_cells_id_async(self, dashboard_id, cell_id, **kwargs): # noqa: E501,D401,D403 - """Delete a dashboard cell. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str dashboard_id: The ID of the dashboard to delete. (required) - :param str cell_id: The ID of the cell to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_dashboards_id_cells_id_prepare(dashboard_id, cell_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}/cells/{cellID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _delete_dashboards_id_cells_id_prepare(self, dashboard_id, cell_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['dashboard_id', 'cell_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('delete_dashboards_id_cells_id', all_params, local_var_params) - # verify the required parameter 'dashboard_id' is set - if ('dashboard_id' not in local_var_params or - local_var_params['dashboard_id'] is None): - raise ValueError("Missing the required parameter `dashboard_id` when calling `delete_dashboards_id_cells_id`") # noqa: E501 - # verify the required parameter 'cell_id' is set - if ('cell_id' not in local_var_params or - local_var_params['cell_id'] is None): - raise ValueError("Missing the required parameter `cell_id` when calling `delete_dashboards_id_cells_id`") # noqa: E501 - - path_params = {} - if 'dashboard_id' in local_var_params: - path_params['dashboardID'] = local_var_params['dashboard_id'] # noqa: E501 - if 'cell_id' in local_var_params: - path_params['cellID'] = local_var_params['cell_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_dashboards_id_cells_id_view(self, dashboard_id, cell_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve the view for a cell. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_dashboards_id_cells_id_view(dashboard_id, cell_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The dashboard ID. (required) - :param str cell_id: The cell ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: View - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_dashboards_id_cells_id_view_with_http_info(dashboard_id, cell_id, **kwargs) # noqa: E501 - else: - (data) = self.get_dashboards_id_cells_id_view_with_http_info(dashboard_id, cell_id, **kwargs) # noqa: E501 - return data - - def get_dashboards_id_cells_id_view_with_http_info(self, dashboard_id, cell_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve the view for a cell. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_dashboards_id_cells_id_view_with_http_info(dashboard_id, cell_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The dashboard ID. (required) - :param str cell_id: The cell ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: View - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_dashboards_id_cells_id_view_prepare(dashboard_id, cell_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}/cells/{cellID}/view', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='View', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_dashboards_id_cells_id_view_async(self, dashboard_id, cell_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve the view for a cell. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str dashboard_id: The dashboard ID. (required) - :param str cell_id: The cell ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: View - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_dashboards_id_cells_id_view_prepare(dashboard_id, cell_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}/cells/{cellID}/view', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='View', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_dashboards_id_cells_id_view_prepare(self, dashboard_id, cell_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['dashboard_id', 'cell_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_dashboards_id_cells_id_view', all_params, local_var_params) - # verify the required parameter 'dashboard_id' is set - if ('dashboard_id' not in local_var_params or - local_var_params['dashboard_id'] is None): - raise ValueError("Missing the required parameter `dashboard_id` when calling `get_dashboards_id_cells_id_view`") # noqa: E501 - # verify the required parameter 'cell_id' is set - if ('cell_id' not in local_var_params or - local_var_params['cell_id'] is None): - raise ValueError("Missing the required parameter `cell_id` when calling `get_dashboards_id_cells_id_view`") # noqa: E501 - - path_params = {} - if 'dashboard_id' in local_var_params: - path_params['dashboardID'] = local_var_params['dashboard_id'] # noqa: E501 - if 'cell_id' in local_var_params: - path_params['cellID'] = local_var_params['cell_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def patch_dashboards_id_cells_id(self, dashboard_id, cell_id, cell_update, **kwargs): # noqa: E501,D401,D403 - """Update the non-positional information related to a cell. - - Updates the non positional information related to a cell. Updates to a single cell's positional data could cause grid conflicts. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_dashboards_id_cells_id(dashboard_id, cell_id, cell_update, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The ID of the dashboard to update. (required) - :param str cell_id: The ID of the cell to update. (required) - :param CellUpdate cell_update: (required) - :param str zap_trace_span: OpenTracing span context - :return: Cell - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.patch_dashboards_id_cells_id_with_http_info(dashboard_id, cell_id, cell_update, **kwargs) # noqa: E501 - else: - (data) = self.patch_dashboards_id_cells_id_with_http_info(dashboard_id, cell_id, cell_update, **kwargs) # noqa: E501 - return data - - def patch_dashboards_id_cells_id_with_http_info(self, dashboard_id, cell_id, cell_update, **kwargs): # noqa: E501,D401,D403 - """Update the non-positional information related to a cell. - - Updates the non positional information related to a cell. Updates to a single cell's positional data could cause grid conflicts. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_dashboards_id_cells_id_with_http_info(dashboard_id, cell_id, cell_update, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The ID of the dashboard to update. (required) - :param str cell_id: The ID of the cell to update. (required) - :param CellUpdate cell_update: (required) - :param str zap_trace_span: OpenTracing span context - :return: Cell - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_dashboards_id_cells_id_prepare(dashboard_id, cell_id, cell_update, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}/cells/{cellID}', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Cell', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def patch_dashboards_id_cells_id_async(self, dashboard_id, cell_id, cell_update, **kwargs): # noqa: E501,D401,D403 - """Update the non-positional information related to a cell. - - Updates the non positional information related to a cell. Updates to a single cell's positional data could cause grid conflicts. - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str dashboard_id: The ID of the dashboard to update. (required) - :param str cell_id: The ID of the cell to update. (required) - :param CellUpdate cell_update: (required) - :param str zap_trace_span: OpenTracing span context - :return: Cell - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_dashboards_id_cells_id_prepare(dashboard_id, cell_id, cell_update, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}/cells/{cellID}', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Cell', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _patch_dashboards_id_cells_id_prepare(self, dashboard_id, cell_id, cell_update, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['dashboard_id', 'cell_id', 'cell_update', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('patch_dashboards_id_cells_id', all_params, local_var_params) - # verify the required parameter 'dashboard_id' is set - if ('dashboard_id' not in local_var_params or - local_var_params['dashboard_id'] is None): - raise ValueError("Missing the required parameter `dashboard_id` when calling `patch_dashboards_id_cells_id`") # noqa: E501 - # verify the required parameter 'cell_id' is set - if ('cell_id' not in local_var_params or - local_var_params['cell_id'] is None): - raise ValueError("Missing the required parameter `cell_id` when calling `patch_dashboards_id_cells_id`") # noqa: E501 - # verify the required parameter 'cell_update' is set - if ('cell_update' not in local_var_params or - local_var_params['cell_update'] is None): - raise ValueError("Missing the required parameter `cell_update` when calling `patch_dashboards_id_cells_id`") # noqa: E501 - - path_params = {} - if 'dashboard_id' in local_var_params: - path_params['dashboardID'] = local_var_params['dashboard_id'] # noqa: E501 - if 'cell_id' in local_var_params: - path_params['cellID'] = local_var_params['cell_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'cell_update' in local_var_params: - body_params = local_var_params['cell_update'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def patch_dashboards_id_cells_id_view(self, dashboard_id, cell_id, view, **kwargs): # noqa: E501,D401,D403 - """Update the view for a cell. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_dashboards_id_cells_id_view(dashboard_id, cell_id, view, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The ID of the dashboard to update. (required) - :param str cell_id: The ID of the cell to update. (required) - :param View view: (required) - :param str zap_trace_span: OpenTracing span context - :return: View - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.patch_dashboards_id_cells_id_view_with_http_info(dashboard_id, cell_id, view, **kwargs) # noqa: E501 - else: - (data) = self.patch_dashboards_id_cells_id_view_with_http_info(dashboard_id, cell_id, view, **kwargs) # noqa: E501 - return data - - def patch_dashboards_id_cells_id_view_with_http_info(self, dashboard_id, cell_id, view, **kwargs): # noqa: E501,D401,D403 - """Update the view for a cell. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_dashboards_id_cells_id_view_with_http_info(dashboard_id, cell_id, view, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The ID of the dashboard to update. (required) - :param str cell_id: The ID of the cell to update. (required) - :param View view: (required) - :param str zap_trace_span: OpenTracing span context - :return: View - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_dashboards_id_cells_id_view_prepare(dashboard_id, cell_id, view, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}/cells/{cellID}/view', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='View', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def patch_dashboards_id_cells_id_view_async(self, dashboard_id, cell_id, view, **kwargs): # noqa: E501,D401,D403 - """Update the view for a cell. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str dashboard_id: The ID of the dashboard to update. (required) - :param str cell_id: The ID of the cell to update. (required) - :param View view: (required) - :param str zap_trace_span: OpenTracing span context - :return: View - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_dashboards_id_cells_id_view_prepare(dashboard_id, cell_id, view, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}/cells/{cellID}/view', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='View', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _patch_dashboards_id_cells_id_view_prepare(self, dashboard_id, cell_id, view, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['dashboard_id', 'cell_id', 'view', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('patch_dashboards_id_cells_id_view', all_params, local_var_params) - # verify the required parameter 'dashboard_id' is set - if ('dashboard_id' not in local_var_params or - local_var_params['dashboard_id'] is None): - raise ValueError("Missing the required parameter `dashboard_id` when calling `patch_dashboards_id_cells_id_view`") # noqa: E501 - # verify the required parameter 'cell_id' is set - if ('cell_id' not in local_var_params or - local_var_params['cell_id'] is None): - raise ValueError("Missing the required parameter `cell_id` when calling `patch_dashboards_id_cells_id_view`") # noqa: E501 - # verify the required parameter 'view' is set - if ('view' not in local_var_params or - local_var_params['view'] is None): - raise ValueError("Missing the required parameter `view` when calling `patch_dashboards_id_cells_id_view`") # noqa: E501 - - path_params = {} - if 'dashboard_id' in local_var_params: - path_params['dashboardID'] = local_var_params['dashboard_id'] # noqa: E501 - if 'cell_id' in local_var_params: - path_params['cellID'] = local_var_params['cell_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'view' in local_var_params: - body_params = local_var_params['view'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_dashboards_id_cells(self, dashboard_id, create_cell, **kwargs): # noqa: E501,D401,D403 - """Create a dashboard cell. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_dashboards_id_cells(dashboard_id, create_cell, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The ID of the dashboard to update. (required) - :param CreateCell create_cell: Cell that will be added (required) - :param str zap_trace_span: OpenTracing span context - :return: Cell - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_dashboards_id_cells_with_http_info(dashboard_id, create_cell, **kwargs) # noqa: E501 - else: - (data) = self.post_dashboards_id_cells_with_http_info(dashboard_id, create_cell, **kwargs) # noqa: E501 - return data - - def post_dashboards_id_cells_with_http_info(self, dashboard_id, create_cell, **kwargs): # noqa: E501,D401,D403 - """Create a dashboard cell. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_dashboards_id_cells_with_http_info(dashboard_id, create_cell, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The ID of the dashboard to update. (required) - :param CreateCell create_cell: Cell that will be added (required) - :param str zap_trace_span: OpenTracing span context - :return: Cell - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_dashboards_id_cells_prepare(dashboard_id, create_cell, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}/cells', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Cell', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_dashboards_id_cells_async(self, dashboard_id, create_cell, **kwargs): # noqa: E501,D401,D403 - """Create a dashboard cell. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str dashboard_id: The ID of the dashboard to update. (required) - :param CreateCell create_cell: Cell that will be added (required) - :param str zap_trace_span: OpenTracing span context - :return: Cell - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_dashboards_id_cells_prepare(dashboard_id, create_cell, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}/cells', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Cell', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_dashboards_id_cells_prepare(self, dashboard_id, create_cell, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['dashboard_id', 'create_cell', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('post_dashboards_id_cells', all_params, local_var_params) - # verify the required parameter 'dashboard_id' is set - if ('dashboard_id' not in local_var_params or - local_var_params['dashboard_id'] is None): - raise ValueError("Missing the required parameter `dashboard_id` when calling `post_dashboards_id_cells`") # noqa: E501 - # verify the required parameter 'create_cell' is set - if ('create_cell' not in local_var_params or - local_var_params['create_cell'] is None): - raise ValueError("Missing the required parameter `create_cell` when calling `post_dashboards_id_cells`") # noqa: E501 - - path_params = {} - if 'dashboard_id' in local_var_params: - path_params['dashboardID'] = local_var_params['dashboard_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'create_cell' in local_var_params: - body_params = local_var_params['create_cell'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def put_dashboards_id_cells(self, dashboard_id, cell, **kwargs): # noqa: E501,D401,D403 - """Replace cells in a dashboard. - - Replaces all cells in a dashboard. This is used primarily to update the positional information of all cells. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.put_dashboards_id_cells(dashboard_id, cell, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The ID of the dashboard to update. (required) - :param list[Cell] cell: (required) - :param str zap_trace_span: OpenTracing span context - :return: Dashboard - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.put_dashboards_id_cells_with_http_info(dashboard_id, cell, **kwargs) # noqa: E501 - else: - (data) = self.put_dashboards_id_cells_with_http_info(dashboard_id, cell, **kwargs) # noqa: E501 - return data - - def put_dashboards_id_cells_with_http_info(self, dashboard_id, cell, **kwargs): # noqa: E501,D401,D403 - """Replace cells in a dashboard. - - Replaces all cells in a dashboard. This is used primarily to update the positional information of all cells. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.put_dashboards_id_cells_with_http_info(dashboard_id, cell, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The ID of the dashboard to update. (required) - :param list[Cell] cell: (required) - :param str zap_trace_span: OpenTracing span context - :return: Dashboard - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._put_dashboards_id_cells_prepare(dashboard_id, cell, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}/cells', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Dashboard', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def put_dashboards_id_cells_async(self, dashboard_id, cell, **kwargs): # noqa: E501,D401,D403 - """Replace cells in a dashboard. - - Replaces all cells in a dashboard. This is used primarily to update the positional information of all cells. - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str dashboard_id: The ID of the dashboard to update. (required) - :param list[Cell] cell: (required) - :param str zap_trace_span: OpenTracing span context - :return: Dashboard - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._put_dashboards_id_cells_prepare(dashboard_id, cell, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}/cells', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Dashboard', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _put_dashboards_id_cells_prepare(self, dashboard_id, cell, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['dashboard_id', 'cell', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('put_dashboards_id_cells', all_params, local_var_params) - # verify the required parameter 'dashboard_id' is set - if ('dashboard_id' not in local_var_params or - local_var_params['dashboard_id'] is None): - raise ValueError("Missing the required parameter `dashboard_id` when calling `put_dashboards_id_cells`") # noqa: E501 - # verify the required parameter 'cell' is set - if ('cell' not in local_var_params or - local_var_params['cell'] is None): - raise ValueError("Missing the required parameter `cell` when calling `put_dashboards_id_cells`") # noqa: E501 - - path_params = {} - if 'dashboard_id' in local_var_params: - path_params['dashboardID'] = local_var_params['dashboard_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'cell' in local_var_params: - body_params = local_var_params['cell'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params diff --git a/frogpilot/third_party/influxdb_client/service/checks_service.py b/frogpilot/third_party/influxdb_client/service/checks_service.py deleted file mode 100644 index 2c780f35..00000000 --- a/frogpilot/third_party/influxdb_client/service/checks_service.py +++ /dev/null @@ -1,1253 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -from influxdb_client.service._base_service import _BaseService - - -class ChecksService(_BaseService): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): # noqa: E501,D401,D403 - """ChecksService - a operation defined in OpenAPI.""" - super().__init__(api_client) - - def create_check(self, post_check, **kwargs): # noqa: E501,D401,D403 - """Add new check. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_check(post_check, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param PostCheck post_check: Check to create (required) - :return: Check - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_check_with_http_info(post_check, **kwargs) # noqa: E501 - else: - (data) = self.create_check_with_http_info(post_check, **kwargs) # noqa: E501 - return data - - def create_check_with_http_info(self, post_check, **kwargs): # noqa: E501,D401,D403 - """Add new check. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_check_with_http_info(post_check, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param PostCheck post_check: Check to create (required) - :return: Check - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._create_check_prepare(post_check, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/checks', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Check', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def create_check_async(self, post_check, **kwargs): # noqa: E501,D401,D403 - """Add new check. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param PostCheck post_check: Check to create (required) - :return: Check - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._create_check_prepare(post_check, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/checks', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Check', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _create_check_prepare(self, post_check, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['post_check'] # noqa: E501 - self._check_operation_params('create_check', all_params, local_var_params) - # verify the required parameter 'post_check' is set - if ('post_check' not in local_var_params or - local_var_params['post_check'] is None): - raise ValueError("Missing the required parameter `post_check` when calling `create_check`") # noqa: E501 - - path_params = {} - - query_params = [] - - header_params = {} - - body_params = None - if 'post_check' in local_var_params: - body_params = local_var_params['post_check'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def delete_checks_id(self, check_id, **kwargs): # noqa: E501,D401,D403 - """Delete a check. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_checks_id(check_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str check_id: The check ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_checks_id_with_http_info(check_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_checks_id_with_http_info(check_id, **kwargs) # noqa: E501 - return data - - def delete_checks_id_with_http_info(self, check_id, **kwargs): # noqa: E501,D401,D403 - """Delete a check. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_checks_id_with_http_info(check_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str check_id: The check ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_checks_id_prepare(check_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/checks/{checkID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def delete_checks_id_async(self, check_id, **kwargs): # noqa: E501,D401,D403 - """Delete a check. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str check_id: The check ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_checks_id_prepare(check_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/checks/{checkID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _delete_checks_id_prepare(self, check_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['check_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('delete_checks_id', all_params, local_var_params) - # verify the required parameter 'check_id' is set - if ('check_id' not in local_var_params or - local_var_params['check_id'] is None): - raise ValueError("Missing the required parameter `check_id` when calling `delete_checks_id`") # noqa: E501 - - path_params = {} - if 'check_id' in local_var_params: - path_params['checkID'] = local_var_params['check_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def delete_checks_id_labels_id(self, check_id, label_id, **kwargs): # noqa: E501,D401,D403 - """Delete label from a check. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_checks_id_labels_id(check_id, label_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str check_id: The check ID. (required) - :param str label_id: The ID of the label to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_checks_id_labels_id_with_http_info(check_id, label_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_checks_id_labels_id_with_http_info(check_id, label_id, **kwargs) # noqa: E501 - return data - - def delete_checks_id_labels_id_with_http_info(self, check_id, label_id, **kwargs): # noqa: E501,D401,D403 - """Delete label from a check. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_checks_id_labels_id_with_http_info(check_id, label_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str check_id: The check ID. (required) - :param str label_id: The ID of the label to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_checks_id_labels_id_prepare(check_id, label_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/checks/{checkID}/labels/{labelID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def delete_checks_id_labels_id_async(self, check_id, label_id, **kwargs): # noqa: E501,D401,D403 - """Delete label from a check. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str check_id: The check ID. (required) - :param str label_id: The ID of the label to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_checks_id_labels_id_prepare(check_id, label_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/checks/{checkID}/labels/{labelID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _delete_checks_id_labels_id_prepare(self, check_id, label_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['check_id', 'label_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('delete_checks_id_labels_id', all_params, local_var_params) - # verify the required parameter 'check_id' is set - if ('check_id' not in local_var_params or - local_var_params['check_id'] is None): - raise ValueError("Missing the required parameter `check_id` when calling `delete_checks_id_labels_id`") # noqa: E501 - # verify the required parameter 'label_id' is set - if ('label_id' not in local_var_params or - local_var_params['label_id'] is None): - raise ValueError("Missing the required parameter `label_id` when calling `delete_checks_id_labels_id`") # noqa: E501 - - path_params = {} - if 'check_id' in local_var_params: - path_params['checkID'] = local_var_params['check_id'] # noqa: E501 - if 'label_id' in local_var_params: - path_params['labelID'] = local_var_params['label_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_checks(self, org_id, **kwargs): # noqa: E501,D401,D403 - """List all checks. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_checks(org_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str org_id: Only show checks that belong to a specific organization ID. (required) - :param str zap_trace_span: OpenTracing span context - :param int offset: The offset for pagination. The number of records to skip. For more information about pagination parameters, see [Pagination](https://docs.influxdata.com/influxdb/latest/api/#tag/Pagination). - :param int limit: Limits the number of records returned. Default is `20`. - :return: Checks - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_checks_with_http_info(org_id, **kwargs) # noqa: E501 - else: - (data) = self.get_checks_with_http_info(org_id, **kwargs) # noqa: E501 - return data - - def get_checks_with_http_info(self, org_id, **kwargs): # noqa: E501,D401,D403 - """List all checks. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_checks_with_http_info(org_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str org_id: Only show checks that belong to a specific organization ID. (required) - :param str zap_trace_span: OpenTracing span context - :param int offset: The offset for pagination. The number of records to skip. For more information about pagination parameters, see [Pagination](https://docs.influxdata.com/influxdb/latest/api/#tag/Pagination). - :param int limit: Limits the number of records returned. Default is `20`. - :return: Checks - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_checks_prepare(org_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/checks', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Checks', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_checks_async(self, org_id, **kwargs): # noqa: E501,D401,D403 - """List all checks. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str org_id: Only show checks that belong to a specific organization ID. (required) - :param str zap_trace_span: OpenTracing span context - :param int offset: The offset for pagination. The number of records to skip. For more information about pagination parameters, see [Pagination](https://docs.influxdata.com/influxdb/latest/api/#tag/Pagination). - :param int limit: Limits the number of records returned. Default is `20`. - :return: Checks - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_checks_prepare(org_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/checks', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Checks', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_checks_prepare(self, org_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['org_id', 'zap_trace_span', 'offset', 'limit'] # noqa: E501 - self._check_operation_params('get_checks', all_params, local_var_params) - # verify the required parameter 'org_id' is set - if ('org_id' not in local_var_params or - local_var_params['org_id'] is None): - raise ValueError("Missing the required parameter `org_id` when calling `get_checks`") # noqa: E501 - - if 'offset' in local_var_params and local_var_params['offset'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `offset` when calling `get_checks`, must be a value greater than or equal to `0`") # noqa: E501 - if 'limit' in local_var_params and local_var_params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `get_checks`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `get_checks`, must be a value greater than or equal to `1`") # noqa: E501 - path_params = {} - - query_params = [] - if 'offset' in local_var_params: - query_params.append(('offset', local_var_params['offset'])) # noqa: E501 - if 'limit' in local_var_params: - query_params.append(('limit', local_var_params['limit'])) # noqa: E501 - if 'org_id' in local_var_params: - query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501 - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_checks_id(self, check_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a check. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_checks_id(check_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str check_id: The check ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: Check - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_checks_id_with_http_info(check_id, **kwargs) # noqa: E501 - else: - (data) = self.get_checks_id_with_http_info(check_id, **kwargs) # noqa: E501 - return data - - def get_checks_id_with_http_info(self, check_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a check. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_checks_id_with_http_info(check_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str check_id: The check ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: Check - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_checks_id_prepare(check_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/checks/{checkID}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Check', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_checks_id_async(self, check_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a check. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str check_id: The check ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: Check - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_checks_id_prepare(check_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/checks/{checkID}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Check', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_checks_id_prepare(self, check_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['check_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_checks_id', all_params, local_var_params) - # verify the required parameter 'check_id' is set - if ('check_id' not in local_var_params or - local_var_params['check_id'] is None): - raise ValueError("Missing the required parameter `check_id` when calling `get_checks_id`") # noqa: E501 - - path_params = {} - if 'check_id' in local_var_params: - path_params['checkID'] = local_var_params['check_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_checks_id_labels(self, check_id, **kwargs): # noqa: E501,D401,D403 - """List all labels for a check. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_checks_id_labels(check_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str check_id: The check ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelsResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_checks_id_labels_with_http_info(check_id, **kwargs) # noqa: E501 - else: - (data) = self.get_checks_id_labels_with_http_info(check_id, **kwargs) # noqa: E501 - return data - - def get_checks_id_labels_with_http_info(self, check_id, **kwargs): # noqa: E501,D401,D403 - """List all labels for a check. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_checks_id_labels_with_http_info(check_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str check_id: The check ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelsResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_checks_id_labels_prepare(check_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/checks/{checkID}/labels', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='LabelsResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_checks_id_labels_async(self, check_id, **kwargs): # noqa: E501,D401,D403 - """List all labels for a check. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str check_id: The check ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelsResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_checks_id_labels_prepare(check_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/checks/{checkID}/labels', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='LabelsResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_checks_id_labels_prepare(self, check_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['check_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_checks_id_labels', all_params, local_var_params) - # verify the required parameter 'check_id' is set - if ('check_id' not in local_var_params or - local_var_params['check_id'] is None): - raise ValueError("Missing the required parameter `check_id` when calling `get_checks_id_labels`") # noqa: E501 - - path_params = {} - if 'check_id' in local_var_params: - path_params['checkID'] = local_var_params['check_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_checks_id_query(self, check_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a check query. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_checks_id_query(check_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str check_id: The check ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: FluxResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_checks_id_query_with_http_info(check_id, **kwargs) # noqa: E501 - else: - (data) = self.get_checks_id_query_with_http_info(check_id, **kwargs) # noqa: E501 - return data - - def get_checks_id_query_with_http_info(self, check_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a check query. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_checks_id_query_with_http_info(check_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str check_id: The check ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: FluxResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_checks_id_query_prepare(check_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/checks/{checkID}/query', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='FluxResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_checks_id_query_async(self, check_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a check query. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str check_id: The check ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: FluxResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_checks_id_query_prepare(check_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/checks/{checkID}/query', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='FluxResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_checks_id_query_prepare(self, check_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['check_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_checks_id_query', all_params, local_var_params) - # verify the required parameter 'check_id' is set - if ('check_id' not in local_var_params or - local_var_params['check_id'] is None): - raise ValueError("Missing the required parameter `check_id` when calling `get_checks_id_query`") # noqa: E501 - - path_params = {} - if 'check_id' in local_var_params: - path_params['checkID'] = local_var_params['check_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def patch_checks_id(self, check_id, check_patch, **kwargs): # noqa: E501,D401,D403 - """Update a check. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_checks_id(check_id, check_patch, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str check_id: The check ID. (required) - :param CheckPatch check_patch: Check update to apply (required) - :param str zap_trace_span: OpenTracing span context - :return: Check - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.patch_checks_id_with_http_info(check_id, check_patch, **kwargs) # noqa: E501 - else: - (data) = self.patch_checks_id_with_http_info(check_id, check_patch, **kwargs) # noqa: E501 - return data - - def patch_checks_id_with_http_info(self, check_id, check_patch, **kwargs): # noqa: E501,D401,D403 - """Update a check. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_checks_id_with_http_info(check_id, check_patch, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str check_id: The check ID. (required) - :param CheckPatch check_patch: Check update to apply (required) - :param str zap_trace_span: OpenTracing span context - :return: Check - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_checks_id_prepare(check_id, check_patch, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/checks/{checkID}', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Check', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def patch_checks_id_async(self, check_id, check_patch, **kwargs): # noqa: E501,D401,D403 - """Update a check. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str check_id: The check ID. (required) - :param CheckPatch check_patch: Check update to apply (required) - :param str zap_trace_span: OpenTracing span context - :return: Check - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_checks_id_prepare(check_id, check_patch, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/checks/{checkID}', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Check', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _patch_checks_id_prepare(self, check_id, check_patch, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['check_id', 'check_patch', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('patch_checks_id', all_params, local_var_params) - # verify the required parameter 'check_id' is set - if ('check_id' not in local_var_params or - local_var_params['check_id'] is None): - raise ValueError("Missing the required parameter `check_id` when calling `patch_checks_id`") # noqa: E501 - # verify the required parameter 'check_patch' is set - if ('check_patch' not in local_var_params or - local_var_params['check_patch'] is None): - raise ValueError("Missing the required parameter `check_patch` when calling `patch_checks_id`") # noqa: E501 - - path_params = {} - if 'check_id' in local_var_params: - path_params['checkID'] = local_var_params['check_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'check_patch' in local_var_params: - body_params = local_var_params['check_patch'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_checks_id_labels(self, check_id, label_mapping, **kwargs): # noqa: E501,D401,D403 - """Add a label to a check. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_checks_id_labels(check_id, label_mapping, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str check_id: The check ID. (required) - :param LabelMapping label_mapping: Label to add (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_checks_id_labels_with_http_info(check_id, label_mapping, **kwargs) # noqa: E501 - else: - (data) = self.post_checks_id_labels_with_http_info(check_id, label_mapping, **kwargs) # noqa: E501 - return data - - def post_checks_id_labels_with_http_info(self, check_id, label_mapping, **kwargs): # noqa: E501,D401,D403 - """Add a label to a check. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_checks_id_labels_with_http_info(check_id, label_mapping, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str check_id: The check ID. (required) - :param LabelMapping label_mapping: Label to add (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_checks_id_labels_prepare(check_id, label_mapping, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/checks/{checkID}/labels', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='LabelResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_checks_id_labels_async(self, check_id, label_mapping, **kwargs): # noqa: E501,D401,D403 - """Add a label to a check. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str check_id: The check ID. (required) - :param LabelMapping label_mapping: Label to add (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_checks_id_labels_prepare(check_id, label_mapping, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/checks/{checkID}/labels', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='LabelResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_checks_id_labels_prepare(self, check_id, label_mapping, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['check_id', 'label_mapping', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('post_checks_id_labels', all_params, local_var_params) - # verify the required parameter 'check_id' is set - if ('check_id' not in local_var_params or - local_var_params['check_id'] is None): - raise ValueError("Missing the required parameter `check_id` when calling `post_checks_id_labels`") # noqa: E501 - # verify the required parameter 'label_mapping' is set - if ('label_mapping' not in local_var_params or - local_var_params['label_mapping'] is None): - raise ValueError("Missing the required parameter `label_mapping` when calling `post_checks_id_labels`") # noqa: E501 - - path_params = {} - if 'check_id' in local_var_params: - path_params['checkID'] = local_var_params['check_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'label_mapping' in local_var_params: - body_params = local_var_params['label_mapping'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def put_checks_id(self, check_id, check, **kwargs): # noqa: E501,D401,D403 - """Update a check. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.put_checks_id(check_id, check, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str check_id: The check ID. (required) - :param Check check: Check update to apply (required) - :param str zap_trace_span: OpenTracing span context - :return: Check - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.put_checks_id_with_http_info(check_id, check, **kwargs) # noqa: E501 - else: - (data) = self.put_checks_id_with_http_info(check_id, check, **kwargs) # noqa: E501 - return data - - def put_checks_id_with_http_info(self, check_id, check, **kwargs): # noqa: E501,D401,D403 - """Update a check. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.put_checks_id_with_http_info(check_id, check, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str check_id: The check ID. (required) - :param Check check: Check update to apply (required) - :param str zap_trace_span: OpenTracing span context - :return: Check - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._put_checks_id_prepare(check_id, check, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/checks/{checkID}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Check', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def put_checks_id_async(self, check_id, check, **kwargs): # noqa: E501,D401,D403 - """Update a check. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str check_id: The check ID. (required) - :param Check check: Check update to apply (required) - :param str zap_trace_span: OpenTracing span context - :return: Check - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._put_checks_id_prepare(check_id, check, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/checks/{checkID}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Check', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _put_checks_id_prepare(self, check_id, check, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['check_id', 'check', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('put_checks_id', all_params, local_var_params) - # verify the required parameter 'check_id' is set - if ('check_id' not in local_var_params or - local_var_params['check_id'] is None): - raise ValueError("Missing the required parameter `check_id` when calling `put_checks_id`") # noqa: E501 - # verify the required parameter 'check' is set - if ('check' not in local_var_params or - local_var_params['check'] is None): - raise ValueError("Missing the required parameter `check` when calling `put_checks_id`") # noqa: E501 - - path_params = {} - if 'check_id' in local_var_params: - path_params['checkID'] = local_var_params['check_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'check' in local_var_params: - body_params = local_var_params['check'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params diff --git a/frogpilot/third_party/influxdb_client/service/config_service.py b/frogpilot/third_party/influxdb_client/service/config_service.py deleted file mode 100644 index 2dd85d67..00000000 --- a/frogpilot/third_party/influxdb_client/service/config_service.py +++ /dev/null @@ -1,250 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -from influxdb_client.service._base_service import _BaseService - - -class ConfigService(_BaseService): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): # noqa: E501,D401,D403 - """ConfigService - a operation defined in OpenAPI.""" - super().__init__(api_client) - - def get_config(self, **kwargs): # noqa: E501,D401,D403 - """Retrieve runtime configuration. - - Returns the active runtime configuration of the InfluxDB instance. In InfluxDB v2.2+, use this endpoint to view your active runtime configuration, including flags and environment variables. #### Related guides - [View your runtime server configuration](https://docs.influxdata.com/influxdb/latest/reference/config-options/#view-your-runtime-server-configuration) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_config(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :return: Config - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_config_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_config_with_http_info(**kwargs) # noqa: E501 - return data - - def get_config_with_http_info(self, **kwargs): # noqa: E501,D401,D403 - """Retrieve runtime configuration. - - Returns the active runtime configuration of the InfluxDB instance. In InfluxDB v2.2+, use this endpoint to view your active runtime configuration, including flags and environment variables. #### Related guides - [View your runtime server configuration](https://docs.influxdata.com/influxdb/latest/reference/config-options/#view-your-runtime-server-configuration) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_config_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :return: Config - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_config_prepare(**kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/config', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Config', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_config_async(self, **kwargs): # noqa: E501,D401,D403 - """Retrieve runtime configuration. - - Returns the active runtime configuration of the InfluxDB instance. In InfluxDB v2.2+, use this endpoint to view your active runtime configuration, including flags and environment variables. #### Related guides - [View your runtime server configuration](https://docs.influxdata.com/influxdb/latest/reference/config-options/#view-your-runtime-server-configuration) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :return: Config - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_config_prepare(**kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/config', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Config', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_config_prepare(self, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['zap_trace_span'] # noqa: E501 - self._check_operation_params('get_config', all_params, local_var_params) - - path_params = {} - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_flags(self, **kwargs): # noqa: E501,D401,D403 - """Retrieve feature flags. - - Retrieves the feature flag key-value pairs configured for the InfluxDB instance. _Feature flags_ are configuration options used to develop and test experimental InfluxDB features and are intended for internal use only. This endpoint represents the first step in the following three-step process to configure feature flags: 1. Use [token authentication](#section/Authentication/TokenAuthentication) or a [user session](#tag/Signin) with this endpoint to retrieve feature flags and their values. 2. Follow the instructions to [enable, disable, or override values for feature flags](https://docs.influxdata.com/influxdb/latest/reference/config-options/#feature-flags). 3. **Optional**: To confirm that your change is applied, do one of the following: - Send a request to this endpoint to retrieve the current feature flag values. - Send a request to the [`GET /api/v2/config` endpoint](#operation/GetConfig) to retrieve the current runtime server configuration. #### Related guides - [InfluxDB configuration options](https://docs.influxdata.com/influxdb/latest/reference/config-options/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_flags(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :return: dict(str, object) - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_flags_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_flags_with_http_info(**kwargs) # noqa: E501 - return data - - def get_flags_with_http_info(self, **kwargs): # noqa: E501,D401,D403 - """Retrieve feature flags. - - Retrieves the feature flag key-value pairs configured for the InfluxDB instance. _Feature flags_ are configuration options used to develop and test experimental InfluxDB features and are intended for internal use only. This endpoint represents the first step in the following three-step process to configure feature flags: 1. Use [token authentication](#section/Authentication/TokenAuthentication) or a [user session](#tag/Signin) with this endpoint to retrieve feature flags and their values. 2. Follow the instructions to [enable, disable, or override values for feature flags](https://docs.influxdata.com/influxdb/latest/reference/config-options/#feature-flags). 3. **Optional**: To confirm that your change is applied, do one of the following: - Send a request to this endpoint to retrieve the current feature flag values. - Send a request to the [`GET /api/v2/config` endpoint](#operation/GetConfig) to retrieve the current runtime server configuration. #### Related guides - [InfluxDB configuration options](https://docs.influxdata.com/influxdb/latest/reference/config-options/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_flags_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :return: dict(str, object) - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_flags_prepare(**kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/flags', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='dict(str, object)', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_flags_async(self, **kwargs): # noqa: E501,D401,D403 - """Retrieve feature flags. - - Retrieves the feature flag key-value pairs configured for the InfluxDB instance. _Feature flags_ are configuration options used to develop and test experimental InfluxDB features and are intended for internal use only. This endpoint represents the first step in the following three-step process to configure feature flags: 1. Use [token authentication](#section/Authentication/TokenAuthentication) or a [user session](#tag/Signin) with this endpoint to retrieve feature flags and their values. 2. Follow the instructions to [enable, disable, or override values for feature flags](https://docs.influxdata.com/influxdb/latest/reference/config-options/#feature-flags). 3. **Optional**: To confirm that your change is applied, do one of the following: - Send a request to this endpoint to retrieve the current feature flag values. - Send a request to the [`GET /api/v2/config` endpoint](#operation/GetConfig) to retrieve the current runtime server configuration. #### Related guides - [InfluxDB configuration options](https://docs.influxdata.com/influxdb/latest/reference/config-options/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :return: dict(str, object) - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_flags_prepare(**kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/flags', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='dict(str, object)', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_flags_prepare(self, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['zap_trace_span'] # noqa: E501 - self._check_operation_params('get_flags', all_params, local_var_params) - - path_params = {} - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params diff --git a/frogpilot/third_party/influxdb_client/service/dashboards_service.py b/frogpilot/third_party/influxdb_client/service/dashboards_service.py deleted file mode 100644 index 801c6c76..00000000 --- a/frogpilot/third_party/influxdb_client/service/dashboards_service.py +++ /dev/null @@ -1,2568 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -from influxdb_client.service._base_service import _BaseService - - -class DashboardsService(_BaseService): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): # noqa: E501,D401,D403 - """DashboardsService - a operation defined in OpenAPI.""" - super().__init__(api_client) - - def delete_dashboards_id(self, dashboard_id, **kwargs): # noqa: E501,D401,D403 - """Delete a dashboard. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_dashboards_id(dashboard_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The ID of the dashboard to update. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_dashboards_id_with_http_info(dashboard_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_dashboards_id_with_http_info(dashboard_id, **kwargs) # noqa: E501 - return data - - def delete_dashboards_id_with_http_info(self, dashboard_id, **kwargs): # noqa: E501,D401,D403 - """Delete a dashboard. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_dashboards_id_with_http_info(dashboard_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The ID of the dashboard to update. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_dashboards_id_prepare(dashboard_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def delete_dashboards_id_async(self, dashboard_id, **kwargs): # noqa: E501,D401,D403 - """Delete a dashboard. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str dashboard_id: The ID of the dashboard to update. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_dashboards_id_prepare(dashboard_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _delete_dashboards_id_prepare(self, dashboard_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['dashboard_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('delete_dashboards_id', all_params, local_var_params) - # verify the required parameter 'dashboard_id' is set - if ('dashboard_id' not in local_var_params or - local_var_params['dashboard_id'] is None): - raise ValueError("Missing the required parameter `dashboard_id` when calling `delete_dashboards_id`") # noqa: E501 - - path_params = {} - if 'dashboard_id' in local_var_params: - path_params['dashboardID'] = local_var_params['dashboard_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def delete_dashboards_id_cells_id(self, dashboard_id, cell_id, **kwargs): # noqa: E501,D401,D403 - """Delete a dashboard cell. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_dashboards_id_cells_id(dashboard_id, cell_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The ID of the dashboard to delete. (required) - :param str cell_id: The ID of the cell to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_dashboards_id_cells_id_with_http_info(dashboard_id, cell_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_dashboards_id_cells_id_with_http_info(dashboard_id, cell_id, **kwargs) # noqa: E501 - return data - - def delete_dashboards_id_cells_id_with_http_info(self, dashboard_id, cell_id, **kwargs): # noqa: E501,D401,D403 - """Delete a dashboard cell. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_dashboards_id_cells_id_with_http_info(dashboard_id, cell_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The ID of the dashboard to delete. (required) - :param str cell_id: The ID of the cell to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_dashboards_id_cells_id_prepare(dashboard_id, cell_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}/cells/{cellID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def delete_dashboards_id_cells_id_async(self, dashboard_id, cell_id, **kwargs): # noqa: E501,D401,D403 - """Delete a dashboard cell. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str dashboard_id: The ID of the dashboard to delete. (required) - :param str cell_id: The ID of the cell to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_dashboards_id_cells_id_prepare(dashboard_id, cell_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}/cells/{cellID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _delete_dashboards_id_cells_id_prepare(self, dashboard_id, cell_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['dashboard_id', 'cell_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('delete_dashboards_id_cells_id', all_params, local_var_params) - # verify the required parameter 'dashboard_id' is set - if ('dashboard_id' not in local_var_params or - local_var_params['dashboard_id'] is None): - raise ValueError("Missing the required parameter `dashboard_id` when calling `delete_dashboards_id_cells_id`") # noqa: E501 - # verify the required parameter 'cell_id' is set - if ('cell_id' not in local_var_params or - local_var_params['cell_id'] is None): - raise ValueError("Missing the required parameter `cell_id` when calling `delete_dashboards_id_cells_id`") # noqa: E501 - - path_params = {} - if 'dashboard_id' in local_var_params: - path_params['dashboardID'] = local_var_params['dashboard_id'] # noqa: E501 - if 'cell_id' in local_var_params: - path_params['cellID'] = local_var_params['cell_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def delete_dashboards_id_labels_id(self, dashboard_id, label_id, **kwargs): # noqa: E501,D401,D403 - """Delete a label from a dashboard. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_dashboards_id_labels_id(dashboard_id, label_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The dashboard ID. (required) - :param str label_id: The ID of the label to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_dashboards_id_labels_id_with_http_info(dashboard_id, label_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_dashboards_id_labels_id_with_http_info(dashboard_id, label_id, **kwargs) # noqa: E501 - return data - - def delete_dashboards_id_labels_id_with_http_info(self, dashboard_id, label_id, **kwargs): # noqa: E501,D401,D403 - """Delete a label from a dashboard. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_dashboards_id_labels_id_with_http_info(dashboard_id, label_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The dashboard ID. (required) - :param str label_id: The ID of the label to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_dashboards_id_labels_id_prepare(dashboard_id, label_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}/labels/{labelID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def delete_dashboards_id_labels_id_async(self, dashboard_id, label_id, **kwargs): # noqa: E501,D401,D403 - """Delete a label from a dashboard. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str dashboard_id: The dashboard ID. (required) - :param str label_id: The ID of the label to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_dashboards_id_labels_id_prepare(dashboard_id, label_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}/labels/{labelID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _delete_dashboards_id_labels_id_prepare(self, dashboard_id, label_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['dashboard_id', 'label_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('delete_dashboards_id_labels_id', all_params, local_var_params) - # verify the required parameter 'dashboard_id' is set - if ('dashboard_id' not in local_var_params or - local_var_params['dashboard_id'] is None): - raise ValueError("Missing the required parameter `dashboard_id` when calling `delete_dashboards_id_labels_id`") # noqa: E501 - # verify the required parameter 'label_id' is set - if ('label_id' not in local_var_params or - local_var_params['label_id'] is None): - raise ValueError("Missing the required parameter `label_id` when calling `delete_dashboards_id_labels_id`") # noqa: E501 - - path_params = {} - if 'dashboard_id' in local_var_params: - path_params['dashboardID'] = local_var_params['dashboard_id'] # noqa: E501 - if 'label_id' in local_var_params: - path_params['labelID'] = local_var_params['label_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def delete_dashboards_id_members_id(self, user_id, dashboard_id, **kwargs): # noqa: E501,D401,D403 - """Remove a member from a dashboard. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_dashboards_id_members_id(user_id, dashboard_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_id: The ID of the member to remove. (required) - :param str dashboard_id: The dashboard ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_dashboards_id_members_id_with_http_info(user_id, dashboard_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_dashboards_id_members_id_with_http_info(user_id, dashboard_id, **kwargs) # noqa: E501 - return data - - def delete_dashboards_id_members_id_with_http_info(self, user_id, dashboard_id, **kwargs): # noqa: E501,D401,D403 - """Remove a member from a dashboard. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_dashboards_id_members_id_with_http_info(user_id, dashboard_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_id: The ID of the member to remove. (required) - :param str dashboard_id: The dashboard ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_dashboards_id_members_id_prepare(user_id, dashboard_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}/members/{userID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def delete_dashboards_id_members_id_async(self, user_id, dashboard_id, **kwargs): # noqa: E501,D401,D403 - """Remove a member from a dashboard. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str user_id: The ID of the member to remove. (required) - :param str dashboard_id: The dashboard ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_dashboards_id_members_id_prepare(user_id, dashboard_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}/members/{userID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _delete_dashboards_id_members_id_prepare(self, user_id, dashboard_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['user_id', 'dashboard_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('delete_dashboards_id_members_id', all_params, local_var_params) - # verify the required parameter 'user_id' is set - if ('user_id' not in local_var_params or - local_var_params['user_id'] is None): - raise ValueError("Missing the required parameter `user_id` when calling `delete_dashboards_id_members_id`") # noqa: E501 - # verify the required parameter 'dashboard_id' is set - if ('dashboard_id' not in local_var_params or - local_var_params['dashboard_id'] is None): - raise ValueError("Missing the required parameter `dashboard_id` when calling `delete_dashboards_id_members_id`") # noqa: E501 - - path_params = {} - if 'user_id' in local_var_params: - path_params['userID'] = local_var_params['user_id'] # noqa: E501 - if 'dashboard_id' in local_var_params: - path_params['dashboardID'] = local_var_params['dashboard_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def delete_dashboards_id_owners_id(self, user_id, dashboard_id, **kwargs): # noqa: E501,D401,D403 - """Remove an owner from a dashboard. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_dashboards_id_owners_id(user_id, dashboard_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_id: The ID of the owner to remove. (required) - :param str dashboard_id: The dashboard ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_dashboards_id_owners_id_with_http_info(user_id, dashboard_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_dashboards_id_owners_id_with_http_info(user_id, dashboard_id, **kwargs) # noqa: E501 - return data - - def delete_dashboards_id_owners_id_with_http_info(self, user_id, dashboard_id, **kwargs): # noqa: E501,D401,D403 - """Remove an owner from a dashboard. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_dashboards_id_owners_id_with_http_info(user_id, dashboard_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_id: The ID of the owner to remove. (required) - :param str dashboard_id: The dashboard ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_dashboards_id_owners_id_prepare(user_id, dashboard_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}/owners/{userID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def delete_dashboards_id_owners_id_async(self, user_id, dashboard_id, **kwargs): # noqa: E501,D401,D403 - """Remove an owner from a dashboard. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str user_id: The ID of the owner to remove. (required) - :param str dashboard_id: The dashboard ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_dashboards_id_owners_id_prepare(user_id, dashboard_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}/owners/{userID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _delete_dashboards_id_owners_id_prepare(self, user_id, dashboard_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['user_id', 'dashboard_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('delete_dashboards_id_owners_id', all_params, local_var_params) - # verify the required parameter 'user_id' is set - if ('user_id' not in local_var_params or - local_var_params['user_id'] is None): - raise ValueError("Missing the required parameter `user_id` when calling `delete_dashboards_id_owners_id`") # noqa: E501 - # verify the required parameter 'dashboard_id' is set - if ('dashboard_id' not in local_var_params or - local_var_params['dashboard_id'] is None): - raise ValueError("Missing the required parameter `dashboard_id` when calling `delete_dashboards_id_owners_id`") # noqa: E501 - - path_params = {} - if 'user_id' in local_var_params: - path_params['userID'] = local_var_params['user_id'] # noqa: E501 - if 'dashboard_id' in local_var_params: - path_params['dashboardID'] = local_var_params['dashboard_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_dashboards(self, **kwargs): # noqa: E501,D401,D403 - """List dashboards. - - Lists [dashboards](https://docs.influxdata.com/influxdb/latest/reference/glossary/#dashboard). #### Related guides - [Manage dashboards](https://docs.influxdata.com/influxdb/latest/visualize-data/dashboards/). - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_dashboards(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param int offset: The offset for pagination. The number of records to skip. For more information about pagination parameters, see [Pagination](https://docs.influxdata.com/influxdb/latest/api/#tag/Pagination). - :param int limit: Limits the number of records returned. Default is `20`. - :param bool descending: - :param str owner: A user ID. Only returns [dashboards](https://docs.influxdata.com/influxdb/latest/reference/glossary/#dashboard) where the specified user has the `owner` role. - :param str sort_by: The column to sort by. - :param list[str] id: A list of dashboard IDs. Returns only the specified [dashboards](https://docs.influxdata.com/influxdb/latest/reference/glossary/#dashboard). If you specify `id` and `owner`, only `id` is used. - :param str org_id: An organization ID. Only returns [dashboards](https://docs.influxdata.com/influxdb/latest/reference/glossary/#dashboard) that belong to the specified [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization). - :param str org: An organization name. Only returns [dashboards](https://docs.influxdata.com/influxdb/latest/reference/glossary/#dashboard) that belong to the specified [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization). - :return: Dashboards - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_dashboards_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_dashboards_with_http_info(**kwargs) # noqa: E501 - return data - - def get_dashboards_with_http_info(self, **kwargs): # noqa: E501,D401,D403 - """List dashboards. - - Lists [dashboards](https://docs.influxdata.com/influxdb/latest/reference/glossary/#dashboard). #### Related guides - [Manage dashboards](https://docs.influxdata.com/influxdb/latest/visualize-data/dashboards/). - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_dashboards_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param int offset: The offset for pagination. The number of records to skip. For more information about pagination parameters, see [Pagination](https://docs.influxdata.com/influxdb/latest/api/#tag/Pagination). - :param int limit: Limits the number of records returned. Default is `20`. - :param bool descending: - :param str owner: A user ID. Only returns [dashboards](https://docs.influxdata.com/influxdb/latest/reference/glossary/#dashboard) where the specified user has the `owner` role. - :param str sort_by: The column to sort by. - :param list[str] id: A list of dashboard IDs. Returns only the specified [dashboards](https://docs.influxdata.com/influxdb/latest/reference/glossary/#dashboard). If you specify `id` and `owner`, only `id` is used. - :param str org_id: An organization ID. Only returns [dashboards](https://docs.influxdata.com/influxdb/latest/reference/glossary/#dashboard) that belong to the specified [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization). - :param str org: An organization name. Only returns [dashboards](https://docs.influxdata.com/influxdb/latest/reference/glossary/#dashboard) that belong to the specified [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization). - :return: Dashboards - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_dashboards_prepare(**kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/dashboards', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Dashboards', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_dashboards_async(self, **kwargs): # noqa: E501,D401,D403 - """List dashboards. - - Lists [dashboards](https://docs.influxdata.com/influxdb/latest/reference/glossary/#dashboard). #### Related guides - [Manage dashboards](https://docs.influxdata.com/influxdb/latest/visualize-data/dashboards/). - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param int offset: The offset for pagination. The number of records to skip. For more information about pagination parameters, see [Pagination](https://docs.influxdata.com/influxdb/latest/api/#tag/Pagination). - :param int limit: Limits the number of records returned. Default is `20`. - :param bool descending: - :param str owner: A user ID. Only returns [dashboards](https://docs.influxdata.com/influxdb/latest/reference/glossary/#dashboard) where the specified user has the `owner` role. - :param str sort_by: The column to sort by. - :param list[str] id: A list of dashboard IDs. Returns only the specified [dashboards](https://docs.influxdata.com/influxdb/latest/reference/glossary/#dashboard). If you specify `id` and `owner`, only `id` is used. - :param str org_id: An organization ID. Only returns [dashboards](https://docs.influxdata.com/influxdb/latest/reference/glossary/#dashboard) that belong to the specified [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization). - :param str org: An organization name. Only returns [dashboards](https://docs.influxdata.com/influxdb/latest/reference/glossary/#dashboard) that belong to the specified [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization). - :return: Dashboards - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_dashboards_prepare(**kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/dashboards', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Dashboards', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_dashboards_prepare(self, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['zap_trace_span', 'offset', 'limit', 'descending', 'owner', 'sort_by', 'id', 'org_id', 'org'] # noqa: E501 - self._check_operation_params('get_dashboards', all_params, local_var_params) - - if 'offset' in local_var_params and local_var_params['offset'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `offset` when calling `get_dashboards`, must be a value greater than or equal to `0`") # noqa: E501 - if 'limit' in local_var_params and local_var_params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `get_dashboards`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `get_dashboards`, must be a value greater than or equal to `1`") # noqa: E501 - path_params = {} - - query_params = [] - if 'offset' in local_var_params: - query_params.append(('offset', local_var_params['offset'])) # noqa: E501 - if 'limit' in local_var_params: - query_params.append(('limit', local_var_params['limit'])) # noqa: E501 - if 'descending' in local_var_params: - query_params.append(('descending', local_var_params['descending'])) # noqa: E501 - if 'owner' in local_var_params: - query_params.append(('owner', local_var_params['owner'])) # noqa: E501 - if 'sort_by' in local_var_params: - query_params.append(('sortBy', local_var_params['sort_by'])) # noqa: E501 - if 'id' in local_var_params: - query_params.append(('id', local_var_params['id'])) # noqa: E501 - if 'org_id' in local_var_params: - query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501 - if 'org' in local_var_params: - query_params.append(('org', local_var_params['org'])) # noqa: E501 - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_dashboards_id(self, dashboard_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a dashboard. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_dashboards_id(dashboard_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The ID of the dashboard to update. (required) - :param str zap_trace_span: OpenTracing span context - :param str include: If `properties`, includes the cell view properties in the response. - :return: DashboardWithViewProperties - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_dashboards_id_with_http_info(dashboard_id, **kwargs) # noqa: E501 - else: - (data) = self.get_dashboards_id_with_http_info(dashboard_id, **kwargs) # noqa: E501 - return data - - def get_dashboards_id_with_http_info(self, dashboard_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a dashboard. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_dashboards_id_with_http_info(dashboard_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The ID of the dashboard to update. (required) - :param str zap_trace_span: OpenTracing span context - :param str include: If `properties`, includes the cell view properties in the response. - :return: DashboardWithViewProperties - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_dashboards_id_prepare(dashboard_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='DashboardWithViewProperties', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_dashboards_id_async(self, dashboard_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a dashboard. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str dashboard_id: The ID of the dashboard to update. (required) - :param str zap_trace_span: OpenTracing span context - :param str include: If `properties`, includes the cell view properties in the response. - :return: DashboardWithViewProperties - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_dashboards_id_prepare(dashboard_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='DashboardWithViewProperties', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_dashboards_id_prepare(self, dashboard_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['dashboard_id', 'zap_trace_span', 'include'] # noqa: E501 - self._check_operation_params('get_dashboards_id', all_params, local_var_params) - # verify the required parameter 'dashboard_id' is set - if ('dashboard_id' not in local_var_params or - local_var_params['dashboard_id'] is None): - raise ValueError("Missing the required parameter `dashboard_id` when calling `get_dashboards_id`") # noqa: E501 - - path_params = {} - if 'dashboard_id' in local_var_params: - path_params['dashboardID'] = local_var_params['dashboard_id'] # noqa: E501 - - query_params = [] - if 'include' in local_var_params: - query_params.append(('include', local_var_params['include'])) # noqa: E501 - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_dashboards_id_cells_id_view(self, dashboard_id, cell_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve the view for a cell. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_dashboards_id_cells_id_view(dashboard_id, cell_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The dashboard ID. (required) - :param str cell_id: The cell ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: View - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_dashboards_id_cells_id_view_with_http_info(dashboard_id, cell_id, **kwargs) # noqa: E501 - else: - (data) = self.get_dashboards_id_cells_id_view_with_http_info(dashboard_id, cell_id, **kwargs) # noqa: E501 - return data - - def get_dashboards_id_cells_id_view_with_http_info(self, dashboard_id, cell_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve the view for a cell. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_dashboards_id_cells_id_view_with_http_info(dashboard_id, cell_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The dashboard ID. (required) - :param str cell_id: The cell ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: View - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_dashboards_id_cells_id_view_prepare(dashboard_id, cell_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}/cells/{cellID}/view', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='View', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_dashboards_id_cells_id_view_async(self, dashboard_id, cell_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve the view for a cell. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str dashboard_id: The dashboard ID. (required) - :param str cell_id: The cell ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: View - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_dashboards_id_cells_id_view_prepare(dashboard_id, cell_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}/cells/{cellID}/view', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='View', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_dashboards_id_cells_id_view_prepare(self, dashboard_id, cell_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['dashboard_id', 'cell_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_dashboards_id_cells_id_view', all_params, local_var_params) - # verify the required parameter 'dashboard_id' is set - if ('dashboard_id' not in local_var_params or - local_var_params['dashboard_id'] is None): - raise ValueError("Missing the required parameter `dashboard_id` when calling `get_dashboards_id_cells_id_view`") # noqa: E501 - # verify the required parameter 'cell_id' is set - if ('cell_id' not in local_var_params or - local_var_params['cell_id'] is None): - raise ValueError("Missing the required parameter `cell_id` when calling `get_dashboards_id_cells_id_view`") # noqa: E501 - - path_params = {} - if 'dashboard_id' in local_var_params: - path_params['dashboardID'] = local_var_params['dashboard_id'] # noqa: E501 - if 'cell_id' in local_var_params: - path_params['cellID'] = local_var_params['cell_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_dashboards_id_labels(self, dashboard_id, **kwargs): # noqa: E501,D401,D403 - """List all labels for a dashboard. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_dashboards_id_labels(dashboard_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The dashboard ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelsResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_dashboards_id_labels_with_http_info(dashboard_id, **kwargs) # noqa: E501 - else: - (data) = self.get_dashboards_id_labels_with_http_info(dashboard_id, **kwargs) # noqa: E501 - return data - - def get_dashboards_id_labels_with_http_info(self, dashboard_id, **kwargs): # noqa: E501,D401,D403 - """List all labels for a dashboard. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_dashboards_id_labels_with_http_info(dashboard_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The dashboard ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelsResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_dashboards_id_labels_prepare(dashboard_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}/labels', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='LabelsResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_dashboards_id_labels_async(self, dashboard_id, **kwargs): # noqa: E501,D401,D403 - """List all labels for a dashboard. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str dashboard_id: The dashboard ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelsResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_dashboards_id_labels_prepare(dashboard_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}/labels', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='LabelsResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_dashboards_id_labels_prepare(self, dashboard_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['dashboard_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_dashboards_id_labels', all_params, local_var_params) - # verify the required parameter 'dashboard_id' is set - if ('dashboard_id' not in local_var_params or - local_var_params['dashboard_id'] is None): - raise ValueError("Missing the required parameter `dashboard_id` when calling `get_dashboards_id_labels`") # noqa: E501 - - path_params = {} - if 'dashboard_id' in local_var_params: - path_params['dashboardID'] = local_var_params['dashboard_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_dashboards_id_members(self, dashboard_id, **kwargs): # noqa: E501,D401,D403 - """List all dashboard members. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_dashboards_id_members(dashboard_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The dashboard ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceMembers - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_dashboards_id_members_with_http_info(dashboard_id, **kwargs) # noqa: E501 - else: - (data) = self.get_dashboards_id_members_with_http_info(dashboard_id, **kwargs) # noqa: E501 - return data - - def get_dashboards_id_members_with_http_info(self, dashboard_id, **kwargs): # noqa: E501,D401,D403 - """List all dashboard members. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_dashboards_id_members_with_http_info(dashboard_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The dashboard ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceMembers - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_dashboards_id_members_prepare(dashboard_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}/members', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceMembers', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_dashboards_id_members_async(self, dashboard_id, **kwargs): # noqa: E501,D401,D403 - """List all dashboard members. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str dashboard_id: The dashboard ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceMembers - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_dashboards_id_members_prepare(dashboard_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}/members', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceMembers', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_dashboards_id_members_prepare(self, dashboard_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['dashboard_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_dashboards_id_members', all_params, local_var_params) - # verify the required parameter 'dashboard_id' is set - if ('dashboard_id' not in local_var_params or - local_var_params['dashboard_id'] is None): - raise ValueError("Missing the required parameter `dashboard_id` when calling `get_dashboards_id_members`") # noqa: E501 - - path_params = {} - if 'dashboard_id' in local_var_params: - path_params['dashboardID'] = local_var_params['dashboard_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_dashboards_id_owners(self, dashboard_id, **kwargs): # noqa: E501,D401,D403 - """List all dashboard owners. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_dashboards_id_owners(dashboard_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The dashboard ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceOwners - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_dashboards_id_owners_with_http_info(dashboard_id, **kwargs) # noqa: E501 - else: - (data) = self.get_dashboards_id_owners_with_http_info(dashboard_id, **kwargs) # noqa: E501 - return data - - def get_dashboards_id_owners_with_http_info(self, dashboard_id, **kwargs): # noqa: E501,D401,D403 - """List all dashboard owners. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_dashboards_id_owners_with_http_info(dashboard_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The dashboard ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceOwners - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_dashboards_id_owners_prepare(dashboard_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}/owners', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceOwners', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_dashboards_id_owners_async(self, dashboard_id, **kwargs): # noqa: E501,D401,D403 - """List all dashboard owners. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str dashboard_id: The dashboard ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceOwners - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_dashboards_id_owners_prepare(dashboard_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}/owners', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceOwners', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_dashboards_id_owners_prepare(self, dashboard_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['dashboard_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_dashboards_id_owners', all_params, local_var_params) - # verify the required parameter 'dashboard_id' is set - if ('dashboard_id' not in local_var_params or - local_var_params['dashboard_id'] is None): - raise ValueError("Missing the required parameter `dashboard_id` when calling `get_dashboards_id_owners`") # noqa: E501 - - path_params = {} - if 'dashboard_id' in local_var_params: - path_params['dashboardID'] = local_var_params['dashboard_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def patch_dashboards_id(self, dashboard_id, **kwargs): # noqa: E501,D401,D403 - """Update a dashboard. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_dashboards_id(dashboard_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The ID of the dashboard to update. (required) - :param str zap_trace_span: OpenTracing span context - :param PatchDashboardRequest patch_dashboard_request: - :return: Dashboard - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.patch_dashboards_id_with_http_info(dashboard_id, **kwargs) # noqa: E501 - else: - (data) = self.patch_dashboards_id_with_http_info(dashboard_id, **kwargs) # noqa: E501 - return data - - def patch_dashboards_id_with_http_info(self, dashboard_id, **kwargs): # noqa: E501,D401,D403 - """Update a dashboard. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_dashboards_id_with_http_info(dashboard_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The ID of the dashboard to update. (required) - :param str zap_trace_span: OpenTracing span context - :param PatchDashboardRequest patch_dashboard_request: - :return: Dashboard - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_dashboards_id_prepare(dashboard_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Dashboard', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def patch_dashboards_id_async(self, dashboard_id, **kwargs): # noqa: E501,D401,D403 - """Update a dashboard. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str dashboard_id: The ID of the dashboard to update. (required) - :param str zap_trace_span: OpenTracing span context - :param PatchDashboardRequest patch_dashboard_request: - :return: Dashboard - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_dashboards_id_prepare(dashboard_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Dashboard', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _patch_dashboards_id_prepare(self, dashboard_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['dashboard_id', 'zap_trace_span', 'patch_dashboard_request'] # noqa: E501 - self._check_operation_params('patch_dashboards_id', all_params, local_var_params) - # verify the required parameter 'dashboard_id' is set - if ('dashboard_id' not in local_var_params or - local_var_params['dashboard_id'] is None): - raise ValueError("Missing the required parameter `dashboard_id` when calling `patch_dashboards_id`") # noqa: E501 - - path_params = {} - if 'dashboard_id' in local_var_params: - path_params['dashboardID'] = local_var_params['dashboard_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'patch_dashboard_request' in local_var_params: - body_params = local_var_params['patch_dashboard_request'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def patch_dashboards_id_cells_id(self, dashboard_id, cell_id, cell_update, **kwargs): # noqa: E501,D401,D403 - """Update the non-positional information related to a cell. - - Updates the non positional information related to a cell. Updates to a single cell's positional data could cause grid conflicts. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_dashboards_id_cells_id(dashboard_id, cell_id, cell_update, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The ID of the dashboard to update. (required) - :param str cell_id: The ID of the cell to update. (required) - :param CellUpdate cell_update: (required) - :param str zap_trace_span: OpenTracing span context - :return: Cell - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.patch_dashboards_id_cells_id_with_http_info(dashboard_id, cell_id, cell_update, **kwargs) # noqa: E501 - else: - (data) = self.patch_dashboards_id_cells_id_with_http_info(dashboard_id, cell_id, cell_update, **kwargs) # noqa: E501 - return data - - def patch_dashboards_id_cells_id_with_http_info(self, dashboard_id, cell_id, cell_update, **kwargs): # noqa: E501,D401,D403 - """Update the non-positional information related to a cell. - - Updates the non positional information related to a cell. Updates to a single cell's positional data could cause grid conflicts. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_dashboards_id_cells_id_with_http_info(dashboard_id, cell_id, cell_update, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The ID of the dashboard to update. (required) - :param str cell_id: The ID of the cell to update. (required) - :param CellUpdate cell_update: (required) - :param str zap_trace_span: OpenTracing span context - :return: Cell - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_dashboards_id_cells_id_prepare(dashboard_id, cell_id, cell_update, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}/cells/{cellID}', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Cell', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def patch_dashboards_id_cells_id_async(self, dashboard_id, cell_id, cell_update, **kwargs): # noqa: E501,D401,D403 - """Update the non-positional information related to a cell. - - Updates the non positional information related to a cell. Updates to a single cell's positional data could cause grid conflicts. - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str dashboard_id: The ID of the dashboard to update. (required) - :param str cell_id: The ID of the cell to update. (required) - :param CellUpdate cell_update: (required) - :param str zap_trace_span: OpenTracing span context - :return: Cell - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_dashboards_id_cells_id_prepare(dashboard_id, cell_id, cell_update, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}/cells/{cellID}', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Cell', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _patch_dashboards_id_cells_id_prepare(self, dashboard_id, cell_id, cell_update, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['dashboard_id', 'cell_id', 'cell_update', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('patch_dashboards_id_cells_id', all_params, local_var_params) - # verify the required parameter 'dashboard_id' is set - if ('dashboard_id' not in local_var_params or - local_var_params['dashboard_id'] is None): - raise ValueError("Missing the required parameter `dashboard_id` when calling `patch_dashboards_id_cells_id`") # noqa: E501 - # verify the required parameter 'cell_id' is set - if ('cell_id' not in local_var_params or - local_var_params['cell_id'] is None): - raise ValueError("Missing the required parameter `cell_id` when calling `patch_dashboards_id_cells_id`") # noqa: E501 - # verify the required parameter 'cell_update' is set - if ('cell_update' not in local_var_params or - local_var_params['cell_update'] is None): - raise ValueError("Missing the required parameter `cell_update` when calling `patch_dashboards_id_cells_id`") # noqa: E501 - - path_params = {} - if 'dashboard_id' in local_var_params: - path_params['dashboardID'] = local_var_params['dashboard_id'] # noqa: E501 - if 'cell_id' in local_var_params: - path_params['cellID'] = local_var_params['cell_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'cell_update' in local_var_params: - body_params = local_var_params['cell_update'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def patch_dashboards_id_cells_id_view(self, dashboard_id, cell_id, view, **kwargs): # noqa: E501,D401,D403 - """Update the view for a cell. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_dashboards_id_cells_id_view(dashboard_id, cell_id, view, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The ID of the dashboard to update. (required) - :param str cell_id: The ID of the cell to update. (required) - :param View view: (required) - :param str zap_trace_span: OpenTracing span context - :return: View - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.patch_dashboards_id_cells_id_view_with_http_info(dashboard_id, cell_id, view, **kwargs) # noqa: E501 - else: - (data) = self.patch_dashboards_id_cells_id_view_with_http_info(dashboard_id, cell_id, view, **kwargs) # noqa: E501 - return data - - def patch_dashboards_id_cells_id_view_with_http_info(self, dashboard_id, cell_id, view, **kwargs): # noqa: E501,D401,D403 - """Update the view for a cell. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_dashboards_id_cells_id_view_with_http_info(dashboard_id, cell_id, view, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The ID of the dashboard to update. (required) - :param str cell_id: The ID of the cell to update. (required) - :param View view: (required) - :param str zap_trace_span: OpenTracing span context - :return: View - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_dashboards_id_cells_id_view_prepare(dashboard_id, cell_id, view, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}/cells/{cellID}/view', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='View', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def patch_dashboards_id_cells_id_view_async(self, dashboard_id, cell_id, view, **kwargs): # noqa: E501,D401,D403 - """Update the view for a cell. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str dashboard_id: The ID of the dashboard to update. (required) - :param str cell_id: The ID of the cell to update. (required) - :param View view: (required) - :param str zap_trace_span: OpenTracing span context - :return: View - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_dashboards_id_cells_id_view_prepare(dashboard_id, cell_id, view, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}/cells/{cellID}/view', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='View', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _patch_dashboards_id_cells_id_view_prepare(self, dashboard_id, cell_id, view, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['dashboard_id', 'cell_id', 'view', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('patch_dashboards_id_cells_id_view', all_params, local_var_params) - # verify the required parameter 'dashboard_id' is set - if ('dashboard_id' not in local_var_params or - local_var_params['dashboard_id'] is None): - raise ValueError("Missing the required parameter `dashboard_id` when calling `patch_dashboards_id_cells_id_view`") # noqa: E501 - # verify the required parameter 'cell_id' is set - if ('cell_id' not in local_var_params or - local_var_params['cell_id'] is None): - raise ValueError("Missing the required parameter `cell_id` when calling `patch_dashboards_id_cells_id_view`") # noqa: E501 - # verify the required parameter 'view' is set - if ('view' not in local_var_params or - local_var_params['view'] is None): - raise ValueError("Missing the required parameter `view` when calling `patch_dashboards_id_cells_id_view`") # noqa: E501 - - path_params = {} - if 'dashboard_id' in local_var_params: - path_params['dashboardID'] = local_var_params['dashboard_id'] # noqa: E501 - if 'cell_id' in local_var_params: - path_params['cellID'] = local_var_params['cell_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'view' in local_var_params: - body_params = local_var_params['view'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_dashboards(self, create_dashboard_request, **kwargs): # noqa: E501,D401,D403 - """Create a dashboard. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_dashboards(create_dashboard_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param CreateDashboardRequest create_dashboard_request: Dashboard to create (required) - :param str zap_trace_span: OpenTracing span context - :return: Dashboard - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_dashboards_with_http_info(create_dashboard_request, **kwargs) # noqa: E501 - else: - (data) = self.post_dashboards_with_http_info(create_dashboard_request, **kwargs) # noqa: E501 - return data - - def post_dashboards_with_http_info(self, create_dashboard_request, **kwargs): # noqa: E501,D401,D403 - """Create a dashboard. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_dashboards_with_http_info(create_dashboard_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param CreateDashboardRequest create_dashboard_request: Dashboard to create (required) - :param str zap_trace_span: OpenTracing span context - :return: Dashboard - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_dashboards_prepare(create_dashboard_request, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/dashboards', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Dashboard', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_dashboards_async(self, create_dashboard_request, **kwargs): # noqa: E501,D401,D403 - """Create a dashboard. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param CreateDashboardRequest create_dashboard_request: Dashboard to create (required) - :param str zap_trace_span: OpenTracing span context - :return: Dashboard - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_dashboards_prepare(create_dashboard_request, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/dashboards', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Dashboard', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_dashboards_prepare(self, create_dashboard_request, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['create_dashboard_request', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('post_dashboards', all_params, local_var_params) - # verify the required parameter 'create_dashboard_request' is set - if ('create_dashboard_request' not in local_var_params or - local_var_params['create_dashboard_request'] is None): - raise ValueError("Missing the required parameter `create_dashboard_request` when calling `post_dashboards`") # noqa: E501 - - path_params = {} - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'create_dashboard_request' in local_var_params: - body_params = local_var_params['create_dashboard_request'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_dashboards_id_cells(self, dashboard_id, create_cell, **kwargs): # noqa: E501,D401,D403 - """Create a dashboard cell. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_dashboards_id_cells(dashboard_id, create_cell, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The ID of the dashboard to update. (required) - :param CreateCell create_cell: Cell that will be added (required) - :param str zap_trace_span: OpenTracing span context - :return: Cell - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_dashboards_id_cells_with_http_info(dashboard_id, create_cell, **kwargs) # noqa: E501 - else: - (data) = self.post_dashboards_id_cells_with_http_info(dashboard_id, create_cell, **kwargs) # noqa: E501 - return data - - def post_dashboards_id_cells_with_http_info(self, dashboard_id, create_cell, **kwargs): # noqa: E501,D401,D403 - """Create a dashboard cell. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_dashboards_id_cells_with_http_info(dashboard_id, create_cell, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The ID of the dashboard to update. (required) - :param CreateCell create_cell: Cell that will be added (required) - :param str zap_trace_span: OpenTracing span context - :return: Cell - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_dashboards_id_cells_prepare(dashboard_id, create_cell, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}/cells', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Cell', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_dashboards_id_cells_async(self, dashboard_id, create_cell, **kwargs): # noqa: E501,D401,D403 - """Create a dashboard cell. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str dashboard_id: The ID of the dashboard to update. (required) - :param CreateCell create_cell: Cell that will be added (required) - :param str zap_trace_span: OpenTracing span context - :return: Cell - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_dashboards_id_cells_prepare(dashboard_id, create_cell, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}/cells', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Cell', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_dashboards_id_cells_prepare(self, dashboard_id, create_cell, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['dashboard_id', 'create_cell', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('post_dashboards_id_cells', all_params, local_var_params) - # verify the required parameter 'dashboard_id' is set - if ('dashboard_id' not in local_var_params or - local_var_params['dashboard_id'] is None): - raise ValueError("Missing the required parameter `dashboard_id` when calling `post_dashboards_id_cells`") # noqa: E501 - # verify the required parameter 'create_cell' is set - if ('create_cell' not in local_var_params or - local_var_params['create_cell'] is None): - raise ValueError("Missing the required parameter `create_cell` when calling `post_dashboards_id_cells`") # noqa: E501 - - path_params = {} - if 'dashboard_id' in local_var_params: - path_params['dashboardID'] = local_var_params['dashboard_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'create_cell' in local_var_params: - body_params = local_var_params['create_cell'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_dashboards_id_labels(self, dashboard_id, label_mapping, **kwargs): # noqa: E501,D401,D403 - """Add a label to a dashboard. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_dashboards_id_labels(dashboard_id, label_mapping, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The dashboard ID. (required) - :param LabelMapping label_mapping: Label to add (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_dashboards_id_labels_with_http_info(dashboard_id, label_mapping, **kwargs) # noqa: E501 - else: - (data) = self.post_dashboards_id_labels_with_http_info(dashboard_id, label_mapping, **kwargs) # noqa: E501 - return data - - def post_dashboards_id_labels_with_http_info(self, dashboard_id, label_mapping, **kwargs): # noqa: E501,D401,D403 - """Add a label to a dashboard. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_dashboards_id_labels_with_http_info(dashboard_id, label_mapping, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The dashboard ID. (required) - :param LabelMapping label_mapping: Label to add (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_dashboards_id_labels_prepare(dashboard_id, label_mapping, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}/labels', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='LabelResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_dashboards_id_labels_async(self, dashboard_id, label_mapping, **kwargs): # noqa: E501,D401,D403 - """Add a label to a dashboard. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str dashboard_id: The dashboard ID. (required) - :param LabelMapping label_mapping: Label to add (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_dashboards_id_labels_prepare(dashboard_id, label_mapping, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}/labels', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='LabelResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_dashboards_id_labels_prepare(self, dashboard_id, label_mapping, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['dashboard_id', 'label_mapping', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('post_dashboards_id_labels', all_params, local_var_params) - # verify the required parameter 'dashboard_id' is set - if ('dashboard_id' not in local_var_params or - local_var_params['dashboard_id'] is None): - raise ValueError("Missing the required parameter `dashboard_id` when calling `post_dashboards_id_labels`") # noqa: E501 - # verify the required parameter 'label_mapping' is set - if ('label_mapping' not in local_var_params or - local_var_params['label_mapping'] is None): - raise ValueError("Missing the required parameter `label_mapping` when calling `post_dashboards_id_labels`") # noqa: E501 - - path_params = {} - if 'dashboard_id' in local_var_params: - path_params['dashboardID'] = local_var_params['dashboard_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'label_mapping' in local_var_params: - body_params = local_var_params['label_mapping'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_dashboards_id_members(self, dashboard_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - """Add a member to a dashboard. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_dashboards_id_members(dashboard_id, add_resource_member_request_body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The dashboard ID. (required) - :param AddResourceMemberRequestBody add_resource_member_request_body: User to add as member (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceMember - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_dashboards_id_members_with_http_info(dashboard_id, add_resource_member_request_body, **kwargs) # noqa: E501 - else: - (data) = self.post_dashboards_id_members_with_http_info(dashboard_id, add_resource_member_request_body, **kwargs) # noqa: E501 - return data - - def post_dashboards_id_members_with_http_info(self, dashboard_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - """Add a member to a dashboard. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_dashboards_id_members_with_http_info(dashboard_id, add_resource_member_request_body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The dashboard ID. (required) - :param AddResourceMemberRequestBody add_resource_member_request_body: User to add as member (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceMember - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_dashboards_id_members_prepare(dashboard_id, add_resource_member_request_body, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}/members', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceMember', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_dashboards_id_members_async(self, dashboard_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - """Add a member to a dashboard. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str dashboard_id: The dashboard ID. (required) - :param AddResourceMemberRequestBody add_resource_member_request_body: User to add as member (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceMember - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_dashboards_id_members_prepare(dashboard_id, add_resource_member_request_body, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}/members', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceMember', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_dashboards_id_members_prepare(self, dashboard_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['dashboard_id', 'add_resource_member_request_body', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('post_dashboards_id_members', all_params, local_var_params) - # verify the required parameter 'dashboard_id' is set - if ('dashboard_id' not in local_var_params or - local_var_params['dashboard_id'] is None): - raise ValueError("Missing the required parameter `dashboard_id` when calling `post_dashboards_id_members`") # noqa: E501 - # verify the required parameter 'add_resource_member_request_body' is set - if ('add_resource_member_request_body' not in local_var_params or - local_var_params['add_resource_member_request_body'] is None): - raise ValueError("Missing the required parameter `add_resource_member_request_body` when calling `post_dashboards_id_members`") # noqa: E501 - - path_params = {} - if 'dashboard_id' in local_var_params: - path_params['dashboardID'] = local_var_params['dashboard_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'add_resource_member_request_body' in local_var_params: - body_params = local_var_params['add_resource_member_request_body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_dashboards_id_owners(self, dashboard_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - """Add an owner to a dashboard. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_dashboards_id_owners(dashboard_id, add_resource_member_request_body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The dashboard ID. (required) - :param AddResourceMemberRequestBody add_resource_member_request_body: User to add as owner (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceOwner - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_dashboards_id_owners_with_http_info(dashboard_id, add_resource_member_request_body, **kwargs) # noqa: E501 - else: - (data) = self.post_dashboards_id_owners_with_http_info(dashboard_id, add_resource_member_request_body, **kwargs) # noqa: E501 - return data - - def post_dashboards_id_owners_with_http_info(self, dashboard_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - """Add an owner to a dashboard. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_dashboards_id_owners_with_http_info(dashboard_id, add_resource_member_request_body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The dashboard ID. (required) - :param AddResourceMemberRequestBody add_resource_member_request_body: User to add as owner (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceOwner - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_dashboards_id_owners_prepare(dashboard_id, add_resource_member_request_body, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}/owners', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceOwner', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_dashboards_id_owners_async(self, dashboard_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - """Add an owner to a dashboard. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str dashboard_id: The dashboard ID. (required) - :param AddResourceMemberRequestBody add_resource_member_request_body: User to add as owner (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceOwner - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_dashboards_id_owners_prepare(dashboard_id, add_resource_member_request_body, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}/owners', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceOwner', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_dashboards_id_owners_prepare(self, dashboard_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['dashboard_id', 'add_resource_member_request_body', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('post_dashboards_id_owners', all_params, local_var_params) - # verify the required parameter 'dashboard_id' is set - if ('dashboard_id' not in local_var_params or - local_var_params['dashboard_id'] is None): - raise ValueError("Missing the required parameter `dashboard_id` when calling `post_dashboards_id_owners`") # noqa: E501 - # verify the required parameter 'add_resource_member_request_body' is set - if ('add_resource_member_request_body' not in local_var_params or - local_var_params['add_resource_member_request_body'] is None): - raise ValueError("Missing the required parameter `add_resource_member_request_body` when calling `post_dashboards_id_owners`") # noqa: E501 - - path_params = {} - if 'dashboard_id' in local_var_params: - path_params['dashboardID'] = local_var_params['dashboard_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'add_resource_member_request_body' in local_var_params: - body_params = local_var_params['add_resource_member_request_body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def put_dashboards_id_cells(self, dashboard_id, cell, **kwargs): # noqa: E501,D401,D403 - """Replace cells in a dashboard. - - Replaces all cells in a dashboard. This is used primarily to update the positional information of all cells. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.put_dashboards_id_cells(dashboard_id, cell, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The ID of the dashboard to update. (required) - :param list[Cell] cell: (required) - :param str zap_trace_span: OpenTracing span context - :return: Dashboard - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.put_dashboards_id_cells_with_http_info(dashboard_id, cell, **kwargs) # noqa: E501 - else: - (data) = self.put_dashboards_id_cells_with_http_info(dashboard_id, cell, **kwargs) # noqa: E501 - return data - - def put_dashboards_id_cells_with_http_info(self, dashboard_id, cell, **kwargs): # noqa: E501,D401,D403 - """Replace cells in a dashboard. - - Replaces all cells in a dashboard. This is used primarily to update the positional information of all cells. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.put_dashboards_id_cells_with_http_info(dashboard_id, cell, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The ID of the dashboard to update. (required) - :param list[Cell] cell: (required) - :param str zap_trace_span: OpenTracing span context - :return: Dashboard - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._put_dashboards_id_cells_prepare(dashboard_id, cell, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}/cells', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Dashboard', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def put_dashboards_id_cells_async(self, dashboard_id, cell, **kwargs): # noqa: E501,D401,D403 - """Replace cells in a dashboard. - - Replaces all cells in a dashboard. This is used primarily to update the positional information of all cells. - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str dashboard_id: The ID of the dashboard to update. (required) - :param list[Cell] cell: (required) - :param str zap_trace_span: OpenTracing span context - :return: Dashboard - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._put_dashboards_id_cells_prepare(dashboard_id, cell, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}/cells', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Dashboard', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _put_dashboards_id_cells_prepare(self, dashboard_id, cell, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['dashboard_id', 'cell', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('put_dashboards_id_cells', all_params, local_var_params) - # verify the required parameter 'dashboard_id' is set - if ('dashboard_id' not in local_var_params or - local_var_params['dashboard_id'] is None): - raise ValueError("Missing the required parameter `dashboard_id` when calling `put_dashboards_id_cells`") # noqa: E501 - # verify the required parameter 'cell' is set - if ('cell' not in local_var_params or - local_var_params['cell'] is None): - raise ValueError("Missing the required parameter `cell` when calling `put_dashboards_id_cells`") # noqa: E501 - - path_params = {} - if 'dashboard_id' in local_var_params: - path_params['dashboardID'] = local_var_params['dashboard_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'cell' in local_var_params: - body_params = local_var_params['cell'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params diff --git a/frogpilot/third_party/influxdb_client/service/dbr_ps_service.py b/frogpilot/third_party/influxdb_client/service/dbr_ps_service.py deleted file mode 100644 index 4fb20aef..00000000 --- a/frogpilot/third_party/influxdb_client/service/dbr_ps_service.py +++ /dev/null @@ -1,695 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -from influxdb_client.service._base_service import _BaseService - - -class DBRPsService(_BaseService): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): # noqa: E501,D401,D403 - """DBRPsService - a operation defined in OpenAPI.""" - super().__init__(api_client) - - def delete_dbrpid(self, dbrp_id, **kwargs): # noqa: E501,D401,D403 - """Delete a database retention policy. - - Deletes the specified database retention policy (DBRP) mapping. #### Related guide - [Database and retention policy mapping](https://docs.influxdata.com/influxdb/latest/reference/api/influxdb-1x/dbrp/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_dbrpid(dbrp_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dbrp_id: A DBRP mapping ID. Only returns the specified DBRP mapping. (required) - :param str zap_trace_span: OpenTracing span context - :param str org_id: An organization ID. Specifies the organization that owns the DBRP mapping. - :param str org: An organization name. Specifies the organization that owns the DBRP mapping. - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_dbrpid_with_http_info(dbrp_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_dbrpid_with_http_info(dbrp_id, **kwargs) # noqa: E501 - return data - - def delete_dbrpid_with_http_info(self, dbrp_id, **kwargs): # noqa: E501,D401,D403 - """Delete a database retention policy. - - Deletes the specified database retention policy (DBRP) mapping. #### Related guide - [Database and retention policy mapping](https://docs.influxdata.com/influxdb/latest/reference/api/influxdb-1x/dbrp/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_dbrpid_with_http_info(dbrp_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dbrp_id: A DBRP mapping ID. Only returns the specified DBRP mapping. (required) - :param str zap_trace_span: OpenTracing span context - :param str org_id: An organization ID. Specifies the organization that owns the DBRP mapping. - :param str org: An organization name. Specifies the organization that owns the DBRP mapping. - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_dbrpid_prepare(dbrp_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/dbrps/{dbrpID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def delete_dbrpid_async(self, dbrp_id, **kwargs): # noqa: E501,D401,D403 - """Delete a database retention policy. - - Deletes the specified database retention policy (DBRP) mapping. #### Related guide - [Database and retention policy mapping](https://docs.influxdata.com/influxdb/latest/reference/api/influxdb-1x/dbrp/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str dbrp_id: A DBRP mapping ID. Only returns the specified DBRP mapping. (required) - :param str zap_trace_span: OpenTracing span context - :param str org_id: An organization ID. Specifies the organization that owns the DBRP mapping. - :param str org: An organization name. Specifies the organization that owns the DBRP mapping. - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_dbrpid_prepare(dbrp_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/dbrps/{dbrpID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _delete_dbrpid_prepare(self, dbrp_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['dbrp_id', 'zap_trace_span', 'org_id', 'org'] # noqa: E501 - self._check_operation_params('delete_dbrpid', all_params, local_var_params) - # verify the required parameter 'dbrp_id' is set - if ('dbrp_id' not in local_var_params or - local_var_params['dbrp_id'] is None): - raise ValueError("Missing the required parameter `dbrp_id` when calling `delete_dbrpid`") # noqa: E501 - - path_params = {} - if 'dbrp_id' in local_var_params: - path_params['dbrpID'] = local_var_params['dbrp_id'] # noqa: E501 - - query_params = [] - if 'org_id' in local_var_params: - query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501 - if 'org' in local_var_params: - query_params.append(('org', local_var_params['org'])) # noqa: E501 - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_dbr_ps(self, **kwargs): # noqa: E501,D401,D403 - """List database retention policy mappings. - - Lists database retention policy (DBRP) mappings. #### Related guide - [Database and retention policy mapping](https://docs.influxdata.com/influxdb/latest/reference/api/influxdb-1x/dbrp/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_dbr_ps(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param str org_id: An organization ID. Only returns DBRP mappings for the specified organization. - :param str org: An organization name. Only returns DBRP mappings for the specified organization. - :param str id: A DBPR mapping ID. Only returns the specified DBRP mapping. - :param str bucket_id: A bucket ID. Only returns DBRP mappings that belong to the specified bucket. - :param bool default: Specifies filtering on default - :param str db: A database. Only returns DBRP mappings that belong to the 1.x database. - :param str rp: A [retention policy](https://docs.influxdata.com/influxdb/v1.8/concepts/glossary/#retention-policy-rp). Specifies the 1.x retention policy to filter on. - :return: DBRPs - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_dbr_ps_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_dbr_ps_with_http_info(**kwargs) # noqa: E501 - return data - - def get_dbr_ps_with_http_info(self, **kwargs): # noqa: E501,D401,D403 - """List database retention policy mappings. - - Lists database retention policy (DBRP) mappings. #### Related guide - [Database and retention policy mapping](https://docs.influxdata.com/influxdb/latest/reference/api/influxdb-1x/dbrp/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_dbr_ps_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param str org_id: An organization ID. Only returns DBRP mappings for the specified organization. - :param str org: An organization name. Only returns DBRP mappings for the specified organization. - :param str id: A DBPR mapping ID. Only returns the specified DBRP mapping. - :param str bucket_id: A bucket ID. Only returns DBRP mappings that belong to the specified bucket. - :param bool default: Specifies filtering on default - :param str db: A database. Only returns DBRP mappings that belong to the 1.x database. - :param str rp: A [retention policy](https://docs.influxdata.com/influxdb/v1.8/concepts/glossary/#retention-policy-rp). Specifies the 1.x retention policy to filter on. - :return: DBRPs - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_dbr_ps_prepare(**kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/dbrps', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='DBRPs', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_dbr_ps_async(self, **kwargs): # noqa: E501,D401,D403 - """List database retention policy mappings. - - Lists database retention policy (DBRP) mappings. #### Related guide - [Database and retention policy mapping](https://docs.influxdata.com/influxdb/latest/reference/api/influxdb-1x/dbrp/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param str org_id: An organization ID. Only returns DBRP mappings for the specified organization. - :param str org: An organization name. Only returns DBRP mappings for the specified organization. - :param str id: A DBPR mapping ID. Only returns the specified DBRP mapping. - :param str bucket_id: A bucket ID. Only returns DBRP mappings that belong to the specified bucket. - :param bool default: Specifies filtering on default - :param str db: A database. Only returns DBRP mappings that belong to the 1.x database. - :param str rp: A [retention policy](https://docs.influxdata.com/influxdb/v1.8/concepts/glossary/#retention-policy-rp). Specifies the 1.x retention policy to filter on. - :return: DBRPs - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_dbr_ps_prepare(**kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/dbrps', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='DBRPs', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_dbr_ps_prepare(self, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['zap_trace_span', 'org_id', 'org', 'id', 'bucket_id', 'default', 'db', 'rp'] # noqa: E501 - self._check_operation_params('get_dbr_ps', all_params, local_var_params) - - path_params = {} - - query_params = [] - if 'org_id' in local_var_params: - query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501 - if 'org' in local_var_params: - query_params.append(('org', local_var_params['org'])) # noqa: E501 - if 'id' in local_var_params: - query_params.append(('id', local_var_params['id'])) # noqa: E501 - if 'bucket_id' in local_var_params: - query_params.append(('bucketID', local_var_params['bucket_id'])) # noqa: E501 - if 'default' in local_var_params: - query_params.append(('default', local_var_params['default'])) # noqa: E501 - if 'db' in local_var_params: - query_params.append(('db', local_var_params['db'])) # noqa: E501 - if 'rp' in local_var_params: - query_params.append(('rp', local_var_params['rp'])) # noqa: E501 - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_dbr_ps_id(self, dbrp_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a database retention policy mapping. - - Retrieves the specified retention policy (DBRP) mapping. #### Related guide - [Database and retention policy mapping](https://docs.influxdata.com/influxdb/latest/reference/api/influxdb-1x/dbrp/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_dbr_ps_id(dbrp_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dbrp_id: A DBRP mapping ID. Specifies the DBRP mapping. (required) - :param str zap_trace_span: OpenTracing span context - :param str org_id: An organization ID. Specifies the organization that owns the DBRP mapping. - :param str org: An organization name. Specifies the organization that owns the DBRP mapping. - :return: DBRPGet - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_dbr_ps_id_with_http_info(dbrp_id, **kwargs) # noqa: E501 - else: - (data) = self.get_dbr_ps_id_with_http_info(dbrp_id, **kwargs) # noqa: E501 - return data - - def get_dbr_ps_id_with_http_info(self, dbrp_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a database retention policy mapping. - - Retrieves the specified retention policy (DBRP) mapping. #### Related guide - [Database and retention policy mapping](https://docs.influxdata.com/influxdb/latest/reference/api/influxdb-1x/dbrp/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_dbr_ps_id_with_http_info(dbrp_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dbrp_id: A DBRP mapping ID. Specifies the DBRP mapping. (required) - :param str zap_trace_span: OpenTracing span context - :param str org_id: An organization ID. Specifies the organization that owns the DBRP mapping. - :param str org: An organization name. Specifies the organization that owns the DBRP mapping. - :return: DBRPGet - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_dbr_ps_id_prepare(dbrp_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/dbrps/{dbrpID}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='DBRPGet', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_dbr_ps_id_async(self, dbrp_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a database retention policy mapping. - - Retrieves the specified retention policy (DBRP) mapping. #### Related guide - [Database and retention policy mapping](https://docs.influxdata.com/influxdb/latest/reference/api/influxdb-1x/dbrp/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str dbrp_id: A DBRP mapping ID. Specifies the DBRP mapping. (required) - :param str zap_trace_span: OpenTracing span context - :param str org_id: An organization ID. Specifies the organization that owns the DBRP mapping. - :param str org: An organization name. Specifies the organization that owns the DBRP mapping. - :return: DBRPGet - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_dbr_ps_id_prepare(dbrp_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/dbrps/{dbrpID}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='DBRPGet', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_dbr_ps_id_prepare(self, dbrp_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['dbrp_id', 'zap_trace_span', 'org_id', 'org'] # noqa: E501 - self._check_operation_params('get_dbr_ps_id', all_params, local_var_params) - # verify the required parameter 'dbrp_id' is set - if ('dbrp_id' not in local_var_params or - local_var_params['dbrp_id'] is None): - raise ValueError("Missing the required parameter `dbrp_id` when calling `get_dbr_ps_id`") # noqa: E501 - - path_params = {} - if 'dbrp_id' in local_var_params: - path_params['dbrpID'] = local_var_params['dbrp_id'] # noqa: E501 - - query_params = [] - if 'org_id' in local_var_params: - query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501 - if 'org' in local_var_params: - query_params.append(('org', local_var_params['org'])) # noqa: E501 - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def patch_dbrpid(self, dbrp_id, dbrp_update, **kwargs): # noqa: E501,D401,D403 - """Update a database retention policy mapping. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_dbrpid(dbrp_id, dbrp_update, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dbrp_id: A DBRP mapping ID. Specifies the DBRP mapping. (required) - :param DBRPUpdate dbrp_update: Updates the database retention policy (DBRP) mapping and returns the mapping. Use this endpoint to modify the _retention policy_ (`retention_policy` property) of a DBRP mapping. #### Related guide - [Database and retention policy mapping](https://docs.influxdata.com/influxdb/latest/reference/api/influxdb-1x/dbrp/) (required) - :param str zap_trace_span: OpenTracing span context - :param str org_id: An organization ID. Specifies the organization that owns the DBRP mapping. - :param str org: An organization name. Specifies the organization that owns the DBRP mapping. - :return: DBRPGet - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.patch_dbrpid_with_http_info(dbrp_id, dbrp_update, **kwargs) # noqa: E501 - else: - (data) = self.patch_dbrpid_with_http_info(dbrp_id, dbrp_update, **kwargs) # noqa: E501 - return data - - def patch_dbrpid_with_http_info(self, dbrp_id, dbrp_update, **kwargs): # noqa: E501,D401,D403 - """Update a database retention policy mapping. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_dbrpid_with_http_info(dbrp_id, dbrp_update, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dbrp_id: A DBRP mapping ID. Specifies the DBRP mapping. (required) - :param DBRPUpdate dbrp_update: Updates the database retention policy (DBRP) mapping and returns the mapping. Use this endpoint to modify the _retention policy_ (`retention_policy` property) of a DBRP mapping. #### Related guide - [Database and retention policy mapping](https://docs.influxdata.com/influxdb/latest/reference/api/influxdb-1x/dbrp/) (required) - :param str zap_trace_span: OpenTracing span context - :param str org_id: An organization ID. Specifies the organization that owns the DBRP mapping. - :param str org: An organization name. Specifies the organization that owns the DBRP mapping. - :return: DBRPGet - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_dbrpid_prepare(dbrp_id, dbrp_update, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/dbrps/{dbrpID}', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='DBRPGet', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def patch_dbrpid_async(self, dbrp_id, dbrp_update, **kwargs): # noqa: E501,D401,D403 - """Update a database retention policy mapping. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str dbrp_id: A DBRP mapping ID. Specifies the DBRP mapping. (required) - :param DBRPUpdate dbrp_update: Updates the database retention policy (DBRP) mapping and returns the mapping. Use this endpoint to modify the _retention policy_ (`retention_policy` property) of a DBRP mapping. #### Related guide - [Database and retention policy mapping](https://docs.influxdata.com/influxdb/latest/reference/api/influxdb-1x/dbrp/) (required) - :param str zap_trace_span: OpenTracing span context - :param str org_id: An organization ID. Specifies the organization that owns the DBRP mapping. - :param str org: An organization name. Specifies the organization that owns the DBRP mapping. - :return: DBRPGet - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_dbrpid_prepare(dbrp_id, dbrp_update, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/dbrps/{dbrpID}', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='DBRPGet', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _patch_dbrpid_prepare(self, dbrp_id, dbrp_update, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['dbrp_id', 'dbrp_update', 'zap_trace_span', 'org_id', 'org'] # noqa: E501 - self._check_operation_params('patch_dbrpid', all_params, local_var_params) - # verify the required parameter 'dbrp_id' is set - if ('dbrp_id' not in local_var_params or - local_var_params['dbrp_id'] is None): - raise ValueError("Missing the required parameter `dbrp_id` when calling `patch_dbrpid`") # noqa: E501 - # verify the required parameter 'dbrp_update' is set - if ('dbrp_update' not in local_var_params or - local_var_params['dbrp_update'] is None): - raise ValueError("Missing the required parameter `dbrp_update` when calling `patch_dbrpid`") # noqa: E501 - - path_params = {} - if 'dbrp_id' in local_var_params: - path_params['dbrpID'] = local_var_params['dbrp_id'] # noqa: E501 - - query_params = [] - if 'org_id' in local_var_params: - query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501 - if 'org' in local_var_params: - query_params.append(('org', local_var_params['org'])) # noqa: E501 - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'dbrp_update' in local_var_params: - body_params = local_var_params['dbrp_update'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_dbrp(self, dbrp_create, **kwargs): # noqa: E501,D401,D403 - """Add a database retention policy mapping. - - Creates a database retention policy (DBRP) mapping and returns the mapping. Use this endpoint to add InfluxDB 1.x API compatibility to your InfluxDB Cloud or InfluxDB OSS 2.x buckets. Your buckets must contain a DBRP mapping in order to query and write using the InfluxDB 1.x API. object. #### Related guide - [Database and retention policy mapping](https://docs.influxdata.com/influxdb/latest/reference/api/influxdb-1x/dbrp/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_dbrp(dbrp_create, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param DBRPCreate dbrp_create: The database retention policy mapping to add. Note that _`retention_policy`_ is a required parameter in the request body. The value of _`retention_policy`_ can be any arbitrary `string` name or value, with the default value commonly set as `autogen`. The value of _`retention_policy`_ isn't a [retention_policy](https://docs.influxdata.com/influxdb/latest/reference/glossary/#retention-policy-rp) (required) - :param str zap_trace_span: OpenTracing span context - :return: DBRP - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_dbrp_with_http_info(dbrp_create, **kwargs) # noqa: E501 - else: - (data) = self.post_dbrp_with_http_info(dbrp_create, **kwargs) # noqa: E501 - return data - - def post_dbrp_with_http_info(self, dbrp_create, **kwargs): # noqa: E501,D401,D403 - """Add a database retention policy mapping. - - Creates a database retention policy (DBRP) mapping and returns the mapping. Use this endpoint to add InfluxDB 1.x API compatibility to your InfluxDB Cloud or InfluxDB OSS 2.x buckets. Your buckets must contain a DBRP mapping in order to query and write using the InfluxDB 1.x API. object. #### Related guide - [Database and retention policy mapping](https://docs.influxdata.com/influxdb/latest/reference/api/influxdb-1x/dbrp/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_dbrp_with_http_info(dbrp_create, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param DBRPCreate dbrp_create: The database retention policy mapping to add. Note that _`retention_policy`_ is a required parameter in the request body. The value of _`retention_policy`_ can be any arbitrary `string` name or value, with the default value commonly set as `autogen`. The value of _`retention_policy`_ isn't a [retention_policy](https://docs.influxdata.com/influxdb/latest/reference/glossary/#retention-policy-rp) (required) - :param str zap_trace_span: OpenTracing span context - :return: DBRP - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_dbrp_prepare(dbrp_create, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/dbrps', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='DBRP', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_dbrp_async(self, dbrp_create, **kwargs): # noqa: E501,D401,D403 - """Add a database retention policy mapping. - - Creates a database retention policy (DBRP) mapping and returns the mapping. Use this endpoint to add InfluxDB 1.x API compatibility to your InfluxDB Cloud or InfluxDB OSS 2.x buckets. Your buckets must contain a DBRP mapping in order to query and write using the InfluxDB 1.x API. object. #### Related guide - [Database and retention policy mapping](https://docs.influxdata.com/influxdb/latest/reference/api/influxdb-1x/dbrp/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param DBRPCreate dbrp_create: The database retention policy mapping to add. Note that _`retention_policy`_ is a required parameter in the request body. The value of _`retention_policy`_ can be any arbitrary `string` name or value, with the default value commonly set as `autogen`. The value of _`retention_policy`_ isn't a [retention_policy](https://docs.influxdata.com/influxdb/latest/reference/glossary/#retention-policy-rp) (required) - :param str zap_trace_span: OpenTracing span context - :return: DBRP - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_dbrp_prepare(dbrp_create, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/dbrps', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='DBRP', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_dbrp_prepare(self, dbrp_create, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['dbrp_create', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('post_dbrp', all_params, local_var_params) - # verify the required parameter 'dbrp_create' is set - if ('dbrp_create' not in local_var_params or - local_var_params['dbrp_create'] is None): - raise ValueError("Missing the required parameter `dbrp_create` when calling `post_dbrp`") # noqa: E501 - - path_params = {} - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'dbrp_create' in local_var_params: - body_params = local_var_params['dbrp_create'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params diff --git a/frogpilot/third_party/influxdb_client/service/delete_service.py b/frogpilot/third_party/influxdb_client/service/delete_service.py deleted file mode 100644 index 7fef4ea9..00000000 --- a/frogpilot/third_party/influxdb_client/service/delete_service.py +++ /dev/null @@ -1,173 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -from influxdb_client.service._base_service import _BaseService - - -class DeleteService(_BaseService): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): # noqa: E501,D401,D403 - """DeleteService - a operation defined in OpenAPI.""" - super().__init__(api_client) - - def post_delete(self, delete_predicate_request, **kwargs): # noqa: E501,D401,D403 - """Delete data. - - Deletes data from a bucket. Use this endpoint to delete points from a bucket in a specified time range. #### InfluxDB Cloud - Does the following when you send a delete request: 1. Validates the request and queues the delete. 2. If queued, responds with _success_ (HTTP `2xx` status code); _error_ otherwise. 3. Handles the delete asynchronously and reaches eventual consistency. To ensure that InfluxDB Cloud handles writes and deletes in the order you request them, wait for a success response (HTTP `2xx` status code) before you send the next request. Because writes and deletes are asynchronous, your change might not yet be readable when you receive the response. #### InfluxDB OSS - Validates the request, handles the delete synchronously, and then responds with success or failure. #### Required permissions - `write-buckets` or `write-bucket BUCKET_ID`. *`BUCKET_ID`* is the ID of the destination bucket. #### Rate limits (with InfluxDB Cloud) `write` rate limits apply. For more information, see [limits and adjustable quotas](https://docs.influxdata.com/influxdb/cloud/account-management/limits/). #### Related guides - [Delete data](https://docs.influxdata.com/influxdb/latest/write-data/delete-data/) - Learn how to use [delete predicate syntax](https://docs.influxdata.com/influxdb/latest/reference/syntax/delete-predicate/). - Learn how InfluxDB handles [deleted tags](https://docs.influxdata.com/flux/v0.x/stdlib/influxdata/influxdb/schema/measurementtagkeys/) and [deleted fields](https://docs.influxdata.com/flux/v0.x/stdlib/influxdata/influxdb/schema/measurementfieldkeys/). - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_delete(delete_predicate_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param DeletePredicateRequest delete_predicate_request: Time range parameters and an optional **delete predicate expression**. To select points to delete within the specified time range, pass a **delete predicate expression** in the `predicate` property of the request body. If you don't pass a `predicate`, InfluxDB deletes all data with timestamps in the specified time range. #### Related guides - [Delete data](https://docs.influxdata.com/influxdb/latest/write-data/delete-data/) - Learn how to use [delete predicate syntax](https://docs.influxdata.com/influxdb/latest/reference/syntax/delete-predicate/). (required) - :param str zap_trace_span: OpenTracing span context - :param str org: An organization name or ID. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Deletes data from the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either the `org` parameter or the `orgID` parameter. - Deletes data from the bucket in the specified organization. - If you pass both `orgID` and `org`, they must both be valid. - :param str bucket: A bucket name or ID. Specifies the bucket to delete data from. If you pass both `bucket` and `bucketID`, `bucketID` takes precedence. - :param str org_id: An organization ID. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Deletes data from the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either the `org` parameter or the `orgID` parameter. - Deletes data from the bucket in the specified organization. - If you pass both `orgID` and `org`, they must both be valid. - :param str bucket_id: A bucket ID. Specifies the bucket to delete data from. If you pass both `bucket` and `bucketID`, `bucketID` takes precedence. - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_delete_with_http_info(delete_predicate_request, **kwargs) # noqa: E501 - else: - (data) = self.post_delete_with_http_info(delete_predicate_request, **kwargs) # noqa: E501 - return data - - def post_delete_with_http_info(self, delete_predicate_request, **kwargs): # noqa: E501,D401,D403 - """Delete data. - - Deletes data from a bucket. Use this endpoint to delete points from a bucket in a specified time range. #### InfluxDB Cloud - Does the following when you send a delete request: 1. Validates the request and queues the delete. 2. If queued, responds with _success_ (HTTP `2xx` status code); _error_ otherwise. 3. Handles the delete asynchronously and reaches eventual consistency. To ensure that InfluxDB Cloud handles writes and deletes in the order you request them, wait for a success response (HTTP `2xx` status code) before you send the next request. Because writes and deletes are asynchronous, your change might not yet be readable when you receive the response. #### InfluxDB OSS - Validates the request, handles the delete synchronously, and then responds with success or failure. #### Required permissions - `write-buckets` or `write-bucket BUCKET_ID`. *`BUCKET_ID`* is the ID of the destination bucket. #### Rate limits (with InfluxDB Cloud) `write` rate limits apply. For more information, see [limits and adjustable quotas](https://docs.influxdata.com/influxdb/cloud/account-management/limits/). #### Related guides - [Delete data](https://docs.influxdata.com/influxdb/latest/write-data/delete-data/) - Learn how to use [delete predicate syntax](https://docs.influxdata.com/influxdb/latest/reference/syntax/delete-predicate/). - Learn how InfluxDB handles [deleted tags](https://docs.influxdata.com/flux/v0.x/stdlib/influxdata/influxdb/schema/measurementtagkeys/) and [deleted fields](https://docs.influxdata.com/flux/v0.x/stdlib/influxdata/influxdb/schema/measurementfieldkeys/). - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_delete_with_http_info(delete_predicate_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param DeletePredicateRequest delete_predicate_request: Time range parameters and an optional **delete predicate expression**. To select points to delete within the specified time range, pass a **delete predicate expression** in the `predicate` property of the request body. If you don't pass a `predicate`, InfluxDB deletes all data with timestamps in the specified time range. #### Related guides - [Delete data](https://docs.influxdata.com/influxdb/latest/write-data/delete-data/) - Learn how to use [delete predicate syntax](https://docs.influxdata.com/influxdb/latest/reference/syntax/delete-predicate/). (required) - :param str zap_trace_span: OpenTracing span context - :param str org: An organization name or ID. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Deletes data from the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either the `org` parameter or the `orgID` parameter. - Deletes data from the bucket in the specified organization. - If you pass both `orgID` and `org`, they must both be valid. - :param str bucket: A bucket name or ID. Specifies the bucket to delete data from. If you pass both `bucket` and `bucketID`, `bucketID` takes precedence. - :param str org_id: An organization ID. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Deletes data from the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either the `org` parameter or the `orgID` parameter. - Deletes data from the bucket in the specified organization. - If you pass both `orgID` and `org`, they must both be valid. - :param str bucket_id: A bucket ID. Specifies the bucket to delete data from. If you pass both `bucket` and `bucketID`, `bucketID` takes precedence. - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_delete_prepare(delete_predicate_request, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/delete', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_delete_async(self, delete_predicate_request, **kwargs): # noqa: E501,D401,D403 - """Delete data. - - Deletes data from a bucket. Use this endpoint to delete points from a bucket in a specified time range. #### InfluxDB Cloud - Does the following when you send a delete request: 1. Validates the request and queues the delete. 2. If queued, responds with _success_ (HTTP `2xx` status code); _error_ otherwise. 3. Handles the delete asynchronously and reaches eventual consistency. To ensure that InfluxDB Cloud handles writes and deletes in the order you request them, wait for a success response (HTTP `2xx` status code) before you send the next request. Because writes and deletes are asynchronous, your change might not yet be readable when you receive the response. #### InfluxDB OSS - Validates the request, handles the delete synchronously, and then responds with success or failure. #### Required permissions - `write-buckets` or `write-bucket BUCKET_ID`. *`BUCKET_ID`* is the ID of the destination bucket. #### Rate limits (with InfluxDB Cloud) `write` rate limits apply. For more information, see [limits and adjustable quotas](https://docs.influxdata.com/influxdb/cloud/account-management/limits/). #### Related guides - [Delete data](https://docs.influxdata.com/influxdb/latest/write-data/delete-data/) - Learn how to use [delete predicate syntax](https://docs.influxdata.com/influxdb/latest/reference/syntax/delete-predicate/). - Learn how InfluxDB handles [deleted tags](https://docs.influxdata.com/flux/v0.x/stdlib/influxdata/influxdb/schema/measurementtagkeys/) and [deleted fields](https://docs.influxdata.com/flux/v0.x/stdlib/influxdata/influxdb/schema/measurementfieldkeys/). - This method makes an asynchronous HTTP request. - - :param async_req bool - :param DeletePredicateRequest delete_predicate_request: Time range parameters and an optional **delete predicate expression**. To select points to delete within the specified time range, pass a **delete predicate expression** in the `predicate` property of the request body. If you don't pass a `predicate`, InfluxDB deletes all data with timestamps in the specified time range. #### Related guides - [Delete data](https://docs.influxdata.com/influxdb/latest/write-data/delete-data/) - Learn how to use [delete predicate syntax](https://docs.influxdata.com/influxdb/latest/reference/syntax/delete-predicate/). (required) - :param str zap_trace_span: OpenTracing span context - :param str org: An organization name or ID. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Deletes data from the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either the `org` parameter or the `orgID` parameter. - Deletes data from the bucket in the specified organization. - If you pass both `orgID` and `org`, they must both be valid. - :param str bucket: A bucket name or ID. Specifies the bucket to delete data from. If you pass both `bucket` and `bucketID`, `bucketID` takes precedence. - :param str org_id: An organization ID. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Deletes data from the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either the `org` parameter or the `orgID` parameter. - Deletes data from the bucket in the specified organization. - If you pass both `orgID` and `org`, they must both be valid. - :param str bucket_id: A bucket ID. Specifies the bucket to delete data from. If you pass both `bucket` and `bucketID`, `bucketID` takes precedence. - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_delete_prepare(delete_predicate_request, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/delete', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_delete_prepare(self, delete_predicate_request, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['delete_predicate_request', 'zap_trace_span', 'org', 'bucket', 'org_id', 'bucket_id'] # noqa: E501 - self._check_operation_params('post_delete', all_params, local_var_params) - # verify the required parameter 'delete_predicate_request' is set - if ('delete_predicate_request' not in local_var_params or - local_var_params['delete_predicate_request'] is None): - raise ValueError("Missing the required parameter `delete_predicate_request` when calling `post_delete`") # noqa: E501 - - path_params = {} - - query_params = [] - if 'org' in local_var_params: - query_params.append(('org', local_var_params['org'])) # noqa: E501 - if 'bucket' in local_var_params: - query_params.append(('bucket', local_var_params['bucket'])) # noqa: E501 - if 'org_id' in local_var_params: - query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501 - if 'bucket_id' in local_var_params: - query_params.append(('bucketID', local_var_params['bucket_id'])) # noqa: E501 - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'delete_predicate_request' in local_var_params: - body_params = local_var_params['delete_predicate_request'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params diff --git a/frogpilot/third_party/influxdb_client/service/health_service.py b/frogpilot/third_party/influxdb_client/service/health_service.py deleted file mode 100644 index 6a87da7a..00000000 --- a/frogpilot/third_party/influxdb_client/service/health_service.py +++ /dev/null @@ -1,140 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -from influxdb_client.service._base_service import _BaseService - - -class HealthService(_BaseService): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): # noqa: E501,D401,D403 - """HealthService - a operation defined in OpenAPI.""" - super().__init__(api_client) - - def get_health(self, **kwargs): # noqa: E501,D401,D403 - """Retrieve the health of the instance. - - Returns the health of the instance. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_health(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :return: HealthCheck - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_health_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_health_with_http_info(**kwargs) # noqa: E501 - return data - - def get_health_with_http_info(self, **kwargs): # noqa: E501,D401,D403 - """Retrieve the health of the instance. - - Returns the health of the instance. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_health_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :return: HealthCheck - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_health_prepare(**kwargs) # noqa: E501 - - return self.api_client.call_api( - '/health', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='HealthCheck', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_health_async(self, **kwargs): # noqa: E501,D401,D403 - """Retrieve the health of the instance. - - Returns the health of the instance. - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :return: HealthCheck - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_health_prepare(**kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/health', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='HealthCheck', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_health_prepare(self, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['zap_trace_span'] # noqa: E501 - self._check_operation_params('get_health', all_params, local_var_params) - - path_params = {} - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params diff --git a/frogpilot/third_party/influxdb_client/service/invokable_scripts_service.py b/frogpilot/third_party/influxdb_client/service/invokable_scripts_service.py deleted file mode 100644 index 9c84503d..00000000 --- a/frogpilot/third_party/influxdb_client/service/invokable_scripts_service.py +++ /dev/null @@ -1,922 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -from influxdb_client.service._base_service import _BaseService - - -class InvokableScriptsService(_BaseService): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): # noqa: E501,D401,D403 - """InvokableScriptsService - a operation defined in OpenAPI.""" - super().__init__(api_client) - - def delete_scripts_id(self, script_id, **kwargs): # noqa: E501,D401,D403 - """Delete a script. - - Deletes a [script](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) and all associated records. #### Limitations - You can delete only one script per request. - If the script ID you provide doesn't exist for the organization, InfluxDB responds with an HTTP `204` status code. #### Related Guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_scripts_id(script_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str script_id: A script ID. Deletes the specified script. (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_scripts_id_with_http_info(script_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_scripts_id_with_http_info(script_id, **kwargs) # noqa: E501 - return data - - def delete_scripts_id_with_http_info(self, script_id, **kwargs): # noqa: E501,D401,D403 - """Delete a script. - - Deletes a [script](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) and all associated records. #### Limitations - You can delete only one script per request. - If the script ID you provide doesn't exist for the organization, InfluxDB responds with an HTTP `204` status code. #### Related Guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_scripts_id_with_http_info(script_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str script_id: A script ID. Deletes the specified script. (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - if not self._is_cloud_instance(): - from influxdb_client.client.warnings import CloudOnlyWarning - CloudOnlyWarning.print_warning('InvokableScriptsService', - 'https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/') # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_scripts_id_prepare(script_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/scripts/{scriptID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def delete_scripts_id_async(self, script_id, **kwargs): # noqa: E501,D401,D403 - """Delete a script. - - Deletes a [script](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) and all associated records. #### Limitations - You can delete only one script per request. - If the script ID you provide doesn't exist for the organization, InfluxDB responds with an HTTP `204` status code. #### Related Guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str script_id: A script ID. Deletes the specified script. (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - if not await self._is_cloud_instance_async(): - from influxdb_client.client.warnings import CloudOnlyWarning - CloudOnlyWarning.print_warning('InvokableScriptsService', - 'https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/') # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_scripts_id_prepare(script_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/scripts/{scriptID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _delete_scripts_id_prepare(self, script_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['script_id'] # noqa: E501 - self._check_operation_params('delete_scripts_id', all_params, local_var_params) - # verify the required parameter 'script_id' is set - if ('script_id' not in local_var_params or - local_var_params['script_id'] is None): - raise ValueError("Missing the required parameter `script_id` when calling `delete_scripts_id`") # noqa: E501 - - path_params = {} - if 'script_id' in local_var_params: - path_params['scriptID'] = local_var_params['script_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_scripts(self, **kwargs): # noqa: E501,D401,D403 - """List scripts. - - Lists [scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/). #### Related guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_scripts(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param int offset: The offset for pagination. The number of records to skip. For more information about pagination parameters, see [Pagination]({{% INFLUXDB_DOCS_URL %}}/api/#tag/Pagination). - :param int limit: The maximum number of scripts to return. Default is `100`. - :param str name: The script name. Lists scripts with the specified name. - :return: Scripts - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_scripts_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_scripts_with_http_info(**kwargs) # noqa: E501 - return data - - def get_scripts_with_http_info(self, **kwargs): # noqa: E501,D401,D403 - """List scripts. - - Lists [scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/). #### Related guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_scripts_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param int offset: The offset for pagination. The number of records to skip. For more information about pagination parameters, see [Pagination]({{% INFLUXDB_DOCS_URL %}}/api/#tag/Pagination). - :param int limit: The maximum number of scripts to return. Default is `100`. - :param str name: The script name. Lists scripts with the specified name. - :return: Scripts - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - if not self._is_cloud_instance(): - from influxdb_client.client.warnings import CloudOnlyWarning - CloudOnlyWarning.print_warning('InvokableScriptsService', - 'https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/') # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_scripts_prepare(**kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/scripts', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Scripts', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_scripts_async(self, **kwargs): # noqa: E501,D401,D403 - """List scripts. - - Lists [scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/). #### Related guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param int offset: The offset for pagination. The number of records to skip. For more information about pagination parameters, see [Pagination]({{% INFLUXDB_DOCS_URL %}}/api/#tag/Pagination). - :param int limit: The maximum number of scripts to return. Default is `100`. - :param str name: The script name. Lists scripts with the specified name. - :return: Scripts - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - if not await self._is_cloud_instance_async(): - from influxdb_client.client.warnings import CloudOnlyWarning - CloudOnlyWarning.print_warning('InvokableScriptsService', - 'https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/') # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_scripts_prepare(**kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/scripts', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Scripts', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_scripts_prepare(self, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['offset', 'limit', 'name'] # noqa: E501 - self._check_operation_params('get_scripts', all_params, local_var_params) - - if 'offset' in local_var_params and local_var_params['offset'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `offset` when calling `get_scripts`, must be a value greater than or equal to `0`") # noqa: E501 - if 'limit' in local_var_params and local_var_params['limit'] > 500: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `get_scripts`, must be a value less than or equal to `500`") # noqa: E501 - if 'limit' in local_var_params and local_var_params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `get_scripts`, must be a value greater than or equal to `0`") # noqa: E501 - path_params = {} - - query_params = [] - if 'offset' in local_var_params: - query_params.append(('offset', local_var_params['offset'])) # noqa: E501 - if 'limit' in local_var_params: - query_params.append(('limit', local_var_params['limit'])) # noqa: E501 - if 'name' in local_var_params: - query_params.append(('name', local_var_params['name'])) # noqa: E501 - - header_params = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_scripts_id(self, script_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a script. - - Retrieves a [script](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/). #### Related Guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_scripts_id(script_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str script_id: A script ID. Retrieves the specified script. (required) - :return: Script - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_scripts_id_with_http_info(script_id, **kwargs) # noqa: E501 - else: - (data) = self.get_scripts_id_with_http_info(script_id, **kwargs) # noqa: E501 - return data - - def get_scripts_id_with_http_info(self, script_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a script. - - Retrieves a [script](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/). #### Related Guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_scripts_id_with_http_info(script_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str script_id: A script ID. Retrieves the specified script. (required) - :return: Script - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - if not self._is_cloud_instance(): - from influxdb_client.client.warnings import CloudOnlyWarning - CloudOnlyWarning.print_warning('InvokableScriptsService', - 'https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/') # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_scripts_id_prepare(script_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/scripts/{scriptID}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Script', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_scripts_id_async(self, script_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a script. - - Retrieves a [script](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/). #### Related Guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str script_id: A script ID. Retrieves the specified script. (required) - :return: Script - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - if not await self._is_cloud_instance_async(): - from influxdb_client.client.warnings import CloudOnlyWarning - CloudOnlyWarning.print_warning('InvokableScriptsService', - 'https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/') # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_scripts_id_prepare(script_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/scripts/{scriptID}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Script', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_scripts_id_prepare(self, script_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['script_id'] # noqa: E501 - self._check_operation_params('get_scripts_id', all_params, local_var_params) - # verify the required parameter 'script_id' is set - if ('script_id' not in local_var_params or - local_var_params['script_id'] is None): - raise ValueError("Missing the required parameter `script_id` when calling `get_scripts_id`") # noqa: E501 - - path_params = {} - if 'script_id' in local_var_params: - path_params['scriptID'] = local_var_params['script_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_scripts_id_params(self, script_id, **kwargs): # noqa: E501,D401,D403 - """Find script parameters.. - - Analyzes a script and determines required parameters. Find all `params` keys referenced in a script and return a list of keys. If it is possible to determine the type of the value from the context then the type is also returned -- for example: The following sample script contains a _`mybucket`_ parameter : ```json "script": "from(bucket: params.mybucket) |> range(start: -7d) |> limit(n:1)" ``` Requesting the parameters using `GET /api/v2/scripts/SCRIPT_ID/params` returns the following: ```json { "params": { "mybucket": "string" } } ``` The type name returned for a parameter will be one of: - `any` - `bool` - `duration` - `float` - `int` - `string` - `time` - `uint` The type name `any` is used when the type of a parameter cannot be determined from the context, or the type is determined to be a structured type such as an array or record. #### Related guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_scripts_id_params(script_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str script_id: A script ID. The script to analyze for params. (required) - :return: Params - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_scripts_id_params_with_http_info(script_id, **kwargs) # noqa: E501 - else: - (data) = self.get_scripts_id_params_with_http_info(script_id, **kwargs) # noqa: E501 - return data - - def get_scripts_id_params_with_http_info(self, script_id, **kwargs): # noqa: E501,D401,D403 - """Find script parameters.. - - Analyzes a script and determines required parameters. Find all `params` keys referenced in a script and return a list of keys. If it is possible to determine the type of the value from the context then the type is also returned -- for example: The following sample script contains a _`mybucket`_ parameter : ```json "script": "from(bucket: params.mybucket) |> range(start: -7d) |> limit(n:1)" ``` Requesting the parameters using `GET /api/v2/scripts/SCRIPT_ID/params` returns the following: ```json { "params": { "mybucket": "string" } } ``` The type name returned for a parameter will be one of: - `any` - `bool` - `duration` - `float` - `int` - `string` - `time` - `uint` The type name `any` is used when the type of a parameter cannot be determined from the context, or the type is determined to be a structured type such as an array or record. #### Related guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_scripts_id_params_with_http_info(script_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str script_id: A script ID. The script to analyze for params. (required) - :return: Params - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - if not self._is_cloud_instance(): - from influxdb_client.client.warnings import CloudOnlyWarning - CloudOnlyWarning.print_warning('InvokableScriptsService', - 'https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/') # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_scripts_id_params_prepare(script_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/scripts/{scriptID}/params', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Params', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_scripts_id_params_async(self, script_id, **kwargs): # noqa: E501,D401,D403 - """Find script parameters.. - - Analyzes a script and determines required parameters. Find all `params` keys referenced in a script and return a list of keys. If it is possible to determine the type of the value from the context then the type is also returned -- for example: The following sample script contains a _`mybucket`_ parameter : ```json "script": "from(bucket: params.mybucket) |> range(start: -7d) |> limit(n:1)" ``` Requesting the parameters using `GET /api/v2/scripts/SCRIPT_ID/params` returns the following: ```json { "params": { "mybucket": "string" } } ``` The type name returned for a parameter will be one of: - `any` - `bool` - `duration` - `float` - `int` - `string` - `time` - `uint` The type name `any` is used when the type of a parameter cannot be determined from the context, or the type is determined to be a structured type such as an array or record. #### Related guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str script_id: A script ID. The script to analyze for params. (required) - :return: Params - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - if not await self._is_cloud_instance_async(): - from influxdb_client.client.warnings import CloudOnlyWarning - CloudOnlyWarning.print_warning('InvokableScriptsService', - 'https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/') # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_scripts_id_params_prepare(script_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/scripts/{scriptID}/params', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Params', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_scripts_id_params_prepare(self, script_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['script_id'] # noqa: E501 - self._check_operation_params('get_scripts_id_params', all_params, local_var_params) - # verify the required parameter 'script_id' is set - if ('script_id' not in local_var_params or - local_var_params['script_id'] is None): - raise ValueError("Missing the required parameter `script_id` when calling `get_scripts_id_params`") # noqa: E501 - - path_params = {} - if 'script_id' in local_var_params: - path_params['scriptID'] = local_var_params['script_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def patch_scripts_id(self, script_id, script_update_request, **kwargs): # noqa: E501,D401,D403 - """Update a script. - - Updates an invokable script. Use this endpoint to modify values for script properties (`description` and `script`). To update a script, pass an object that contains the updated key-value pairs. #### Limitations - If you send an empty request body, the script will neither update nor store an empty script, but InfluxDB will respond with an HTTP `200` status code. #### Related Guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_scripts_id(script_id, script_update_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str script_id: A script ID. Updates the specified script. (required) - :param ScriptUpdateRequest script_update_request: An object that contains the updated script properties to apply. (required) - :return: Script - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.patch_scripts_id_with_http_info(script_id, script_update_request, **kwargs) # noqa: E501 - else: - (data) = self.patch_scripts_id_with_http_info(script_id, script_update_request, **kwargs) # noqa: E501 - return data - - def patch_scripts_id_with_http_info(self, script_id, script_update_request, **kwargs): # noqa: E501,D401,D403 - """Update a script. - - Updates an invokable script. Use this endpoint to modify values for script properties (`description` and `script`). To update a script, pass an object that contains the updated key-value pairs. #### Limitations - If you send an empty request body, the script will neither update nor store an empty script, but InfluxDB will respond with an HTTP `200` status code. #### Related Guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_scripts_id_with_http_info(script_id, script_update_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str script_id: A script ID. Updates the specified script. (required) - :param ScriptUpdateRequest script_update_request: An object that contains the updated script properties to apply. (required) - :return: Script - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - if not self._is_cloud_instance(): - from influxdb_client.client.warnings import CloudOnlyWarning - CloudOnlyWarning.print_warning('InvokableScriptsService', - 'https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/') # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_scripts_id_prepare(script_id, script_update_request, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/scripts/{scriptID}', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Script', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def patch_scripts_id_async(self, script_id, script_update_request, **kwargs): # noqa: E501,D401,D403 - """Update a script. - - Updates an invokable script. Use this endpoint to modify values for script properties (`description` and `script`). To update a script, pass an object that contains the updated key-value pairs. #### Limitations - If you send an empty request body, the script will neither update nor store an empty script, but InfluxDB will respond with an HTTP `200` status code. #### Related Guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str script_id: A script ID. Updates the specified script. (required) - :param ScriptUpdateRequest script_update_request: An object that contains the updated script properties to apply. (required) - :return: Script - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - if not await self._is_cloud_instance_async(): - from influxdb_client.client.warnings import CloudOnlyWarning - CloudOnlyWarning.print_warning('InvokableScriptsService', - 'https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/') # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_scripts_id_prepare(script_id, script_update_request, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/scripts/{scriptID}', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Script', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _patch_scripts_id_prepare(self, script_id, script_update_request, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['script_id', 'script_update_request'] # noqa: E501 - self._check_operation_params('patch_scripts_id', all_params, local_var_params) - # verify the required parameter 'script_id' is set - if ('script_id' not in local_var_params or - local_var_params['script_id'] is None): - raise ValueError("Missing the required parameter `script_id` when calling `patch_scripts_id`") # noqa: E501 - # verify the required parameter 'script_update_request' is set - if ('script_update_request' not in local_var_params or - local_var_params['script_update_request'] is None): - raise ValueError("Missing the required parameter `script_update_request` when calling `patch_scripts_id`") # noqa: E501 - - path_params = {} - if 'script_id' in local_var_params: - path_params['scriptID'] = local_var_params['script_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - body_params = None - if 'script_update_request' in local_var_params: - body_params = local_var_params['script_update_request'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_scripts(self, script_create_request, **kwargs): # noqa: E501,D401,D403 - """Create a script. - - Creates an [invokable script](https://docs.influxdata.com/resources/videos/api-invokable-scripts/) and returns the script. #### Related guides - [Invokable scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) - [Creating custom InfluxDB endpoints](https://docs.influxdata.com/resources/videos/api-invokable-scripts/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_scripts(script_create_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param ScriptCreateRequest script_create_request: The script to create. (required) - :return: Script - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_scripts_with_http_info(script_create_request, **kwargs) # noqa: E501 - else: - (data) = self.post_scripts_with_http_info(script_create_request, **kwargs) # noqa: E501 - return data - - def post_scripts_with_http_info(self, script_create_request, **kwargs): # noqa: E501,D401,D403 - """Create a script. - - Creates an [invokable script](https://docs.influxdata.com/resources/videos/api-invokable-scripts/) and returns the script. #### Related guides - [Invokable scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) - [Creating custom InfluxDB endpoints](https://docs.influxdata.com/resources/videos/api-invokable-scripts/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_scripts_with_http_info(script_create_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param ScriptCreateRequest script_create_request: The script to create. (required) - :return: Script - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - if not self._is_cloud_instance(): - from influxdb_client.client.warnings import CloudOnlyWarning - CloudOnlyWarning.print_warning('InvokableScriptsService', - 'https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/') # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_scripts_prepare(script_create_request, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/scripts', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Script', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_scripts_async(self, script_create_request, **kwargs): # noqa: E501,D401,D403 - """Create a script. - - Creates an [invokable script](https://docs.influxdata.com/resources/videos/api-invokable-scripts/) and returns the script. #### Related guides - [Invokable scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) - [Creating custom InfluxDB endpoints](https://docs.influxdata.com/resources/videos/api-invokable-scripts/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param ScriptCreateRequest script_create_request: The script to create. (required) - :return: Script - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - if not await self._is_cloud_instance_async(): - from influxdb_client.client.warnings import CloudOnlyWarning - CloudOnlyWarning.print_warning('InvokableScriptsService', - 'https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/') # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_scripts_prepare(script_create_request, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/scripts', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Script', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_scripts_prepare(self, script_create_request, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['script_create_request'] # noqa: E501 - self._check_operation_params('post_scripts', all_params, local_var_params) - # verify the required parameter 'script_create_request' is set - if ('script_create_request' not in local_var_params or - local_var_params['script_create_request'] is None): - raise ValueError("Missing the required parameter `script_create_request` when calling `post_scripts`") # noqa: E501 - - path_params = {} - - query_params = [] - - header_params = {} - - body_params = None - if 'script_create_request' in local_var_params: - body_params = local_var_params['script_create_request'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_scripts_id_invoke(self, script_id, **kwargs): # noqa: E501,D401,D403 - """Invoke a script. - - Runs a script and returns the result. When the script runs, InfluxDB replaces `params` keys referenced in the script with `params` key-values passed in the request body--for example: The following sample script contains a _`mybucket`_ parameter : ```json "script": "from(bucket: params.mybucket) |> range(start: -7d) |> limit(n:1)" ``` The following example `POST /api/v2/scripts/SCRIPT_ID/invoke` request body passes a value for the _`mybucket`_ parameter: ```json { "params": { "mybucket": "air_sensor" } } ``` #### Related guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_scripts_id_invoke(script_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str script_id: A script ID. Runs the specified script. (required) - :param ScriptInvocationParams script_invocation_params: - :return: file - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_scripts_id_invoke_with_http_info(script_id, **kwargs) # noqa: E501 - else: - (data) = self.post_scripts_id_invoke_with_http_info(script_id, **kwargs) # noqa: E501 - return data - - def post_scripts_id_invoke_with_http_info(self, script_id, **kwargs): # noqa: E501,D401,D403 - """Invoke a script. - - Runs a script and returns the result. When the script runs, InfluxDB replaces `params` keys referenced in the script with `params` key-values passed in the request body--for example: The following sample script contains a _`mybucket`_ parameter : ```json "script": "from(bucket: params.mybucket) |> range(start: -7d) |> limit(n:1)" ``` The following example `POST /api/v2/scripts/SCRIPT_ID/invoke` request body passes a value for the _`mybucket`_ parameter: ```json { "params": { "mybucket": "air_sensor" } } ``` #### Related guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_scripts_id_invoke_with_http_info(script_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str script_id: A script ID. Runs the specified script. (required) - :param ScriptInvocationParams script_invocation_params: - :return: file - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - if not self._is_cloud_instance(): - from influxdb_client.client.warnings import CloudOnlyWarning - CloudOnlyWarning.print_warning('InvokableScriptsService', - 'https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/') # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_scripts_id_invoke_prepare(script_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/scripts/{scriptID}/invoke', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='file', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_scripts_id_invoke_async(self, script_id, **kwargs): # noqa: E501,D401,D403 - """Invoke a script. - - Runs a script and returns the result. When the script runs, InfluxDB replaces `params` keys referenced in the script with `params` key-values passed in the request body--for example: The following sample script contains a _`mybucket`_ parameter : ```json "script": "from(bucket: params.mybucket) |> range(start: -7d) |> limit(n:1)" ``` The following example `POST /api/v2/scripts/SCRIPT_ID/invoke` request body passes a value for the _`mybucket`_ parameter: ```json { "params": { "mybucket": "air_sensor" } } ``` #### Related guides - [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str script_id: A script ID. Runs the specified script. (required) - :param ScriptInvocationParams script_invocation_params: - :return: file - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - if not await self._is_cloud_instance_async(): - from influxdb_client.client.warnings import CloudOnlyWarning - CloudOnlyWarning.print_warning('InvokableScriptsService', - 'https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/') # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_scripts_id_invoke_prepare(script_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/scripts/{scriptID}/invoke', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='file', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_scripts_id_invoke_prepare(self, script_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['script_id', 'script_invocation_params'] # noqa: E501 - self._check_operation_params('post_scripts_id_invoke', all_params, local_var_params) - # verify the required parameter 'script_id' is set - if ('script_id' not in local_var_params or - local_var_params['script_id'] is None): - raise ValueError("Missing the required parameter `script_id` when calling `post_scripts_id_invoke`") # noqa: E501 - - path_params = {} - if 'script_id' in local_var_params: - path_params['scriptID'] = local_var_params['script_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - body_params = None - if 'script_invocation_params' in local_var_params: - body_params = local_var_params['script_invocation_params'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['text/csv', 'application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params diff --git a/frogpilot/third_party/influxdb_client/service/labels_service.py b/frogpilot/third_party/influxdb_client/service/labels_service.py deleted file mode 100644 index aa88f41d..00000000 --- a/frogpilot/third_party/influxdb_client/service/labels_service.py +++ /dev/null @@ -1,618 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -from influxdb_client.service._base_service import _BaseService - - -class LabelsService(_BaseService): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): # noqa: E501,D401,D403 - """LabelsService - a operation defined in OpenAPI.""" - super().__init__(api_client) - - def delete_labels_id(self, label_id, **kwargs): # noqa: E501,D401,D403 - """Delete a label. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_labels_id(label_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str label_id: The ID of the label to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_labels_id_with_http_info(label_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_labels_id_with_http_info(label_id, **kwargs) # noqa: E501 - return data - - def delete_labels_id_with_http_info(self, label_id, **kwargs): # noqa: E501,D401,D403 - """Delete a label. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_labels_id_with_http_info(label_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str label_id: The ID of the label to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_labels_id_prepare(label_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/labels/{labelID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def delete_labels_id_async(self, label_id, **kwargs): # noqa: E501,D401,D403 - """Delete a label. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str label_id: The ID of the label to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_labels_id_prepare(label_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/labels/{labelID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _delete_labels_id_prepare(self, label_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['label_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('delete_labels_id', all_params, local_var_params) - # verify the required parameter 'label_id' is set - if ('label_id' not in local_var_params or - local_var_params['label_id'] is None): - raise ValueError("Missing the required parameter `label_id` when calling `delete_labels_id`") # noqa: E501 - - path_params = {} - if 'label_id' in local_var_params: - path_params['labelID'] = local_var_params['label_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_labels(self, **kwargs): # noqa: E501,D401,D403 - """List all labels. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_labels(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param str org_id: The organization ID. - :return: LabelsResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_labels_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_labels_with_http_info(**kwargs) # noqa: E501 - return data - - def get_labels_with_http_info(self, **kwargs): # noqa: E501,D401,D403 - """List all labels. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_labels_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param str org_id: The organization ID. - :return: LabelsResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_labels_prepare(**kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/labels', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='LabelsResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_labels_async(self, **kwargs): # noqa: E501,D401,D403 - """List all labels. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param str org_id: The organization ID. - :return: LabelsResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_labels_prepare(**kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/labels', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='LabelsResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_labels_prepare(self, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['zap_trace_span', 'org_id'] # noqa: E501 - self._check_operation_params('get_labels', all_params, local_var_params) - - path_params = {} - - query_params = [] - if 'org_id' in local_var_params: - query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501 - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_labels_id(self, label_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a label. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_labels_id(label_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str label_id: The ID of the label to update. (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_labels_id_with_http_info(label_id, **kwargs) # noqa: E501 - else: - (data) = self.get_labels_id_with_http_info(label_id, **kwargs) # noqa: E501 - return data - - def get_labels_id_with_http_info(self, label_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a label. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_labels_id_with_http_info(label_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str label_id: The ID of the label to update. (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_labels_id_prepare(label_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/labels/{labelID}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='LabelResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_labels_id_async(self, label_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a label. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str label_id: The ID of the label to update. (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_labels_id_prepare(label_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/labels/{labelID}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='LabelResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_labels_id_prepare(self, label_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['label_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_labels_id', all_params, local_var_params) - # verify the required parameter 'label_id' is set - if ('label_id' not in local_var_params or - local_var_params['label_id'] is None): - raise ValueError("Missing the required parameter `label_id` when calling `get_labels_id`") # noqa: E501 - - path_params = {} - if 'label_id' in local_var_params: - path_params['labelID'] = local_var_params['label_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def patch_labels_id(self, label_id, label_update, **kwargs): # noqa: E501,D401,D403 - """Update a label. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_labels_id(label_id, label_update, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str label_id: The ID of the label to update. (required) - :param LabelUpdate label_update: A label update. (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.patch_labels_id_with_http_info(label_id, label_update, **kwargs) # noqa: E501 - else: - (data) = self.patch_labels_id_with_http_info(label_id, label_update, **kwargs) # noqa: E501 - return data - - def patch_labels_id_with_http_info(self, label_id, label_update, **kwargs): # noqa: E501,D401,D403 - """Update a label. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_labels_id_with_http_info(label_id, label_update, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str label_id: The ID of the label to update. (required) - :param LabelUpdate label_update: A label update. (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_labels_id_prepare(label_id, label_update, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/labels/{labelID}', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='LabelResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def patch_labels_id_async(self, label_id, label_update, **kwargs): # noqa: E501,D401,D403 - """Update a label. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str label_id: The ID of the label to update. (required) - :param LabelUpdate label_update: A label update. (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_labels_id_prepare(label_id, label_update, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/labels/{labelID}', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='LabelResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _patch_labels_id_prepare(self, label_id, label_update, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['label_id', 'label_update', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('patch_labels_id', all_params, local_var_params) - # verify the required parameter 'label_id' is set - if ('label_id' not in local_var_params or - local_var_params['label_id'] is None): - raise ValueError("Missing the required parameter `label_id` when calling `patch_labels_id`") # noqa: E501 - # verify the required parameter 'label_update' is set - if ('label_update' not in local_var_params or - local_var_params['label_update'] is None): - raise ValueError("Missing the required parameter `label_update` when calling `patch_labels_id`") # noqa: E501 - - path_params = {} - if 'label_id' in local_var_params: - path_params['labelID'] = local_var_params['label_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'label_update' in local_var_params: - body_params = local_var_params['label_update'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_labels(self, label_create_request, **kwargs): # noqa: E501,D401,D403 - """Create a label. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_labels(label_create_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param LabelCreateRequest label_create_request: The label to create. (required) - :return: LabelResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_labels_with_http_info(label_create_request, **kwargs) # noqa: E501 - else: - (data) = self.post_labels_with_http_info(label_create_request, **kwargs) # noqa: E501 - return data - - def post_labels_with_http_info(self, label_create_request, **kwargs): # noqa: E501,D401,D403 - """Create a label. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_labels_with_http_info(label_create_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param LabelCreateRequest label_create_request: The label to create. (required) - :return: LabelResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_labels_prepare(label_create_request, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/labels', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='LabelResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_labels_async(self, label_create_request, **kwargs): # noqa: E501,D401,D403 - """Create a label. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param LabelCreateRequest label_create_request: The label to create. (required) - :return: LabelResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_labels_prepare(label_create_request, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/labels', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='LabelResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_labels_prepare(self, label_create_request, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['label_create_request'] # noqa: E501 - self._check_operation_params('post_labels', all_params, local_var_params) - # verify the required parameter 'label_create_request' is set - if ('label_create_request' not in local_var_params or - local_var_params['label_create_request'] is None): - raise ValueError("Missing the required parameter `label_create_request` when calling `post_labels`") # noqa: E501 - - path_params = {} - - query_params = [] - - header_params = {} - - body_params = None - if 'label_create_request' in local_var_params: - body_params = local_var_params['label_create_request'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params diff --git a/frogpilot/third_party/influxdb_client/service/legacy_authorizations_service.py b/frogpilot/third_party/influxdb_client/service/legacy_authorizations_service.py deleted file mode 100644 index 622ef49c..00000000 --- a/frogpilot/third_party/influxdb_client/service/legacy_authorizations_service.py +++ /dev/null @@ -1,777 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -from influxdb_client.service._base_service import _BaseService - - -class LegacyAuthorizationsService(_BaseService): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): # noqa: E501,D401,D403 - """LegacyAuthorizationsService - a operation defined in OpenAPI.""" - super().__init__(api_client) - - def delete_legacy_authorizations_id(self, auth_id, **kwargs): # noqa: E501,D401,D403 - """Delete a legacy authorization. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_legacy_authorizations_id(auth_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str auth_id: The ID of the legacy authorization to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_legacy_authorizations_id_with_http_info(auth_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_legacy_authorizations_id_with_http_info(auth_id, **kwargs) # noqa: E501 - return data - - def delete_legacy_authorizations_id_with_http_info(self, auth_id, **kwargs): # noqa: E501,D401,D403 - """Delete a legacy authorization. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_legacy_authorizations_id_with_http_info(auth_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str auth_id: The ID of the legacy authorization to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_legacy_authorizations_id_prepare(auth_id, **kwargs) - - return self.api_client.call_api( - '/private/legacy/authorizations/{authID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def delete_legacy_authorizations_id_async(self, auth_id, **kwargs): # noqa: E501,D401,D403 - """Delete a legacy authorization. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str auth_id: The ID of the legacy authorization to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_legacy_authorizations_id_prepare(auth_id, **kwargs) - - return await self.api_client.call_api( - '/private/legacy/authorizations/{authID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _delete_legacy_authorizations_id_prepare(self, auth_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['auth_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('delete_legacy_authorizations_id', all_params, local_var_params) - # verify the required parameter 'auth_id' is set - if ('auth_id' not in local_var_params or - local_var_params['auth_id'] is None): - raise ValueError("Missing the required parameter `auth_id` when calling `delete_legacy_authorizations_id`") # noqa: E501 - - path_params = {} - if 'auth_id' in local_var_params: - path_params['authID'] = local_var_params['auth_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_legacy_authorizations(self, **kwargs): # noqa: E501,D401,D403 - """List all legacy authorizations. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_legacy_authorizations(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param str user_id: Only show legacy authorizations that belong to a user ID. - :param str user: Only show legacy authorizations that belong to a user name. - :param str org_id: Only show legacy authorizations that belong to an organization ID. - :param str org: Only show legacy authorizations that belong to a organization name. - :param str token: Only show legacy authorizations with a specified token (auth name). - :param str auth_id: Only show legacy authorizations with a specified auth ID. - :return: Authorizations - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_legacy_authorizations_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_legacy_authorizations_with_http_info(**kwargs) # noqa: E501 - return data - - def get_legacy_authorizations_with_http_info(self, **kwargs): # noqa: E501,D401,D403 - """List all legacy authorizations. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_legacy_authorizations_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param str user_id: Only show legacy authorizations that belong to a user ID. - :param str user: Only show legacy authorizations that belong to a user name. - :param str org_id: Only show legacy authorizations that belong to an organization ID. - :param str org: Only show legacy authorizations that belong to a organization name. - :param str token: Only show legacy authorizations with a specified token (auth name). - :param str auth_id: Only show legacy authorizations with a specified auth ID. - :return: Authorizations - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_legacy_authorizations_prepare(**kwargs) - - return self.api_client.call_api( - '/private/legacy/authorizations', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Authorizations', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_legacy_authorizations_async(self, **kwargs): # noqa: E501,D401,D403 - """List all legacy authorizations. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param str user_id: Only show legacy authorizations that belong to a user ID. - :param str user: Only show legacy authorizations that belong to a user name. - :param str org_id: Only show legacy authorizations that belong to an organization ID. - :param str org: Only show legacy authorizations that belong to a organization name. - :param str token: Only show legacy authorizations with a specified token (auth name). - :param str auth_id: Only show legacy authorizations with a specified auth ID. - :return: Authorizations - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_legacy_authorizations_prepare(**kwargs) - - return await self.api_client.call_api( - '/private/legacy/authorizations', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Authorizations', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_legacy_authorizations_prepare(self, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['zap_trace_span', 'user_id', 'user', 'org_id', 'org', 'token', 'auth_id'] # noqa: E501 - self._check_operation_params('get_legacy_authorizations', all_params, local_var_params) - - path_params = {} - - query_params = [] - if 'user_id' in local_var_params: - query_params.append(('userID', local_var_params['user_id'])) # noqa: E501 - if 'user' in local_var_params: - query_params.append(('user', local_var_params['user'])) # noqa: E501 - if 'org_id' in local_var_params: - query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501 - if 'org' in local_var_params: - query_params.append(('org', local_var_params['org'])) # noqa: E501 - if 'token' in local_var_params: - query_params.append(('token', local_var_params['token'])) # noqa: E501 - if 'auth_id' in local_var_params: - query_params.append(('authID', local_var_params['auth_id'])) # noqa: E501 - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_legacy_authorizations_id(self, auth_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a legacy authorization. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_legacy_authorizations_id(auth_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str auth_id: The ID of the legacy authorization to get. (required) - :param str zap_trace_span: OpenTracing span context - :return: Authorization - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_legacy_authorizations_id_with_http_info(auth_id, **kwargs) # noqa: E501 - else: - (data) = self.get_legacy_authorizations_id_with_http_info(auth_id, **kwargs) # noqa: E501 - return data - - def get_legacy_authorizations_id_with_http_info(self, auth_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a legacy authorization. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_legacy_authorizations_id_with_http_info(auth_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str auth_id: The ID of the legacy authorization to get. (required) - :param str zap_trace_span: OpenTracing span context - :return: Authorization - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_legacy_authorizations_id_prepare(auth_id, **kwargs) - - return self.api_client.call_api( - '/private/legacy/authorizations/{authID}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Authorization', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_legacy_authorizations_id_async(self, auth_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a legacy authorization. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str auth_id: The ID of the legacy authorization to get. (required) - :param str zap_trace_span: OpenTracing span context - :return: Authorization - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_legacy_authorizations_id_prepare(auth_id, **kwargs) - - return await self.api_client.call_api( - '/private/legacy/authorizations/{authID}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Authorization', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_legacy_authorizations_id_prepare(self, auth_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['auth_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_legacy_authorizations_id', all_params, local_var_params) - # verify the required parameter 'auth_id' is set - if ('auth_id' not in local_var_params or - local_var_params['auth_id'] is None): - raise ValueError("Missing the required parameter `auth_id` when calling `get_legacy_authorizations_id`") # noqa: E501 - - path_params = {} - if 'auth_id' in local_var_params: - path_params['authID'] = local_var_params['auth_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def patch_legacy_authorizations_id(self, auth_id, authorization_update_request, **kwargs): # noqa: E501,D401,D403 - """Update a legacy authorization to be active or inactive. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_legacy_authorizations_id(auth_id, authorization_update_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str auth_id: The ID of the legacy authorization to update. (required) - :param AuthorizationUpdateRequest authorization_update_request: Legacy authorization to update (required) - :param str zap_trace_span: OpenTracing span context - :return: Authorization - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.patch_legacy_authorizations_id_with_http_info(auth_id, authorization_update_request, **kwargs) # noqa: E501 - else: - (data) = self.patch_legacy_authorizations_id_with_http_info(auth_id, authorization_update_request, **kwargs) # noqa: E501 - return data - - def patch_legacy_authorizations_id_with_http_info(self, auth_id, authorization_update_request, **kwargs): # noqa: E501,D401,D403 - """Update a legacy authorization to be active or inactive. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_legacy_authorizations_id_with_http_info(auth_id, authorization_update_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str auth_id: The ID of the legacy authorization to update. (required) - :param AuthorizationUpdateRequest authorization_update_request: Legacy authorization to update (required) - :param str zap_trace_span: OpenTracing span context - :return: Authorization - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_legacy_authorizations_id_prepare(auth_id, authorization_update_request, **kwargs) - - return self.api_client.call_api( - '/private/legacy/authorizations/{authID}', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Authorization', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def patch_legacy_authorizations_id_async(self, auth_id, authorization_update_request, **kwargs): # noqa: E501,D401,D403 - """Update a legacy authorization to be active or inactive. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str auth_id: The ID of the legacy authorization to update. (required) - :param AuthorizationUpdateRequest authorization_update_request: Legacy authorization to update (required) - :param str zap_trace_span: OpenTracing span context - :return: Authorization - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_legacy_authorizations_id_prepare(auth_id, authorization_update_request, **kwargs) - - return await self.api_client.call_api( - '/private/legacy/authorizations/{authID}', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Authorization', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _patch_legacy_authorizations_id_prepare(self, auth_id, authorization_update_request, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['auth_id', 'authorization_update_request', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('patch_legacy_authorizations_id', all_params, local_var_params) - # verify the required parameter 'auth_id' is set - if ('auth_id' not in local_var_params or - local_var_params['auth_id'] is None): - raise ValueError("Missing the required parameter `auth_id` when calling `patch_legacy_authorizations_id`") # noqa: E501 - # verify the required parameter 'authorization_update_request' is set - if ('authorization_update_request' not in local_var_params or - local_var_params['authorization_update_request'] is None): - raise ValueError("Missing the required parameter `authorization_update_request` when calling `patch_legacy_authorizations_id`") # noqa: E501 - - path_params = {} - if 'auth_id' in local_var_params: - path_params['authID'] = local_var_params['auth_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'authorization_update_request' in local_var_params: - body_params = local_var_params['authorization_update_request'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_legacy_authorizations(self, legacy_authorization_post_request, **kwargs): # noqa: E501,D401,D403 - """Create a legacy authorization. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_legacy_authorizations(legacy_authorization_post_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param LegacyAuthorizationPostRequest legacy_authorization_post_request: Legacy authorization to create (required) - :param str zap_trace_span: OpenTracing span context - :return: Authorization - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_legacy_authorizations_with_http_info(legacy_authorization_post_request, **kwargs) # noqa: E501 - else: - (data) = self.post_legacy_authorizations_with_http_info(legacy_authorization_post_request, **kwargs) # noqa: E501 - return data - - def post_legacy_authorizations_with_http_info(self, legacy_authorization_post_request, **kwargs): # noqa: E501,D401,D403 - """Create a legacy authorization. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_legacy_authorizations_with_http_info(legacy_authorization_post_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param LegacyAuthorizationPostRequest legacy_authorization_post_request: Legacy authorization to create (required) - :param str zap_trace_span: OpenTracing span context - :return: Authorization - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_legacy_authorizations_prepare(legacy_authorization_post_request, **kwargs) - - return self.api_client.call_api( - '/private/legacy/authorizations', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Authorization', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_legacy_authorizations_async(self, legacy_authorization_post_request, **kwargs): # noqa: E501,D401,D403 - """Create a legacy authorization. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param LegacyAuthorizationPostRequest legacy_authorization_post_request: Legacy authorization to create (required) - :param str zap_trace_span: OpenTracing span context - :return: Authorization - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_legacy_authorizations_prepare(legacy_authorization_post_request, **kwargs) - - return await self.api_client.call_api( - '/private/legacy/authorizations', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Authorization', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_legacy_authorizations_prepare(self, legacy_authorization_post_request, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['legacy_authorization_post_request', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('post_legacy_authorizations', all_params, local_var_params) - # verify the required parameter 'legacy_authorization_post_request' is set - if ('legacy_authorization_post_request' not in local_var_params or - local_var_params['legacy_authorization_post_request'] is None): - raise ValueError("Missing the required parameter `legacy_authorization_post_request` when calling `post_legacy_authorizations`") # noqa: E501 - - path_params = {} - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'legacy_authorization_post_request' in local_var_params: - body_params = local_var_params['legacy_authorization_post_request'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_legacy_authorizations_id_password(self, auth_id, password_reset_body, **kwargs): # noqa: E501,D401,D403 - """Set a legacy authorization password. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_legacy_authorizations_id_password(auth_id, password_reset_body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str auth_id: The ID of the legacy authorization to update. (required) - :param PasswordResetBody password_reset_body: New password (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_legacy_authorizations_id_password_with_http_info(auth_id, password_reset_body, **kwargs) # noqa: E501 - else: - (data) = self.post_legacy_authorizations_id_password_with_http_info(auth_id, password_reset_body, **kwargs) # noqa: E501 - return data - - def post_legacy_authorizations_id_password_with_http_info(self, auth_id, password_reset_body, **kwargs): # noqa: E501,D401,D403 - """Set a legacy authorization password. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_legacy_authorizations_id_password_with_http_info(auth_id, password_reset_body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str auth_id: The ID of the legacy authorization to update. (required) - :param PasswordResetBody password_reset_body: New password (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_legacy_authorizations_id_password_prepare(auth_id, password_reset_body, **kwargs) - - return self.api_client.call_api( - '/private/legacy/authorizations/{authID}/password', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_legacy_authorizations_id_password_async(self, auth_id, password_reset_body, **kwargs): # noqa: E501,D401,D403 - """Set a legacy authorization password. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str auth_id: The ID of the legacy authorization to update. (required) - :param PasswordResetBody password_reset_body: New password (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_legacy_authorizations_id_password_prepare(auth_id, password_reset_body, **kwargs) - - return await self.api_client.call_api( - '/private/legacy/authorizations/{authID}/password', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_legacy_authorizations_id_password_prepare(self, auth_id, password_reset_body, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['auth_id', 'password_reset_body', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('post_legacy_authorizations_id_password', all_params, local_var_params) - # verify the required parameter 'auth_id' is set - if ('auth_id' not in local_var_params or - local_var_params['auth_id'] is None): - raise ValueError("Missing the required parameter `auth_id` when calling `post_legacy_authorizations_id_password`") # noqa: E501 - # verify the required parameter 'password_reset_body' is set - if ('password_reset_body' not in local_var_params or - local_var_params['password_reset_body'] is None): - raise ValueError("Missing the required parameter `password_reset_body` when calling `post_legacy_authorizations_id_password`") # noqa: E501 - - path_params = {} - if 'auth_id' in local_var_params: - path_params['authID'] = local_var_params['auth_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'password_reset_body' in local_var_params: - body_params = local_var_params['password_reset_body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params diff --git a/frogpilot/third_party/influxdb_client/service/metrics_service.py b/frogpilot/third_party/influxdb_client/service/metrics_service.py deleted file mode 100644 index 9e99de03..00000000 --- a/frogpilot/third_party/influxdb_client/service/metrics_service.py +++ /dev/null @@ -1,140 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -from influxdb_client.service._base_service import _BaseService - - -class MetricsService(_BaseService): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): # noqa: E501,D401,D403 - """MetricsService - a operation defined in OpenAPI.""" - super().__init__(api_client) - - def get_metrics(self, **kwargs): # noqa: E501,D401,D403 - """Retrieve workload performance metrics. - - Returns metrics about the workload performance of an InfluxDB instance. Use this endpoint to get performance, resource, and usage metrics. #### Related guides - For the list of metrics categories, see [InfluxDB OSS metrics](https://docs.influxdata.com/influxdb/latest/reference/internals/metrics/). - Learn how to use InfluxDB to [scrape Prometheus metrics](https://docs.influxdata.com/influxdb/latest/write-data/developer-tools/scrape-prometheus-metrics/). - Learn how InfluxDB [parses the Prometheus exposition format](https://docs.influxdata.com/influxdb/latest/reference/prometheus-metrics/). - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_metrics(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :return: str - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_metrics_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_metrics_with_http_info(**kwargs) # noqa: E501 - return data - - def get_metrics_with_http_info(self, **kwargs): # noqa: E501,D401,D403 - """Retrieve workload performance metrics. - - Returns metrics about the workload performance of an InfluxDB instance. Use this endpoint to get performance, resource, and usage metrics. #### Related guides - For the list of metrics categories, see [InfluxDB OSS metrics](https://docs.influxdata.com/influxdb/latest/reference/internals/metrics/). - Learn how to use InfluxDB to [scrape Prometheus metrics](https://docs.influxdata.com/influxdb/latest/write-data/developer-tools/scrape-prometheus-metrics/). - Learn how InfluxDB [parses the Prometheus exposition format](https://docs.influxdata.com/influxdb/latest/reference/prometheus-metrics/). - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_metrics_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :return: str - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_metrics_prepare(**kwargs) # noqa: E501 - - return self.api_client.call_api( - '/metrics', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='str', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_metrics_async(self, **kwargs): # noqa: E501,D401,D403 - """Retrieve workload performance metrics. - - Returns metrics about the workload performance of an InfluxDB instance. Use this endpoint to get performance, resource, and usage metrics. #### Related guides - For the list of metrics categories, see [InfluxDB OSS metrics](https://docs.influxdata.com/influxdb/latest/reference/internals/metrics/). - Learn how to use InfluxDB to [scrape Prometheus metrics](https://docs.influxdata.com/influxdb/latest/write-data/developer-tools/scrape-prometheus-metrics/). - Learn how InfluxDB [parses the Prometheus exposition format](https://docs.influxdata.com/influxdb/latest/reference/prometheus-metrics/). - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :return: str - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_metrics_prepare(**kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/metrics', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='str', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_metrics_prepare(self, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['zap_trace_span'] # noqa: E501 - self._check_operation_params('get_metrics', all_params, local_var_params) - - path_params = {} - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['text/plain', 'application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params diff --git a/frogpilot/third_party/influxdb_client/service/notification_endpoints_service.py b/frogpilot/third_party/influxdb_client/service/notification_endpoints_service.py deleted file mode 100644 index 151b486a..00000000 --- a/frogpilot/third_party/influxdb_client/service/notification_endpoints_service.py +++ /dev/null @@ -1,1137 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -from influxdb_client.service._base_service import _BaseService - - -class NotificationEndpointsService(_BaseService): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): # noqa: E501,D401,D403 - """NotificationEndpointsService - a operation defined in OpenAPI.""" - super().__init__(api_client) - - def create_notification_endpoint(self, post_notification_endpoint, **kwargs): # noqa: E501,D401,D403 - """Add a notification endpoint. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_notification_endpoint(post_notification_endpoint, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param PostNotificationEndpoint post_notification_endpoint: Notification endpoint to create (required) - :return: NotificationEndpoint - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_notification_endpoint_with_http_info(post_notification_endpoint, **kwargs) # noqa: E501 - else: - (data) = self.create_notification_endpoint_with_http_info(post_notification_endpoint, **kwargs) # noqa: E501 - return data - - def create_notification_endpoint_with_http_info(self, post_notification_endpoint, **kwargs): # noqa: E501,D401,D403 - """Add a notification endpoint. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_notification_endpoint_with_http_info(post_notification_endpoint, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param PostNotificationEndpoint post_notification_endpoint: Notification endpoint to create (required) - :return: NotificationEndpoint - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._create_notification_endpoint_prepare(post_notification_endpoint, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/notificationEndpoints', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='NotificationEndpoint', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def create_notification_endpoint_async(self, post_notification_endpoint, **kwargs): # noqa: E501,D401,D403 - """Add a notification endpoint. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param PostNotificationEndpoint post_notification_endpoint: Notification endpoint to create (required) - :return: NotificationEndpoint - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._create_notification_endpoint_prepare(post_notification_endpoint, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/notificationEndpoints', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='NotificationEndpoint', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _create_notification_endpoint_prepare(self, post_notification_endpoint, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['post_notification_endpoint'] # noqa: E501 - self._check_operation_params('create_notification_endpoint', all_params, local_var_params) - # verify the required parameter 'post_notification_endpoint' is set - if ('post_notification_endpoint' not in local_var_params or - local_var_params['post_notification_endpoint'] is None): - raise ValueError("Missing the required parameter `post_notification_endpoint` when calling `create_notification_endpoint`") # noqa: E501 - - path_params = {} - - query_params = [] - - header_params = {} - - body_params = None - if 'post_notification_endpoint' in local_var_params: - body_params = local_var_params['post_notification_endpoint'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def delete_notification_endpoints_id(self, endpoint_id, **kwargs): # noqa: E501,D401,D403 - """Delete a notification endpoint. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_notification_endpoints_id(endpoint_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str endpoint_id: The notification endpoint ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_notification_endpoints_id_with_http_info(endpoint_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_notification_endpoints_id_with_http_info(endpoint_id, **kwargs) # noqa: E501 - return data - - def delete_notification_endpoints_id_with_http_info(self, endpoint_id, **kwargs): # noqa: E501,D401,D403 - """Delete a notification endpoint. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_notification_endpoints_id_with_http_info(endpoint_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str endpoint_id: The notification endpoint ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_notification_endpoints_id_prepare(endpoint_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/notificationEndpoints/{endpointID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def delete_notification_endpoints_id_async(self, endpoint_id, **kwargs): # noqa: E501,D401,D403 - """Delete a notification endpoint. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str endpoint_id: The notification endpoint ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_notification_endpoints_id_prepare(endpoint_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/notificationEndpoints/{endpointID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _delete_notification_endpoints_id_prepare(self, endpoint_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['endpoint_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('delete_notification_endpoints_id', all_params, local_var_params) - # verify the required parameter 'endpoint_id' is set - if ('endpoint_id' not in local_var_params or - local_var_params['endpoint_id'] is None): - raise ValueError("Missing the required parameter `endpoint_id` when calling `delete_notification_endpoints_id`") # noqa: E501 - - path_params = {} - if 'endpoint_id' in local_var_params: - path_params['endpointID'] = local_var_params['endpoint_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def delete_notification_endpoints_id_labels_id(self, endpoint_id, label_id, **kwargs): # noqa: E501,D401,D403 - """Delete a label from a notification endpoint. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_notification_endpoints_id_labels_id(endpoint_id, label_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str endpoint_id: The notification endpoint ID. (required) - :param str label_id: The ID of the label to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_notification_endpoints_id_labels_id_with_http_info(endpoint_id, label_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_notification_endpoints_id_labels_id_with_http_info(endpoint_id, label_id, **kwargs) # noqa: E501 - return data - - def delete_notification_endpoints_id_labels_id_with_http_info(self, endpoint_id, label_id, **kwargs): # noqa: E501,D401,D403 - """Delete a label from a notification endpoint. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_notification_endpoints_id_labels_id_with_http_info(endpoint_id, label_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str endpoint_id: The notification endpoint ID. (required) - :param str label_id: The ID of the label to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_notification_endpoints_id_labels_id_prepare(endpoint_id, label_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/notificationEndpoints/{endpointID}/labels/{labelID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def delete_notification_endpoints_id_labels_id_async(self, endpoint_id, label_id, **kwargs): # noqa: E501,D401,D403 - """Delete a label from a notification endpoint. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str endpoint_id: The notification endpoint ID. (required) - :param str label_id: The ID of the label to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_notification_endpoints_id_labels_id_prepare(endpoint_id, label_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/notificationEndpoints/{endpointID}/labels/{labelID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _delete_notification_endpoints_id_labels_id_prepare(self, endpoint_id, label_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['endpoint_id', 'label_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('delete_notification_endpoints_id_labels_id', all_params, local_var_params) - # verify the required parameter 'endpoint_id' is set - if ('endpoint_id' not in local_var_params or - local_var_params['endpoint_id'] is None): - raise ValueError("Missing the required parameter `endpoint_id` when calling `delete_notification_endpoints_id_labels_id`") # noqa: E501 - # verify the required parameter 'label_id' is set - if ('label_id' not in local_var_params or - local_var_params['label_id'] is None): - raise ValueError("Missing the required parameter `label_id` when calling `delete_notification_endpoints_id_labels_id`") # noqa: E501 - - path_params = {} - if 'endpoint_id' in local_var_params: - path_params['endpointID'] = local_var_params['endpoint_id'] # noqa: E501 - if 'label_id' in local_var_params: - path_params['labelID'] = local_var_params['label_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_notification_endpoints(self, org_id, **kwargs): # noqa: E501,D401,D403 - """List all notification endpoints. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_notification_endpoints(org_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str org_id: Only show notification endpoints that belong to specific organization ID. (required) - :param str zap_trace_span: OpenTracing span context - :param int offset: The offset for pagination. The number of records to skip. For more information about pagination parameters, see [Pagination](https://docs.influxdata.com/influxdb/latest/api/#tag/Pagination). - :param int limit: Limits the number of records returned. Default is `20`. - :return: NotificationEndpoints - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_notification_endpoints_with_http_info(org_id, **kwargs) # noqa: E501 - else: - (data) = self.get_notification_endpoints_with_http_info(org_id, **kwargs) # noqa: E501 - return data - - def get_notification_endpoints_with_http_info(self, org_id, **kwargs): # noqa: E501,D401,D403 - """List all notification endpoints. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_notification_endpoints_with_http_info(org_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str org_id: Only show notification endpoints that belong to specific organization ID. (required) - :param str zap_trace_span: OpenTracing span context - :param int offset: The offset for pagination. The number of records to skip. For more information about pagination parameters, see [Pagination](https://docs.influxdata.com/influxdb/latest/api/#tag/Pagination). - :param int limit: Limits the number of records returned. Default is `20`. - :return: NotificationEndpoints - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_notification_endpoints_prepare(org_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/notificationEndpoints', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='NotificationEndpoints', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_notification_endpoints_async(self, org_id, **kwargs): # noqa: E501,D401,D403 - """List all notification endpoints. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str org_id: Only show notification endpoints that belong to specific organization ID. (required) - :param str zap_trace_span: OpenTracing span context - :param int offset: The offset for pagination. The number of records to skip. For more information about pagination parameters, see [Pagination](https://docs.influxdata.com/influxdb/latest/api/#tag/Pagination). - :param int limit: Limits the number of records returned. Default is `20`. - :return: NotificationEndpoints - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_notification_endpoints_prepare(org_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/notificationEndpoints', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='NotificationEndpoints', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_notification_endpoints_prepare(self, org_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['org_id', 'zap_trace_span', 'offset', 'limit'] # noqa: E501 - self._check_operation_params('get_notification_endpoints', all_params, local_var_params) - # verify the required parameter 'org_id' is set - if ('org_id' not in local_var_params or - local_var_params['org_id'] is None): - raise ValueError("Missing the required parameter `org_id` when calling `get_notification_endpoints`") # noqa: E501 - - if 'offset' in local_var_params and local_var_params['offset'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `offset` when calling `get_notification_endpoints`, must be a value greater than or equal to `0`") # noqa: E501 - if 'limit' in local_var_params and local_var_params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `get_notification_endpoints`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `get_notification_endpoints`, must be a value greater than or equal to `1`") # noqa: E501 - path_params = {} - - query_params = [] - if 'offset' in local_var_params: - query_params.append(('offset', local_var_params['offset'])) # noqa: E501 - if 'limit' in local_var_params: - query_params.append(('limit', local_var_params['limit'])) # noqa: E501 - if 'org_id' in local_var_params: - query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501 - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_notification_endpoints_id(self, endpoint_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a notification endpoint. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_notification_endpoints_id(endpoint_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str endpoint_id: The notification endpoint ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: NotificationEndpoint - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_notification_endpoints_id_with_http_info(endpoint_id, **kwargs) # noqa: E501 - else: - (data) = self.get_notification_endpoints_id_with_http_info(endpoint_id, **kwargs) # noqa: E501 - return data - - def get_notification_endpoints_id_with_http_info(self, endpoint_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a notification endpoint. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_notification_endpoints_id_with_http_info(endpoint_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str endpoint_id: The notification endpoint ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: NotificationEndpoint - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_notification_endpoints_id_prepare(endpoint_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/notificationEndpoints/{endpointID}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='NotificationEndpoint', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_notification_endpoints_id_async(self, endpoint_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a notification endpoint. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str endpoint_id: The notification endpoint ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: NotificationEndpoint - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_notification_endpoints_id_prepare(endpoint_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/notificationEndpoints/{endpointID}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='NotificationEndpoint', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_notification_endpoints_id_prepare(self, endpoint_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['endpoint_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_notification_endpoints_id', all_params, local_var_params) - # verify the required parameter 'endpoint_id' is set - if ('endpoint_id' not in local_var_params or - local_var_params['endpoint_id'] is None): - raise ValueError("Missing the required parameter `endpoint_id` when calling `get_notification_endpoints_id`") # noqa: E501 - - path_params = {} - if 'endpoint_id' in local_var_params: - path_params['endpointID'] = local_var_params['endpoint_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_notification_endpoints_id_labels(self, endpoint_id, **kwargs): # noqa: E501,D401,D403 - """List all labels for a notification endpoint. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_notification_endpoints_id_labels(endpoint_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str endpoint_id: The notification endpoint ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelsResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_notification_endpoints_id_labels_with_http_info(endpoint_id, **kwargs) # noqa: E501 - else: - (data) = self.get_notification_endpoints_id_labels_with_http_info(endpoint_id, **kwargs) # noqa: E501 - return data - - def get_notification_endpoints_id_labels_with_http_info(self, endpoint_id, **kwargs): # noqa: E501,D401,D403 - """List all labels for a notification endpoint. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_notification_endpoints_id_labels_with_http_info(endpoint_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str endpoint_id: The notification endpoint ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelsResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_notification_endpoints_id_labels_prepare(endpoint_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/notificationEndpoints/{endpointID}/labels', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='LabelsResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_notification_endpoints_id_labels_async(self, endpoint_id, **kwargs): # noqa: E501,D401,D403 - """List all labels for a notification endpoint. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str endpoint_id: The notification endpoint ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelsResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_notification_endpoints_id_labels_prepare(endpoint_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/notificationEndpoints/{endpointID}/labels', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='LabelsResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_notification_endpoints_id_labels_prepare(self, endpoint_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['endpoint_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_notification_endpoints_id_labels', all_params, local_var_params) - # verify the required parameter 'endpoint_id' is set - if ('endpoint_id' not in local_var_params or - local_var_params['endpoint_id'] is None): - raise ValueError("Missing the required parameter `endpoint_id` when calling `get_notification_endpoints_id_labels`") # noqa: E501 - - path_params = {} - if 'endpoint_id' in local_var_params: - path_params['endpointID'] = local_var_params['endpoint_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def patch_notification_endpoints_id(self, endpoint_id, notification_endpoint_update, **kwargs): # noqa: E501,D401,D403 - """Update a notification endpoint. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_notification_endpoints_id(endpoint_id, notification_endpoint_update, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str endpoint_id: The notification endpoint ID. (required) - :param NotificationEndpointUpdate notification_endpoint_update: Check update to apply (required) - :param str zap_trace_span: OpenTracing span context - :return: NotificationEndpoint - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.patch_notification_endpoints_id_with_http_info(endpoint_id, notification_endpoint_update, **kwargs) # noqa: E501 - else: - (data) = self.patch_notification_endpoints_id_with_http_info(endpoint_id, notification_endpoint_update, **kwargs) # noqa: E501 - return data - - def patch_notification_endpoints_id_with_http_info(self, endpoint_id, notification_endpoint_update, **kwargs): # noqa: E501,D401,D403 - """Update a notification endpoint. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_notification_endpoints_id_with_http_info(endpoint_id, notification_endpoint_update, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str endpoint_id: The notification endpoint ID. (required) - :param NotificationEndpointUpdate notification_endpoint_update: Check update to apply (required) - :param str zap_trace_span: OpenTracing span context - :return: NotificationEndpoint - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_notification_endpoints_id_prepare(endpoint_id, notification_endpoint_update, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/notificationEndpoints/{endpointID}', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='NotificationEndpoint', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def patch_notification_endpoints_id_async(self, endpoint_id, notification_endpoint_update, **kwargs): # noqa: E501,D401,D403 - """Update a notification endpoint. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str endpoint_id: The notification endpoint ID. (required) - :param NotificationEndpointUpdate notification_endpoint_update: Check update to apply (required) - :param str zap_trace_span: OpenTracing span context - :return: NotificationEndpoint - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_notification_endpoints_id_prepare(endpoint_id, notification_endpoint_update, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/notificationEndpoints/{endpointID}', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='NotificationEndpoint', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _patch_notification_endpoints_id_prepare(self, endpoint_id, notification_endpoint_update, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['endpoint_id', 'notification_endpoint_update', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('patch_notification_endpoints_id', all_params, local_var_params) - # verify the required parameter 'endpoint_id' is set - if ('endpoint_id' not in local_var_params or - local_var_params['endpoint_id'] is None): - raise ValueError("Missing the required parameter `endpoint_id` when calling `patch_notification_endpoints_id`") # noqa: E501 - # verify the required parameter 'notification_endpoint_update' is set - if ('notification_endpoint_update' not in local_var_params or - local_var_params['notification_endpoint_update'] is None): - raise ValueError("Missing the required parameter `notification_endpoint_update` when calling `patch_notification_endpoints_id`") # noqa: E501 - - path_params = {} - if 'endpoint_id' in local_var_params: - path_params['endpointID'] = local_var_params['endpoint_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'notification_endpoint_update' in local_var_params: - body_params = local_var_params['notification_endpoint_update'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_notification_endpoint_id_labels(self, endpoint_id, label_mapping, **kwargs): # noqa: E501,D401,D403 - """Add a label to a notification endpoint. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_notification_endpoint_id_labels(endpoint_id, label_mapping, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str endpoint_id: The notification endpoint ID. (required) - :param LabelMapping label_mapping: Label to add (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_notification_endpoint_id_labels_with_http_info(endpoint_id, label_mapping, **kwargs) # noqa: E501 - else: - (data) = self.post_notification_endpoint_id_labels_with_http_info(endpoint_id, label_mapping, **kwargs) # noqa: E501 - return data - - def post_notification_endpoint_id_labels_with_http_info(self, endpoint_id, label_mapping, **kwargs): # noqa: E501,D401,D403 - """Add a label to a notification endpoint. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_notification_endpoint_id_labels_with_http_info(endpoint_id, label_mapping, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str endpoint_id: The notification endpoint ID. (required) - :param LabelMapping label_mapping: Label to add (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_notification_endpoint_id_labels_prepare(endpoint_id, label_mapping, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/notificationEndpoints/{endpointID}/labels', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='LabelResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_notification_endpoint_id_labels_async(self, endpoint_id, label_mapping, **kwargs): # noqa: E501,D401,D403 - """Add a label to a notification endpoint. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str endpoint_id: The notification endpoint ID. (required) - :param LabelMapping label_mapping: Label to add (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_notification_endpoint_id_labels_prepare(endpoint_id, label_mapping, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/notificationEndpoints/{endpointID}/labels', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='LabelResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_notification_endpoint_id_labels_prepare(self, endpoint_id, label_mapping, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['endpoint_id', 'label_mapping', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('post_notification_endpoint_id_labels', all_params, local_var_params) - # verify the required parameter 'endpoint_id' is set - if ('endpoint_id' not in local_var_params or - local_var_params['endpoint_id'] is None): - raise ValueError("Missing the required parameter `endpoint_id` when calling `post_notification_endpoint_id_labels`") # noqa: E501 - # verify the required parameter 'label_mapping' is set - if ('label_mapping' not in local_var_params or - local_var_params['label_mapping'] is None): - raise ValueError("Missing the required parameter `label_mapping` when calling `post_notification_endpoint_id_labels`") # noqa: E501 - - path_params = {} - if 'endpoint_id' in local_var_params: - path_params['endpointID'] = local_var_params['endpoint_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'label_mapping' in local_var_params: - body_params = local_var_params['label_mapping'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def put_notification_endpoints_id(self, endpoint_id, notification_endpoint, **kwargs): # noqa: E501,D401,D403 - """Update a notification endpoint. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.put_notification_endpoints_id(endpoint_id, notification_endpoint, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str endpoint_id: The notification endpoint ID. (required) - :param NotificationEndpoint notification_endpoint: A new notification endpoint to replace the existing endpoint with (required) - :param str zap_trace_span: OpenTracing span context - :return: NotificationEndpoint - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.put_notification_endpoints_id_with_http_info(endpoint_id, notification_endpoint, **kwargs) # noqa: E501 - else: - (data) = self.put_notification_endpoints_id_with_http_info(endpoint_id, notification_endpoint, **kwargs) # noqa: E501 - return data - - def put_notification_endpoints_id_with_http_info(self, endpoint_id, notification_endpoint, **kwargs): # noqa: E501,D401,D403 - """Update a notification endpoint. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.put_notification_endpoints_id_with_http_info(endpoint_id, notification_endpoint, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str endpoint_id: The notification endpoint ID. (required) - :param NotificationEndpoint notification_endpoint: A new notification endpoint to replace the existing endpoint with (required) - :param str zap_trace_span: OpenTracing span context - :return: NotificationEndpoint - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._put_notification_endpoints_id_prepare(endpoint_id, notification_endpoint, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/notificationEndpoints/{endpointID}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='NotificationEndpoint', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def put_notification_endpoints_id_async(self, endpoint_id, notification_endpoint, **kwargs): # noqa: E501,D401,D403 - """Update a notification endpoint. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str endpoint_id: The notification endpoint ID. (required) - :param NotificationEndpoint notification_endpoint: A new notification endpoint to replace the existing endpoint with (required) - :param str zap_trace_span: OpenTracing span context - :return: NotificationEndpoint - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._put_notification_endpoints_id_prepare(endpoint_id, notification_endpoint, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/notificationEndpoints/{endpointID}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='NotificationEndpoint', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _put_notification_endpoints_id_prepare(self, endpoint_id, notification_endpoint, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['endpoint_id', 'notification_endpoint', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('put_notification_endpoints_id', all_params, local_var_params) - # verify the required parameter 'endpoint_id' is set - if ('endpoint_id' not in local_var_params or - local_var_params['endpoint_id'] is None): - raise ValueError("Missing the required parameter `endpoint_id` when calling `put_notification_endpoints_id`") # noqa: E501 - # verify the required parameter 'notification_endpoint' is set - if ('notification_endpoint' not in local_var_params or - local_var_params['notification_endpoint'] is None): - raise ValueError("Missing the required parameter `notification_endpoint` when calling `put_notification_endpoints_id`") # noqa: E501 - - path_params = {} - if 'endpoint_id' in local_var_params: - path_params['endpointID'] = local_var_params['endpoint_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'notification_endpoint' in local_var_params: - body_params = local_var_params['notification_endpoint'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params diff --git a/frogpilot/third_party/influxdb_client/service/notification_rules_service.py b/frogpilot/third_party/influxdb_client/service/notification_rules_service.py deleted file mode 100644 index 208feebb..00000000 --- a/frogpilot/third_party/influxdb_client/service/notification_rules_service.py +++ /dev/null @@ -1,1149 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -from influxdb_client.service._base_service import _BaseService - - -class NotificationRulesService(_BaseService): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): # noqa: E501,D401,D403 - """NotificationRulesService - a operation defined in OpenAPI.""" - super().__init__(api_client) - - def create_notification_rule(self, post_notification_rule, **kwargs): # noqa: E501,D401,D403 - """Add a notification rule. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_notification_rule(post_notification_rule, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param PostNotificationRule post_notification_rule: Notification rule to create (required) - :return: NotificationRule - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_notification_rule_with_http_info(post_notification_rule, **kwargs) # noqa: E501 - else: - (data) = self.create_notification_rule_with_http_info(post_notification_rule, **kwargs) # noqa: E501 - return data - - def create_notification_rule_with_http_info(self, post_notification_rule, **kwargs): # noqa: E501,D401,D403 - """Add a notification rule. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_notification_rule_with_http_info(post_notification_rule, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param PostNotificationRule post_notification_rule: Notification rule to create (required) - :return: NotificationRule - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._create_notification_rule_prepare(post_notification_rule, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/notificationRules', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='NotificationRule', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def create_notification_rule_async(self, post_notification_rule, **kwargs): # noqa: E501,D401,D403 - """Add a notification rule. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param PostNotificationRule post_notification_rule: Notification rule to create (required) - :return: NotificationRule - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._create_notification_rule_prepare(post_notification_rule, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/notificationRules', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='NotificationRule', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _create_notification_rule_prepare(self, post_notification_rule, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['post_notification_rule'] # noqa: E501 - self._check_operation_params('create_notification_rule', all_params, local_var_params) - # verify the required parameter 'post_notification_rule' is set - if ('post_notification_rule' not in local_var_params or - local_var_params['post_notification_rule'] is None): - raise ValueError("Missing the required parameter `post_notification_rule` when calling `create_notification_rule`") # noqa: E501 - - path_params = {} - - query_params = [] - - header_params = {} - - body_params = None - if 'post_notification_rule' in local_var_params: - body_params = local_var_params['post_notification_rule'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def delete_notification_rules_id(self, rule_id, **kwargs): # noqa: E501,D401,D403 - """Delete a notification rule. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_notification_rules_id(rule_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str rule_id: The notification rule ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_notification_rules_id_with_http_info(rule_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_notification_rules_id_with_http_info(rule_id, **kwargs) # noqa: E501 - return data - - def delete_notification_rules_id_with_http_info(self, rule_id, **kwargs): # noqa: E501,D401,D403 - """Delete a notification rule. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_notification_rules_id_with_http_info(rule_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str rule_id: The notification rule ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_notification_rules_id_prepare(rule_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/notificationRules/{ruleID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def delete_notification_rules_id_async(self, rule_id, **kwargs): # noqa: E501,D401,D403 - """Delete a notification rule. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str rule_id: The notification rule ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_notification_rules_id_prepare(rule_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/notificationRules/{ruleID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _delete_notification_rules_id_prepare(self, rule_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['rule_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('delete_notification_rules_id', all_params, local_var_params) - # verify the required parameter 'rule_id' is set - if ('rule_id' not in local_var_params or - local_var_params['rule_id'] is None): - raise ValueError("Missing the required parameter `rule_id` when calling `delete_notification_rules_id`") # noqa: E501 - - path_params = {} - if 'rule_id' in local_var_params: - path_params['ruleID'] = local_var_params['rule_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def delete_notification_rules_id_labels_id(self, rule_id, label_id, **kwargs): # noqa: E501,D401,D403 - """Delete label from a notification rule. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_notification_rules_id_labels_id(rule_id, label_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str rule_id: The notification rule ID. (required) - :param str label_id: The ID of the label to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_notification_rules_id_labels_id_with_http_info(rule_id, label_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_notification_rules_id_labels_id_with_http_info(rule_id, label_id, **kwargs) # noqa: E501 - return data - - def delete_notification_rules_id_labels_id_with_http_info(self, rule_id, label_id, **kwargs): # noqa: E501,D401,D403 - """Delete label from a notification rule. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_notification_rules_id_labels_id_with_http_info(rule_id, label_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str rule_id: The notification rule ID. (required) - :param str label_id: The ID of the label to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_notification_rules_id_labels_id_prepare(rule_id, label_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/notificationRules/{ruleID}/labels/{labelID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def delete_notification_rules_id_labels_id_async(self, rule_id, label_id, **kwargs): # noqa: E501,D401,D403 - """Delete label from a notification rule. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str rule_id: The notification rule ID. (required) - :param str label_id: The ID of the label to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_notification_rules_id_labels_id_prepare(rule_id, label_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/notificationRules/{ruleID}/labels/{labelID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _delete_notification_rules_id_labels_id_prepare(self, rule_id, label_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['rule_id', 'label_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('delete_notification_rules_id_labels_id', all_params, local_var_params) - # verify the required parameter 'rule_id' is set - if ('rule_id' not in local_var_params or - local_var_params['rule_id'] is None): - raise ValueError("Missing the required parameter `rule_id` when calling `delete_notification_rules_id_labels_id`") # noqa: E501 - # verify the required parameter 'label_id' is set - if ('label_id' not in local_var_params or - local_var_params['label_id'] is None): - raise ValueError("Missing the required parameter `label_id` when calling `delete_notification_rules_id_labels_id`") # noqa: E501 - - path_params = {} - if 'rule_id' in local_var_params: - path_params['ruleID'] = local_var_params['rule_id'] # noqa: E501 - if 'label_id' in local_var_params: - path_params['labelID'] = local_var_params['label_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_notification_rules(self, org_id, **kwargs): # noqa: E501,D401,D403 - """List all notification rules. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_notification_rules(org_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str org_id: Only show notification rules that belong to a specific organization ID. (required) - :param str zap_trace_span: OpenTracing span context - :param int offset: The offset for pagination. The number of records to skip. For more information about pagination parameters, see [Pagination](https://docs.influxdata.com/influxdb/latest/api/#tag/Pagination). - :param int limit: Limits the number of records returned. Default is `20`. - :param str check_id: Only show notifications that belong to the specific check ID. - :param str tag: Only return notification rules that "would match" statuses which contain the tag key value pairs provided. - :return: NotificationRules - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_notification_rules_with_http_info(org_id, **kwargs) # noqa: E501 - else: - (data) = self.get_notification_rules_with_http_info(org_id, **kwargs) # noqa: E501 - return data - - def get_notification_rules_with_http_info(self, org_id, **kwargs): # noqa: E501,D401,D403 - """List all notification rules. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_notification_rules_with_http_info(org_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str org_id: Only show notification rules that belong to a specific organization ID. (required) - :param str zap_trace_span: OpenTracing span context - :param int offset: The offset for pagination. The number of records to skip. For more information about pagination parameters, see [Pagination](https://docs.influxdata.com/influxdb/latest/api/#tag/Pagination). - :param int limit: Limits the number of records returned. Default is `20`. - :param str check_id: Only show notifications that belong to the specific check ID. - :param str tag: Only return notification rules that "would match" statuses which contain the tag key value pairs provided. - :return: NotificationRules - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_notification_rules_prepare(org_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/notificationRules', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='NotificationRules', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_notification_rules_async(self, org_id, **kwargs): # noqa: E501,D401,D403 - """List all notification rules. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str org_id: Only show notification rules that belong to a specific organization ID. (required) - :param str zap_trace_span: OpenTracing span context - :param int offset: The offset for pagination. The number of records to skip. For more information about pagination parameters, see [Pagination](https://docs.influxdata.com/influxdb/latest/api/#tag/Pagination). - :param int limit: Limits the number of records returned. Default is `20`. - :param str check_id: Only show notifications that belong to the specific check ID. - :param str tag: Only return notification rules that "would match" statuses which contain the tag key value pairs provided. - :return: NotificationRules - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_notification_rules_prepare(org_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/notificationRules', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='NotificationRules', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_notification_rules_prepare(self, org_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['org_id', 'zap_trace_span', 'offset', 'limit', 'check_id', 'tag'] # noqa: E501 - self._check_operation_params('get_notification_rules', all_params, local_var_params) - # verify the required parameter 'org_id' is set - if ('org_id' not in local_var_params or - local_var_params['org_id'] is None): - raise ValueError("Missing the required parameter `org_id` when calling `get_notification_rules`") # noqa: E501 - - if 'offset' in local_var_params and local_var_params['offset'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `offset` when calling `get_notification_rules`, must be a value greater than or equal to `0`") # noqa: E501 - if 'limit' in local_var_params and local_var_params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `get_notification_rules`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `get_notification_rules`, must be a value greater than or equal to `1`") # noqa: E501 - if 'tag' in local_var_params and not re.search(r'^[a-zA-Z0-9_]+:[a-zA-Z0-9_]+$', local_var_params['tag']): # noqa: E501 - raise ValueError("Invalid value for parameter `tag` when calling `get_notification_rules`, must conform to the pattern `/^[a-zA-Z0-9_]+:[a-zA-Z0-9_]+$/`") # noqa: E501 - path_params = {} - - query_params = [] - if 'offset' in local_var_params: - query_params.append(('offset', local_var_params['offset'])) # noqa: E501 - if 'limit' in local_var_params: - query_params.append(('limit', local_var_params['limit'])) # noqa: E501 - if 'org_id' in local_var_params: - query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501 - if 'check_id' in local_var_params: - query_params.append(('checkID', local_var_params['check_id'])) # noqa: E501 - if 'tag' in local_var_params: - query_params.append(('tag', local_var_params['tag'])) # noqa: E501 - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_notification_rules_id(self, rule_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a notification rule. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_notification_rules_id(rule_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str rule_id: The notification rule ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: NotificationRule - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_notification_rules_id_with_http_info(rule_id, **kwargs) # noqa: E501 - else: - (data) = self.get_notification_rules_id_with_http_info(rule_id, **kwargs) # noqa: E501 - return data - - def get_notification_rules_id_with_http_info(self, rule_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a notification rule. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_notification_rules_id_with_http_info(rule_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str rule_id: The notification rule ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: NotificationRule - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_notification_rules_id_prepare(rule_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/notificationRules/{ruleID}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='NotificationRule', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_notification_rules_id_async(self, rule_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a notification rule. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str rule_id: The notification rule ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: NotificationRule - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_notification_rules_id_prepare(rule_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/notificationRules/{ruleID}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='NotificationRule', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_notification_rules_id_prepare(self, rule_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['rule_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_notification_rules_id', all_params, local_var_params) - # verify the required parameter 'rule_id' is set - if ('rule_id' not in local_var_params or - local_var_params['rule_id'] is None): - raise ValueError("Missing the required parameter `rule_id` when calling `get_notification_rules_id`") # noqa: E501 - - path_params = {} - if 'rule_id' in local_var_params: - path_params['ruleID'] = local_var_params['rule_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_notification_rules_id_labels(self, rule_id, **kwargs): # noqa: E501,D401,D403 - """List all labels for a notification rule. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_notification_rules_id_labels(rule_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str rule_id: The notification rule ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelsResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_notification_rules_id_labels_with_http_info(rule_id, **kwargs) # noqa: E501 - else: - (data) = self.get_notification_rules_id_labels_with_http_info(rule_id, **kwargs) # noqa: E501 - return data - - def get_notification_rules_id_labels_with_http_info(self, rule_id, **kwargs): # noqa: E501,D401,D403 - """List all labels for a notification rule. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_notification_rules_id_labels_with_http_info(rule_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str rule_id: The notification rule ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelsResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_notification_rules_id_labels_prepare(rule_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/notificationRules/{ruleID}/labels', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='LabelsResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_notification_rules_id_labels_async(self, rule_id, **kwargs): # noqa: E501,D401,D403 - """List all labels for a notification rule. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str rule_id: The notification rule ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelsResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_notification_rules_id_labels_prepare(rule_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/notificationRules/{ruleID}/labels', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='LabelsResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_notification_rules_id_labels_prepare(self, rule_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['rule_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_notification_rules_id_labels', all_params, local_var_params) - # verify the required parameter 'rule_id' is set - if ('rule_id' not in local_var_params or - local_var_params['rule_id'] is None): - raise ValueError("Missing the required parameter `rule_id` when calling `get_notification_rules_id_labels`") # noqa: E501 - - path_params = {} - if 'rule_id' in local_var_params: - path_params['ruleID'] = local_var_params['rule_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def patch_notification_rules_id(self, rule_id, notification_rule_update, **kwargs): # noqa: E501,D401,D403 - """Update a notification rule. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_notification_rules_id(rule_id, notification_rule_update, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str rule_id: The notification rule ID. (required) - :param NotificationRuleUpdate notification_rule_update: Notification rule update to apply (required) - :param str zap_trace_span: OpenTracing span context - :return: NotificationRule - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.patch_notification_rules_id_with_http_info(rule_id, notification_rule_update, **kwargs) # noqa: E501 - else: - (data) = self.patch_notification_rules_id_with_http_info(rule_id, notification_rule_update, **kwargs) # noqa: E501 - return data - - def patch_notification_rules_id_with_http_info(self, rule_id, notification_rule_update, **kwargs): # noqa: E501,D401,D403 - """Update a notification rule. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_notification_rules_id_with_http_info(rule_id, notification_rule_update, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str rule_id: The notification rule ID. (required) - :param NotificationRuleUpdate notification_rule_update: Notification rule update to apply (required) - :param str zap_trace_span: OpenTracing span context - :return: NotificationRule - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_notification_rules_id_prepare(rule_id, notification_rule_update, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/notificationRules/{ruleID}', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='NotificationRule', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def patch_notification_rules_id_async(self, rule_id, notification_rule_update, **kwargs): # noqa: E501,D401,D403 - """Update a notification rule. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str rule_id: The notification rule ID. (required) - :param NotificationRuleUpdate notification_rule_update: Notification rule update to apply (required) - :param str zap_trace_span: OpenTracing span context - :return: NotificationRule - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_notification_rules_id_prepare(rule_id, notification_rule_update, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/notificationRules/{ruleID}', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='NotificationRule', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _patch_notification_rules_id_prepare(self, rule_id, notification_rule_update, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['rule_id', 'notification_rule_update', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('patch_notification_rules_id', all_params, local_var_params) - # verify the required parameter 'rule_id' is set - if ('rule_id' not in local_var_params or - local_var_params['rule_id'] is None): - raise ValueError("Missing the required parameter `rule_id` when calling `patch_notification_rules_id`") # noqa: E501 - # verify the required parameter 'notification_rule_update' is set - if ('notification_rule_update' not in local_var_params or - local_var_params['notification_rule_update'] is None): - raise ValueError("Missing the required parameter `notification_rule_update` when calling `patch_notification_rules_id`") # noqa: E501 - - path_params = {} - if 'rule_id' in local_var_params: - path_params['ruleID'] = local_var_params['rule_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'notification_rule_update' in local_var_params: - body_params = local_var_params['notification_rule_update'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_notification_rule_id_labels(self, rule_id, label_mapping, **kwargs): # noqa: E501,D401,D403 - """Add a label to a notification rule. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_notification_rule_id_labels(rule_id, label_mapping, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str rule_id: The notification rule ID. (required) - :param LabelMapping label_mapping: Label to add (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_notification_rule_id_labels_with_http_info(rule_id, label_mapping, **kwargs) # noqa: E501 - else: - (data) = self.post_notification_rule_id_labels_with_http_info(rule_id, label_mapping, **kwargs) # noqa: E501 - return data - - def post_notification_rule_id_labels_with_http_info(self, rule_id, label_mapping, **kwargs): # noqa: E501,D401,D403 - """Add a label to a notification rule. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_notification_rule_id_labels_with_http_info(rule_id, label_mapping, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str rule_id: The notification rule ID. (required) - :param LabelMapping label_mapping: Label to add (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_notification_rule_id_labels_prepare(rule_id, label_mapping, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/notificationRules/{ruleID}/labels', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='LabelResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_notification_rule_id_labels_async(self, rule_id, label_mapping, **kwargs): # noqa: E501,D401,D403 - """Add a label to a notification rule. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str rule_id: The notification rule ID. (required) - :param LabelMapping label_mapping: Label to add (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_notification_rule_id_labels_prepare(rule_id, label_mapping, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/notificationRules/{ruleID}/labels', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='LabelResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_notification_rule_id_labels_prepare(self, rule_id, label_mapping, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['rule_id', 'label_mapping', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('post_notification_rule_id_labels', all_params, local_var_params) - # verify the required parameter 'rule_id' is set - if ('rule_id' not in local_var_params or - local_var_params['rule_id'] is None): - raise ValueError("Missing the required parameter `rule_id` when calling `post_notification_rule_id_labels`") # noqa: E501 - # verify the required parameter 'label_mapping' is set - if ('label_mapping' not in local_var_params or - local_var_params['label_mapping'] is None): - raise ValueError("Missing the required parameter `label_mapping` when calling `post_notification_rule_id_labels`") # noqa: E501 - - path_params = {} - if 'rule_id' in local_var_params: - path_params['ruleID'] = local_var_params['rule_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'label_mapping' in local_var_params: - body_params = local_var_params['label_mapping'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def put_notification_rules_id(self, rule_id, notification_rule, **kwargs): # noqa: E501,D401,D403 - """Update a notification rule. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.put_notification_rules_id(rule_id, notification_rule, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str rule_id: The notification rule ID. (required) - :param NotificationRule notification_rule: Notification rule update to apply (required) - :param str zap_trace_span: OpenTracing span context - :return: NotificationRule - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.put_notification_rules_id_with_http_info(rule_id, notification_rule, **kwargs) # noqa: E501 - else: - (data) = self.put_notification_rules_id_with_http_info(rule_id, notification_rule, **kwargs) # noqa: E501 - return data - - def put_notification_rules_id_with_http_info(self, rule_id, notification_rule, **kwargs): # noqa: E501,D401,D403 - """Update a notification rule. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.put_notification_rules_id_with_http_info(rule_id, notification_rule, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str rule_id: The notification rule ID. (required) - :param NotificationRule notification_rule: Notification rule update to apply (required) - :param str zap_trace_span: OpenTracing span context - :return: NotificationRule - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._put_notification_rules_id_prepare(rule_id, notification_rule, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/notificationRules/{ruleID}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='NotificationRule', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def put_notification_rules_id_async(self, rule_id, notification_rule, **kwargs): # noqa: E501,D401,D403 - """Update a notification rule. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str rule_id: The notification rule ID. (required) - :param NotificationRule notification_rule: Notification rule update to apply (required) - :param str zap_trace_span: OpenTracing span context - :return: NotificationRule - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._put_notification_rules_id_prepare(rule_id, notification_rule, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/notificationRules/{ruleID}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='NotificationRule', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _put_notification_rules_id_prepare(self, rule_id, notification_rule, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['rule_id', 'notification_rule', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('put_notification_rules_id', all_params, local_var_params) - # verify the required parameter 'rule_id' is set - if ('rule_id' not in local_var_params or - local_var_params['rule_id'] is None): - raise ValueError("Missing the required parameter `rule_id` when calling `put_notification_rules_id`") # noqa: E501 - # verify the required parameter 'notification_rule' is set - if ('notification_rule' not in local_var_params or - local_var_params['notification_rule'] is None): - raise ValueError("Missing the required parameter `notification_rule` when calling `put_notification_rules_id`") # noqa: E501 - - path_params = {} - if 'rule_id' in local_var_params: - path_params['ruleID'] = local_var_params['rule_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'notification_rule' in local_var_params: - body_params = local_var_params['notification_rule'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params diff --git a/frogpilot/third_party/influxdb_client/service/organizations_service.py b/frogpilot/third_party/influxdb_client/service/organizations_service.py deleted file mode 100644 index 6d845a31..00000000 --- a/frogpilot/third_party/influxdb_client/service/organizations_service.py +++ /dev/null @@ -1,1427 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -from influxdb_client.service._base_service import _BaseService - - -class OrganizationsService(_BaseService): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): # noqa: E501,D401,D403 - """OrganizationsService - a operation defined in OpenAPI.""" - super().__init__(api_client) - - def delete_orgs_id(self, org_id, **kwargs): # noqa: E501,D401,D403 - """Delete an organization. - - Deletes an organization. Deleting an organization from InfluxDB Cloud can't be undone. Once deleted, all data associated with the organization is removed. #### InfluxDB Cloud - Does the following when you send a delete request: 1. Validates the request and queues the delete. 2. Returns an HTTP `204` status code if queued; _error_ otherwise. 3. Handles the delete asynchronously. #### InfluxDB OSS - Validates the request, handles the delete synchronously, and then responds with success or failure. #### Limitations - Only one organization can be deleted per request. #### Related guides - [Delete organizations](https://docs.influxdata.com/influxdb/latest/organizations/delete-orgs/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_orgs_id(org_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str org_id: The ID of the organization to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_orgs_id_with_http_info(org_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_orgs_id_with_http_info(org_id, **kwargs) # noqa: E501 - return data - - def delete_orgs_id_with_http_info(self, org_id, **kwargs): # noqa: E501,D401,D403 - """Delete an organization. - - Deletes an organization. Deleting an organization from InfluxDB Cloud can't be undone. Once deleted, all data associated with the organization is removed. #### InfluxDB Cloud - Does the following when you send a delete request: 1. Validates the request and queues the delete. 2. Returns an HTTP `204` status code if queued; _error_ otherwise. 3. Handles the delete asynchronously. #### InfluxDB OSS - Validates the request, handles the delete synchronously, and then responds with success or failure. #### Limitations - Only one organization can be deleted per request. #### Related guides - [Delete organizations](https://docs.influxdata.com/influxdb/latest/organizations/delete-orgs/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_orgs_id_with_http_info(org_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str org_id: The ID of the organization to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_orgs_id_prepare(org_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/orgs/{orgID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def delete_orgs_id_async(self, org_id, **kwargs): # noqa: E501,D401,D403 - """Delete an organization. - - Deletes an organization. Deleting an organization from InfluxDB Cloud can't be undone. Once deleted, all data associated with the organization is removed. #### InfluxDB Cloud - Does the following when you send a delete request: 1. Validates the request and queues the delete. 2. Returns an HTTP `204` status code if queued; _error_ otherwise. 3. Handles the delete asynchronously. #### InfluxDB OSS - Validates the request, handles the delete synchronously, and then responds with success or failure. #### Limitations - Only one organization can be deleted per request. #### Related guides - [Delete organizations](https://docs.influxdata.com/influxdb/latest/organizations/delete-orgs/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str org_id: The ID of the organization to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_orgs_id_prepare(org_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/orgs/{orgID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _delete_orgs_id_prepare(self, org_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['org_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('delete_orgs_id', all_params, local_var_params) - # verify the required parameter 'org_id' is set - if ('org_id' not in local_var_params or - local_var_params['org_id'] is None): - raise ValueError("Missing the required parameter `org_id` when calling `delete_orgs_id`") # noqa: E501 - - path_params = {} - if 'org_id' in local_var_params: - path_params['orgID'] = local_var_params['org_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def delete_orgs_id_members_id(self, user_id, org_id, **kwargs): # noqa: E501,D401,D403 - """Remove a member from an organization. - - Removes a member from an organization. Use this endpoint to remove a user's member privileges for an organization. Removing member privileges removes the user's `read` and `write` permissions from the organization. #### InfluxDB Cloud - Doesn't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. #### Limitations - Member permissions are separate from API token permissions. - Member permissions are used in the context of the InfluxDB UI. #### Required permissions - `write-orgs INFLUX_ORG_ID` *`INFLUX_ORG_ID`* is the ID of the organization that you want to remove an owner from. #### Related guides - [Manage members](https://docs.influxdata.com/influxdb/latest/organizations/members/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_orgs_id_members_id(user_id, org_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_id: The ID of the user to remove. (required) - :param str org_id: The ID of the organization to remove a user from. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_orgs_id_members_id_with_http_info(user_id, org_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_orgs_id_members_id_with_http_info(user_id, org_id, **kwargs) # noqa: E501 - return data - - def delete_orgs_id_members_id_with_http_info(self, user_id, org_id, **kwargs): # noqa: E501,D401,D403 - """Remove a member from an organization. - - Removes a member from an organization. Use this endpoint to remove a user's member privileges for an organization. Removing member privileges removes the user's `read` and `write` permissions from the organization. #### InfluxDB Cloud - Doesn't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. #### Limitations - Member permissions are separate from API token permissions. - Member permissions are used in the context of the InfluxDB UI. #### Required permissions - `write-orgs INFLUX_ORG_ID` *`INFLUX_ORG_ID`* is the ID of the organization that you want to remove an owner from. #### Related guides - [Manage members](https://docs.influxdata.com/influxdb/latest/organizations/members/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_orgs_id_members_id_with_http_info(user_id, org_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_id: The ID of the user to remove. (required) - :param str org_id: The ID of the organization to remove a user from. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_orgs_id_members_id_prepare(user_id, org_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/orgs/{orgID}/members/{userID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def delete_orgs_id_members_id_async(self, user_id, org_id, **kwargs): # noqa: E501,D401,D403 - """Remove a member from an organization. - - Removes a member from an organization. Use this endpoint to remove a user's member privileges for an organization. Removing member privileges removes the user's `read` and `write` permissions from the organization. #### InfluxDB Cloud - Doesn't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. #### Limitations - Member permissions are separate from API token permissions. - Member permissions are used in the context of the InfluxDB UI. #### Required permissions - `write-orgs INFLUX_ORG_ID` *`INFLUX_ORG_ID`* is the ID of the organization that you want to remove an owner from. #### Related guides - [Manage members](https://docs.influxdata.com/influxdb/latest/organizations/members/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str user_id: The ID of the user to remove. (required) - :param str org_id: The ID of the organization to remove a user from. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_orgs_id_members_id_prepare(user_id, org_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/orgs/{orgID}/members/{userID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _delete_orgs_id_members_id_prepare(self, user_id, org_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['user_id', 'org_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('delete_orgs_id_members_id', all_params, local_var_params) - # verify the required parameter 'user_id' is set - if ('user_id' not in local_var_params or - local_var_params['user_id'] is None): - raise ValueError("Missing the required parameter `user_id` when calling `delete_orgs_id_members_id`") # noqa: E501 - # verify the required parameter 'org_id' is set - if ('org_id' not in local_var_params or - local_var_params['org_id'] is None): - raise ValueError("Missing the required parameter `org_id` when calling `delete_orgs_id_members_id`") # noqa: E501 - - path_params = {} - if 'user_id' in local_var_params: - path_params['userID'] = local_var_params['user_id'] # noqa: E501 - if 'org_id' in local_var_params: - path_params['orgID'] = local_var_params['org_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def delete_orgs_id_owners_id(self, user_id, org_id, **kwargs): # noqa: E501,D401,D403 - """Remove an owner from an organization. - - Removes an [owner](https://docs.influxdata.com/influxdb/latest/reference/glossary/#owner) from the organization. Organization owners have permission to delete organizations and remove user and member permissions from the organization. #### InfluxDB Cloud - Doesn't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. #### Limitations - Owner permissions are separate from API token permissions. - Owner permissions are used in the context of the InfluxDB UI. #### Required permissions - `write-orgs INFLUX_ORG_ID` *`INFLUX_ORG_ID`* is the ID of the organization that you want to remove an owner from. #### Related endpoints - [Authorizations](#tag/Authorizations-(API-tokens)) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_orgs_id_owners_id(user_id, org_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_id: The ID of the user to remove. (required) - :param str org_id: The ID of the organization to remove an owner from. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_orgs_id_owners_id_with_http_info(user_id, org_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_orgs_id_owners_id_with_http_info(user_id, org_id, **kwargs) # noqa: E501 - return data - - def delete_orgs_id_owners_id_with_http_info(self, user_id, org_id, **kwargs): # noqa: E501,D401,D403 - """Remove an owner from an organization. - - Removes an [owner](https://docs.influxdata.com/influxdb/latest/reference/glossary/#owner) from the organization. Organization owners have permission to delete organizations and remove user and member permissions from the organization. #### InfluxDB Cloud - Doesn't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. #### Limitations - Owner permissions are separate from API token permissions. - Owner permissions are used in the context of the InfluxDB UI. #### Required permissions - `write-orgs INFLUX_ORG_ID` *`INFLUX_ORG_ID`* is the ID of the organization that you want to remove an owner from. #### Related endpoints - [Authorizations](#tag/Authorizations-(API-tokens)) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_orgs_id_owners_id_with_http_info(user_id, org_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_id: The ID of the user to remove. (required) - :param str org_id: The ID of the organization to remove an owner from. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_orgs_id_owners_id_prepare(user_id, org_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/orgs/{orgID}/owners/{userID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def delete_orgs_id_owners_id_async(self, user_id, org_id, **kwargs): # noqa: E501,D401,D403 - """Remove an owner from an organization. - - Removes an [owner](https://docs.influxdata.com/influxdb/latest/reference/glossary/#owner) from the organization. Organization owners have permission to delete organizations and remove user and member permissions from the organization. #### InfluxDB Cloud - Doesn't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. #### Limitations - Owner permissions are separate from API token permissions. - Owner permissions are used in the context of the InfluxDB UI. #### Required permissions - `write-orgs INFLUX_ORG_ID` *`INFLUX_ORG_ID`* is the ID of the organization that you want to remove an owner from. #### Related endpoints - [Authorizations](#tag/Authorizations-(API-tokens)) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str user_id: The ID of the user to remove. (required) - :param str org_id: The ID of the organization to remove an owner from. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_orgs_id_owners_id_prepare(user_id, org_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/orgs/{orgID}/owners/{userID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _delete_orgs_id_owners_id_prepare(self, user_id, org_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['user_id', 'org_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('delete_orgs_id_owners_id', all_params, local_var_params) - # verify the required parameter 'user_id' is set - if ('user_id' not in local_var_params or - local_var_params['user_id'] is None): - raise ValueError("Missing the required parameter `user_id` when calling `delete_orgs_id_owners_id`") # noqa: E501 - # verify the required parameter 'org_id' is set - if ('org_id' not in local_var_params or - local_var_params['org_id'] is None): - raise ValueError("Missing the required parameter `org_id` when calling `delete_orgs_id_owners_id`") # noqa: E501 - - path_params = {} - if 'user_id' in local_var_params: - path_params['userID'] = local_var_params['user_id'] # noqa: E501 - if 'org_id' in local_var_params: - path_params['orgID'] = local_var_params['org_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_orgs(self, **kwargs): # noqa: E501,D401,D403 - """List organizations. - - Lists [organizations](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization/). To limit which organizations are returned, pass query parameters in your request. If no query parameters are passed, InfluxDB returns all organizations up to the default `limit`. #### InfluxDB Cloud - Only returns the organization that owns the token passed in the request. #### Related guides - [View organizations](https://docs.influxdata.com/influxdb/latest/organizations/view-orgs/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_orgs(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param int offset: The offset for pagination. The number of records to skip. For more information about pagination parameters, see [Pagination](https://docs.influxdata.com/influxdb/latest/api/#tag/Pagination). - :param int limit: Limits the number of records returned. Default is `20`. - :param bool descending: - :param str org: An organization name. Only returns the specified organization. - :param str org_id: An organization ID. Only returns the specified organization. - :param str user_id: A user ID. Only returns organizations where the specified user is a member or owner. - :return: Organizations - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_orgs_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_orgs_with_http_info(**kwargs) # noqa: E501 - return data - - def get_orgs_with_http_info(self, **kwargs): # noqa: E501,D401,D403 - """List organizations. - - Lists [organizations](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization/). To limit which organizations are returned, pass query parameters in your request. If no query parameters are passed, InfluxDB returns all organizations up to the default `limit`. #### InfluxDB Cloud - Only returns the organization that owns the token passed in the request. #### Related guides - [View organizations](https://docs.influxdata.com/influxdb/latest/organizations/view-orgs/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_orgs_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param int offset: The offset for pagination. The number of records to skip. For more information about pagination parameters, see [Pagination](https://docs.influxdata.com/influxdb/latest/api/#tag/Pagination). - :param int limit: Limits the number of records returned. Default is `20`. - :param bool descending: - :param str org: An organization name. Only returns the specified organization. - :param str org_id: An organization ID. Only returns the specified organization. - :param str user_id: A user ID. Only returns organizations where the specified user is a member or owner. - :return: Organizations - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_orgs_prepare(**kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/orgs', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Organizations', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_orgs_async(self, **kwargs): # noqa: E501,D401,D403 - """List organizations. - - Lists [organizations](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization/). To limit which organizations are returned, pass query parameters in your request. If no query parameters are passed, InfluxDB returns all organizations up to the default `limit`. #### InfluxDB Cloud - Only returns the organization that owns the token passed in the request. #### Related guides - [View organizations](https://docs.influxdata.com/influxdb/latest/organizations/view-orgs/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param int offset: The offset for pagination. The number of records to skip. For more information about pagination parameters, see [Pagination](https://docs.influxdata.com/influxdb/latest/api/#tag/Pagination). - :param int limit: Limits the number of records returned. Default is `20`. - :param bool descending: - :param str org: An organization name. Only returns the specified organization. - :param str org_id: An organization ID. Only returns the specified organization. - :param str user_id: A user ID. Only returns organizations where the specified user is a member or owner. - :return: Organizations - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_orgs_prepare(**kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/orgs', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Organizations', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_orgs_prepare(self, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['zap_trace_span', 'offset', 'limit', 'descending', 'org', 'org_id', 'user_id'] # noqa: E501 - self._check_operation_params('get_orgs', all_params, local_var_params) - - if 'offset' in local_var_params and local_var_params['offset'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `offset` when calling `get_orgs`, must be a value greater than or equal to `0`") # noqa: E501 - if 'limit' in local_var_params and local_var_params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `get_orgs`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `get_orgs`, must be a value greater than or equal to `1`") # noqa: E501 - path_params = {} - - query_params = [] - if 'offset' in local_var_params: - query_params.append(('offset', local_var_params['offset'])) # noqa: E501 - if 'limit' in local_var_params: - query_params.append(('limit', local_var_params['limit'])) # noqa: E501 - if 'descending' in local_var_params: - query_params.append(('descending', local_var_params['descending'])) # noqa: E501 - if 'org' in local_var_params: - query_params.append(('org', local_var_params['org'])) # noqa: E501 - if 'org_id' in local_var_params: - query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501 - if 'user_id' in local_var_params: - query_params.append(('userID', local_var_params['user_id'])) # noqa: E501 - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_orgs_id(self, org_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve an organization. - - Retrieves an organization. Use this endpoint to retrieve information for a specific organization. #### Related guides - [View organizations](https://docs.influxdata.com/influxdb/latest/organizations/view-orgs/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_orgs_id(org_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str org_id: The ID of the organization to retrieve. (required) - :param str zap_trace_span: OpenTracing span context - :return: Organization - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_orgs_id_with_http_info(org_id, **kwargs) # noqa: E501 - else: - (data) = self.get_orgs_id_with_http_info(org_id, **kwargs) # noqa: E501 - return data - - def get_orgs_id_with_http_info(self, org_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve an organization. - - Retrieves an organization. Use this endpoint to retrieve information for a specific organization. #### Related guides - [View organizations](https://docs.influxdata.com/influxdb/latest/organizations/view-orgs/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_orgs_id_with_http_info(org_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str org_id: The ID of the organization to retrieve. (required) - :param str zap_trace_span: OpenTracing span context - :return: Organization - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_orgs_id_prepare(org_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/orgs/{orgID}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Organization', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_orgs_id_async(self, org_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve an organization. - - Retrieves an organization. Use this endpoint to retrieve information for a specific organization. #### Related guides - [View organizations](https://docs.influxdata.com/influxdb/latest/organizations/view-orgs/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str org_id: The ID of the organization to retrieve. (required) - :param str zap_trace_span: OpenTracing span context - :return: Organization - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_orgs_id_prepare(org_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/orgs/{orgID}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Organization', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_orgs_id_prepare(self, org_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['org_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_orgs_id', all_params, local_var_params) - # verify the required parameter 'org_id' is set - if ('org_id' not in local_var_params or - local_var_params['org_id'] is None): - raise ValueError("Missing the required parameter `org_id` when calling `get_orgs_id`") # noqa: E501 - - path_params = {} - if 'org_id' in local_var_params: - path_params['orgID'] = local_var_params['org_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_orgs_id_members(self, org_id, **kwargs): # noqa: E501,D401,D403 - """List all members of an organization. - - Lists all users that belong to an organization. InfluxDB [users](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user) have permission to access InfluxDB. [Members](https://docs.influxdata.com/influxdb/latest/reference/glossary/#member) are users within the organization. #### InfluxDB Cloud - Doesn't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. #### Limitations - Member permissions are separate from API token permissions. - Member permissions are used in the context of the InfluxDB UI. #### Required permissions - `read-orgs INFLUX_ORG_ID` *`INFLUX_ORG_ID`* is the ID of the organization that you want to retrieve members for. #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/users/) - [Manage members](https://docs.influxdata.com/influxdb/latest/organizations/members/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_orgs_id_members(org_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str org_id: The ID of the organization to retrieve users for. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceMembers - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_orgs_id_members_with_http_info(org_id, **kwargs) # noqa: E501 - else: - (data) = self.get_orgs_id_members_with_http_info(org_id, **kwargs) # noqa: E501 - return data - - def get_orgs_id_members_with_http_info(self, org_id, **kwargs): # noqa: E501,D401,D403 - """List all members of an organization. - - Lists all users that belong to an organization. InfluxDB [users](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user) have permission to access InfluxDB. [Members](https://docs.influxdata.com/influxdb/latest/reference/glossary/#member) are users within the organization. #### InfluxDB Cloud - Doesn't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. #### Limitations - Member permissions are separate from API token permissions. - Member permissions are used in the context of the InfluxDB UI. #### Required permissions - `read-orgs INFLUX_ORG_ID` *`INFLUX_ORG_ID`* is the ID of the organization that you want to retrieve members for. #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/users/) - [Manage members](https://docs.influxdata.com/influxdb/latest/organizations/members/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_orgs_id_members_with_http_info(org_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str org_id: The ID of the organization to retrieve users for. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceMembers - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_orgs_id_members_prepare(org_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/orgs/{orgID}/members', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceMembers', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_orgs_id_members_async(self, org_id, **kwargs): # noqa: E501,D401,D403 - """List all members of an organization. - - Lists all users that belong to an organization. InfluxDB [users](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user) have permission to access InfluxDB. [Members](https://docs.influxdata.com/influxdb/latest/reference/glossary/#member) are users within the organization. #### InfluxDB Cloud - Doesn't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. #### Limitations - Member permissions are separate from API token permissions. - Member permissions are used in the context of the InfluxDB UI. #### Required permissions - `read-orgs INFLUX_ORG_ID` *`INFLUX_ORG_ID`* is the ID of the organization that you want to retrieve members for. #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/users/) - [Manage members](https://docs.influxdata.com/influxdb/latest/organizations/members/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str org_id: The ID of the organization to retrieve users for. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceMembers - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_orgs_id_members_prepare(org_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/orgs/{orgID}/members', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceMembers', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_orgs_id_members_prepare(self, org_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['org_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_orgs_id_members', all_params, local_var_params) - # verify the required parameter 'org_id' is set - if ('org_id' not in local_var_params or - local_var_params['org_id'] is None): - raise ValueError("Missing the required parameter `org_id` when calling `get_orgs_id_members`") # noqa: E501 - - path_params = {} - if 'org_id' in local_var_params: - path_params['orgID'] = local_var_params['org_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_orgs_id_owners(self, org_id, **kwargs): # noqa: E501,D401,D403 - """List all owners of an organization. - - Lists all owners of an organization. #### InfluxDB Cloud - Doesn't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. #### Required permissions - `read-orgs INFLUX_ORG_ID` *`INFLUX_ORG_ID`* is the ID of the organization that you want to retrieve a list of owners from. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_orgs_id_owners(org_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str org_id: The ID of the organization to list owners for. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceOwners - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_orgs_id_owners_with_http_info(org_id, **kwargs) # noqa: E501 - else: - (data) = self.get_orgs_id_owners_with_http_info(org_id, **kwargs) # noqa: E501 - return data - - def get_orgs_id_owners_with_http_info(self, org_id, **kwargs): # noqa: E501,D401,D403 - """List all owners of an organization. - - Lists all owners of an organization. #### InfluxDB Cloud - Doesn't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. #### Required permissions - `read-orgs INFLUX_ORG_ID` *`INFLUX_ORG_ID`* is the ID of the organization that you want to retrieve a list of owners from. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_orgs_id_owners_with_http_info(org_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str org_id: The ID of the organization to list owners for. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceOwners - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_orgs_id_owners_prepare(org_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/orgs/{orgID}/owners', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceOwners', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_orgs_id_owners_async(self, org_id, **kwargs): # noqa: E501,D401,D403 - """List all owners of an organization. - - Lists all owners of an organization. #### InfluxDB Cloud - Doesn't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. #### Required permissions - `read-orgs INFLUX_ORG_ID` *`INFLUX_ORG_ID`* is the ID of the organization that you want to retrieve a list of owners from. - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str org_id: The ID of the organization to list owners for. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceOwners - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_orgs_id_owners_prepare(org_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/orgs/{orgID}/owners', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceOwners', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_orgs_id_owners_prepare(self, org_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['org_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_orgs_id_owners', all_params, local_var_params) - # verify the required parameter 'org_id' is set - if ('org_id' not in local_var_params or - local_var_params['org_id'] is None): - raise ValueError("Missing the required parameter `org_id` when calling `get_orgs_id_owners`") # noqa: E501 - - path_params = {} - if 'org_id' in local_var_params: - path_params['orgID'] = local_var_params['org_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def patch_orgs_id(self, org_id, patch_organization_request, **kwargs): # noqa: E501,D401,D403 - """Update an organization. - - Updates an organization. Use this endpoint to update properties (`name`, `description`) of an organization. Updating an organization’s name affects all resources that reference the organization by name, including the following: - Queries - Dashboards - Tasks - Telegraf configurations - Templates If you change an organization name, be sure to update the organization name in these resources as well. #### Related Guides - [Update an organization](https://docs.influxdata.com/influxdb/latest/organizations/update-org/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_orgs_id(org_id, patch_organization_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str org_id: The ID of the organization to update. (required) - :param PatchOrganizationRequest patch_organization_request: The organization update to apply. (required) - :param str zap_trace_span: OpenTracing span context - :return: Organization - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.patch_orgs_id_with_http_info(org_id, patch_organization_request, **kwargs) # noqa: E501 - else: - (data) = self.patch_orgs_id_with_http_info(org_id, patch_organization_request, **kwargs) # noqa: E501 - return data - - def patch_orgs_id_with_http_info(self, org_id, patch_organization_request, **kwargs): # noqa: E501,D401,D403 - """Update an organization. - - Updates an organization. Use this endpoint to update properties (`name`, `description`) of an organization. Updating an organization’s name affects all resources that reference the organization by name, including the following: - Queries - Dashboards - Tasks - Telegraf configurations - Templates If you change an organization name, be sure to update the organization name in these resources as well. #### Related Guides - [Update an organization](https://docs.influxdata.com/influxdb/latest/organizations/update-org/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_orgs_id_with_http_info(org_id, patch_organization_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str org_id: The ID of the organization to update. (required) - :param PatchOrganizationRequest patch_organization_request: The organization update to apply. (required) - :param str zap_trace_span: OpenTracing span context - :return: Organization - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_orgs_id_prepare(org_id, patch_organization_request, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/orgs/{orgID}', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Organization', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def patch_orgs_id_async(self, org_id, patch_organization_request, **kwargs): # noqa: E501,D401,D403 - """Update an organization. - - Updates an organization. Use this endpoint to update properties (`name`, `description`) of an organization. Updating an organization’s name affects all resources that reference the organization by name, including the following: - Queries - Dashboards - Tasks - Telegraf configurations - Templates If you change an organization name, be sure to update the organization name in these resources as well. #### Related Guides - [Update an organization](https://docs.influxdata.com/influxdb/latest/organizations/update-org/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str org_id: The ID of the organization to update. (required) - :param PatchOrganizationRequest patch_organization_request: The organization update to apply. (required) - :param str zap_trace_span: OpenTracing span context - :return: Organization - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_orgs_id_prepare(org_id, patch_organization_request, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/orgs/{orgID}', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Organization', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _patch_orgs_id_prepare(self, org_id, patch_organization_request, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['org_id', 'patch_organization_request', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('patch_orgs_id', all_params, local_var_params) - # verify the required parameter 'org_id' is set - if ('org_id' not in local_var_params or - local_var_params['org_id'] is None): - raise ValueError("Missing the required parameter `org_id` when calling `patch_orgs_id`") # noqa: E501 - # verify the required parameter 'patch_organization_request' is set - if ('patch_organization_request' not in local_var_params or - local_var_params['patch_organization_request'] is None): - raise ValueError("Missing the required parameter `patch_organization_request` when calling `patch_orgs_id`") # noqa: E501 - - path_params = {} - if 'org_id' in local_var_params: - path_params['orgID'] = local_var_params['org_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'patch_organization_request' in local_var_params: - body_params = local_var_params['patch_organization_request'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_orgs(self, post_organization_request, **kwargs): # noqa: E501,D401,D403 - """Create an organization. - - Creates an [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization) and returns the newly created organization. #### InfluxDB Cloud - Doesn't allow you to use this endpoint to create organizations. #### Related guides - [Manage organizations](https://docs.influxdata.com/influxdb/latest/organizations) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_orgs(post_organization_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param PostOrganizationRequest post_organization_request: The organization to create. (required) - :param str zap_trace_span: OpenTracing span context - :return: Organization - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_orgs_with_http_info(post_organization_request, **kwargs) # noqa: E501 - else: - (data) = self.post_orgs_with_http_info(post_organization_request, **kwargs) # noqa: E501 - return data - - def post_orgs_with_http_info(self, post_organization_request, **kwargs): # noqa: E501,D401,D403 - """Create an organization. - - Creates an [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization) and returns the newly created organization. #### InfluxDB Cloud - Doesn't allow you to use this endpoint to create organizations. #### Related guides - [Manage organizations](https://docs.influxdata.com/influxdb/latest/organizations) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_orgs_with_http_info(post_organization_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param PostOrganizationRequest post_organization_request: The organization to create. (required) - :param str zap_trace_span: OpenTracing span context - :return: Organization - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_orgs_prepare(post_organization_request, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/orgs', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Organization', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_orgs_async(self, post_organization_request, **kwargs): # noqa: E501,D401,D403 - """Create an organization. - - Creates an [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization) and returns the newly created organization. #### InfluxDB Cloud - Doesn't allow you to use this endpoint to create organizations. #### Related guides - [Manage organizations](https://docs.influxdata.com/influxdb/latest/organizations) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param PostOrganizationRequest post_organization_request: The organization to create. (required) - :param str zap_trace_span: OpenTracing span context - :return: Organization - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_orgs_prepare(post_organization_request, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/orgs', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Organization', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_orgs_prepare(self, post_organization_request, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['post_organization_request', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('post_orgs', all_params, local_var_params) - # verify the required parameter 'post_organization_request' is set - if ('post_organization_request' not in local_var_params or - local_var_params['post_organization_request'] is None): - raise ValueError("Missing the required parameter `post_organization_request` when calling `post_orgs`") # noqa: E501 - - path_params = {} - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'post_organization_request' in local_var_params: - body_params = local_var_params['post_organization_request'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_orgs_id_members(self, org_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - """Add a member to an organization. - - Add a user to an organization. InfluxDB [users](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user) have permission to access InfluxDB. [Members](https://docs.influxdata.com/influxdb/latest/reference/glossary/#member) are users within the organization. #### InfluxDB Cloud - Doesn't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. #### Limitations - Member permissions are separate from API token permissions. - Member permissions are used in the context of the InfluxDB UI. #### Required permissions - `write-orgs INFLUX_ORG_ID` *`INFLUX_ORG_ID`* is the ID of the organization that you want to add a member to. #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/users/) - [Manage members](https://docs.influxdata.com/influxdb/latest/organizations/members/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_orgs_id_members(org_id, add_resource_member_request_body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str org_id: The ID of the organization. (required) - :param AddResourceMemberRequestBody add_resource_member_request_body: The user to add to the organization. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceMember - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_orgs_id_members_with_http_info(org_id, add_resource_member_request_body, **kwargs) # noqa: E501 - else: - (data) = self.post_orgs_id_members_with_http_info(org_id, add_resource_member_request_body, **kwargs) # noqa: E501 - return data - - def post_orgs_id_members_with_http_info(self, org_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - """Add a member to an organization. - - Add a user to an organization. InfluxDB [users](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user) have permission to access InfluxDB. [Members](https://docs.influxdata.com/influxdb/latest/reference/glossary/#member) are users within the organization. #### InfluxDB Cloud - Doesn't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. #### Limitations - Member permissions are separate from API token permissions. - Member permissions are used in the context of the InfluxDB UI. #### Required permissions - `write-orgs INFLUX_ORG_ID` *`INFLUX_ORG_ID`* is the ID of the organization that you want to add a member to. #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/users/) - [Manage members](https://docs.influxdata.com/influxdb/latest/organizations/members/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_orgs_id_members_with_http_info(org_id, add_resource_member_request_body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str org_id: The ID of the organization. (required) - :param AddResourceMemberRequestBody add_resource_member_request_body: The user to add to the organization. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceMember - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_orgs_id_members_prepare(org_id, add_resource_member_request_body, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/orgs/{orgID}/members', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceMember', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_orgs_id_members_async(self, org_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - """Add a member to an organization. - - Add a user to an organization. InfluxDB [users](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user) have permission to access InfluxDB. [Members](https://docs.influxdata.com/influxdb/latest/reference/glossary/#member) are users within the organization. #### InfluxDB Cloud - Doesn't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. #### Limitations - Member permissions are separate from API token permissions. - Member permissions are used in the context of the InfluxDB UI. #### Required permissions - `write-orgs INFLUX_ORG_ID` *`INFLUX_ORG_ID`* is the ID of the organization that you want to add a member to. #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/users/) - [Manage members](https://docs.influxdata.com/influxdb/latest/organizations/members/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str org_id: The ID of the organization. (required) - :param AddResourceMemberRequestBody add_resource_member_request_body: The user to add to the organization. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceMember - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_orgs_id_members_prepare(org_id, add_resource_member_request_body, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/orgs/{orgID}/members', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceMember', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_orgs_id_members_prepare(self, org_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['org_id', 'add_resource_member_request_body', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('post_orgs_id_members', all_params, local_var_params) - # verify the required parameter 'org_id' is set - if ('org_id' not in local_var_params or - local_var_params['org_id'] is None): - raise ValueError("Missing the required parameter `org_id` when calling `post_orgs_id_members`") # noqa: E501 - # verify the required parameter 'add_resource_member_request_body' is set - if ('add_resource_member_request_body' not in local_var_params or - local_var_params['add_resource_member_request_body'] is None): - raise ValueError("Missing the required parameter `add_resource_member_request_body` when calling `post_orgs_id_members`") # noqa: E501 - - path_params = {} - if 'org_id' in local_var_params: - path_params['orgID'] = local_var_params['org_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'add_resource_member_request_body' in local_var_params: - body_params = local_var_params['add_resource_member_request_body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_orgs_id_owners(self, org_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - """Add an owner to an organization. - - Adds an owner to an organization. Use this endpoint to assign the organization `owner` role to a user. #### InfluxDB Cloud - Doesn't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. #### Required permissions - `write-orgs INFLUX_ORG_ID` *`INFLUX_ORG_ID`* is the ID of the organization that you want to add an owner for. #### Related endpoints - [Authorizations](#tag/Authorizations-(API-tokens)) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_orgs_id_owners(org_id, add_resource_member_request_body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str org_id: The ID of the organization that you want to add an owner for. (required) - :param AddResourceMemberRequestBody add_resource_member_request_body: The user to add as an owner of the organization. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceOwner - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_orgs_id_owners_with_http_info(org_id, add_resource_member_request_body, **kwargs) # noqa: E501 - else: - (data) = self.post_orgs_id_owners_with_http_info(org_id, add_resource_member_request_body, **kwargs) # noqa: E501 - return data - - def post_orgs_id_owners_with_http_info(self, org_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - """Add an owner to an organization. - - Adds an owner to an organization. Use this endpoint to assign the organization `owner` role to a user. #### InfluxDB Cloud - Doesn't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. #### Required permissions - `write-orgs INFLUX_ORG_ID` *`INFLUX_ORG_ID`* is the ID of the organization that you want to add an owner for. #### Related endpoints - [Authorizations](#tag/Authorizations-(API-tokens)) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_orgs_id_owners_with_http_info(org_id, add_resource_member_request_body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str org_id: The ID of the organization that you want to add an owner for. (required) - :param AddResourceMemberRequestBody add_resource_member_request_body: The user to add as an owner of the organization. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceOwner - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_orgs_id_owners_prepare(org_id, add_resource_member_request_body, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/orgs/{orgID}/owners', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceOwner', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_orgs_id_owners_async(self, org_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - """Add an owner to an organization. - - Adds an owner to an organization. Use this endpoint to assign the organization `owner` role to a user. #### InfluxDB Cloud - Doesn't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. #### Required permissions - `write-orgs INFLUX_ORG_ID` *`INFLUX_ORG_ID`* is the ID of the organization that you want to add an owner for. #### Related endpoints - [Authorizations](#tag/Authorizations-(API-tokens)) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str org_id: The ID of the organization that you want to add an owner for. (required) - :param AddResourceMemberRequestBody add_resource_member_request_body: The user to add as an owner of the organization. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceOwner - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_orgs_id_owners_prepare(org_id, add_resource_member_request_body, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/orgs/{orgID}/owners', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceOwner', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_orgs_id_owners_prepare(self, org_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['org_id', 'add_resource_member_request_body', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('post_orgs_id_owners', all_params, local_var_params) - # verify the required parameter 'org_id' is set - if ('org_id' not in local_var_params or - local_var_params['org_id'] is None): - raise ValueError("Missing the required parameter `org_id` when calling `post_orgs_id_owners`") # noqa: E501 - # verify the required parameter 'add_resource_member_request_body' is set - if ('add_resource_member_request_body' not in local_var_params or - local_var_params['add_resource_member_request_body'] is None): - raise ValueError("Missing the required parameter `add_resource_member_request_body` when calling `post_orgs_id_owners`") # noqa: E501 - - path_params = {} - if 'org_id' in local_var_params: - path_params['orgID'] = local_var_params['org_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'add_resource_member_request_body' in local_var_params: - body_params = local_var_params['add_resource_member_request_body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params diff --git a/frogpilot/third_party/influxdb_client/service/ping_service.py b/frogpilot/third_party/influxdb_client/service/ping_service.py deleted file mode 100644 index 2d89a745..00000000 --- a/frogpilot/third_party/influxdb_client/service/ping_service.py +++ /dev/null @@ -1,232 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -from influxdb_client.service._base_service import _BaseService - - -class PingService(_BaseService): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): # noqa: E501,D401,D403 - """PingService - a operation defined in OpenAPI.""" - super().__init__(api_client) - - def get_ping(self, **kwargs): # noqa: E501,D401,D403 - """Get the status of the instance. - - Retrieves the status and InfluxDB version of the instance. Use this endpoint to monitor uptime for the InfluxDB instance. The response returns a HTTP `204` status code to inform you the instance is available. #### InfluxDB Cloud - Isn't versioned and doesn't return `X-Influxdb-Version` in the headers. #### Related guides - [Influx ping](https://docs.influxdata.com/influxdb/latest/reference/cli/influx/ping/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_ping(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_ping_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_ping_with_http_info(**kwargs) # noqa: E501 - return data - - def get_ping_with_http_info(self, **kwargs): # noqa: E501,D401,D403 - """Get the status of the instance. - - Retrieves the status and InfluxDB version of the instance. Use this endpoint to monitor uptime for the InfluxDB instance. The response returns a HTTP `204` status code to inform you the instance is available. #### InfluxDB Cloud - Isn't versioned and doesn't return `X-Influxdb-Version` in the headers. #### Related guides - [Influx ping](https://docs.influxdata.com/influxdb/latest/reference/cli/influx/ping/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_ping_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_ping_prepare(**kwargs) # noqa: E501 - - return self.api_client.call_api( - '/ping', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_ping_async(self, **kwargs): # noqa: E501,D401,D403 - """Get the status of the instance. - - Retrieves the status and InfluxDB version of the instance. Use this endpoint to monitor uptime for the InfluxDB instance. The response returns a HTTP `204` status code to inform you the instance is available. #### InfluxDB Cloud - Isn't versioned and doesn't return `X-Influxdb-Version` in the headers. #### Related guides - [Influx ping](https://docs.influxdata.com/influxdb/latest/reference/cli/influx/ping/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_ping_prepare(**kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/ping', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_ping_prepare(self, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = [] # noqa: E501 - self._check_operation_params('get_ping', all_params, local_var_params) - - path_params = {} - - query_params = [] - - header_params = {} - - body_params = None - return local_var_params, path_params, query_params, header_params, body_params - - def head_ping(self, **kwargs): # noqa: E501,D401,D403 - """Get the status of the instance. - - Returns the status and InfluxDB version of the instance. Use this endpoint to monitor uptime for the InfluxDB instance. The response returns a HTTP `204` status code to inform you the instance is available. #### InfluxDB Cloud - Isn't versioned and doesn't return `X-Influxdb-Version` in the headers. #### Related guides - [Influx ping](https://docs.influxdata.com/influxdb/latest/reference/cli/influx/ping/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.head_ping(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.head_ping_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.head_ping_with_http_info(**kwargs) # noqa: E501 - return data - - def head_ping_with_http_info(self, **kwargs): # noqa: E501,D401,D403 - """Get the status of the instance. - - Returns the status and InfluxDB version of the instance. Use this endpoint to monitor uptime for the InfluxDB instance. The response returns a HTTP `204` status code to inform you the instance is available. #### InfluxDB Cloud - Isn't versioned and doesn't return `X-Influxdb-Version` in the headers. #### Related guides - [Influx ping](https://docs.influxdata.com/influxdb/latest/reference/cli/influx/ping/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.head_ping_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._head_ping_prepare(**kwargs) # noqa: E501 - - return self.api_client.call_api( - '/ping', 'HEAD', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def head_ping_async(self, **kwargs): # noqa: E501,D401,D403 - """Get the status of the instance. - - Returns the status and InfluxDB version of the instance. Use this endpoint to monitor uptime for the InfluxDB instance. The response returns a HTTP `204` status code to inform you the instance is available. #### InfluxDB Cloud - Isn't versioned and doesn't return `X-Influxdb-Version` in the headers. #### Related guides - [Influx ping](https://docs.influxdata.com/influxdb/latest/reference/cli/influx/ping/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._head_ping_prepare(**kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/ping', 'HEAD', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _head_ping_prepare(self, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = [] # noqa: E501 - self._check_operation_params('head_ping', all_params, local_var_params) - - path_params = {} - - query_params = [] - - header_params = {} - - body_params = None - return local_var_params, path_params, query_params, header_params, body_params diff --git a/frogpilot/third_party/influxdb_client/service/query_service.py b/frogpilot/third_party/influxdb_client/service/query_service.py deleted file mode 100644 index 0be81222..00000000 --- a/frogpilot/third_party/influxdb_client/service/query_service.py +++ /dev/null @@ -1,646 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -from influxdb_client.service._base_service import _BaseService - - -class QueryService(_BaseService): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): # noqa: E501,D401,D403 - """QueryService - a operation defined in OpenAPI.""" - super().__init__(api_client) - - def get_query_suggestions(self, **kwargs): # noqa: E501,D401,D403 - """List Flux query suggestions. - - Lists Flux query suggestions. Each suggestion contains a [Flux function](https://docs.influxdata.com/flux/v0.x/stdlib/all-functions/) name and parameters. Use this endpoint to retrieve a list of Flux query suggestions used in the InfluxDB Flux Query Builder. #### Limitations - When writing a query, avoid using `_functionName()` helper functions exposed by this endpoint. Helper function names have an underscore (`_`) prefix and aren't meant to be used directly in queries--for example: - To sort on a column and keep the top n records, use the `top(n, columns=["_value"], tables=<-)` function instead of the `_sortLimit` helper function. `top` uses `_sortLimit`. #### Related Guides - [List of all Flux functions](https://docs.influxdata.com/flux/v0.x/stdlib/all-functions/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_query_suggestions(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :return: FluxSuggestions - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_query_suggestions_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_query_suggestions_with_http_info(**kwargs) # noqa: E501 - return data - - def get_query_suggestions_with_http_info(self, **kwargs): # noqa: E501,D401,D403 - """List Flux query suggestions. - - Lists Flux query suggestions. Each suggestion contains a [Flux function](https://docs.influxdata.com/flux/v0.x/stdlib/all-functions/) name and parameters. Use this endpoint to retrieve a list of Flux query suggestions used in the InfluxDB Flux Query Builder. #### Limitations - When writing a query, avoid using `_functionName()` helper functions exposed by this endpoint. Helper function names have an underscore (`_`) prefix and aren't meant to be used directly in queries--for example: - To sort on a column and keep the top n records, use the `top(n, columns=["_value"], tables=<-)` function instead of the `_sortLimit` helper function. `top` uses `_sortLimit`. #### Related Guides - [List of all Flux functions](https://docs.influxdata.com/flux/v0.x/stdlib/all-functions/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_query_suggestions_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :return: FluxSuggestions - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_query_suggestions_prepare(**kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/query/suggestions', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='FluxSuggestions', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_query_suggestions_async(self, **kwargs): # noqa: E501,D401,D403 - """List Flux query suggestions. - - Lists Flux query suggestions. Each suggestion contains a [Flux function](https://docs.influxdata.com/flux/v0.x/stdlib/all-functions/) name and parameters. Use this endpoint to retrieve a list of Flux query suggestions used in the InfluxDB Flux Query Builder. #### Limitations - When writing a query, avoid using `_functionName()` helper functions exposed by this endpoint. Helper function names have an underscore (`_`) prefix and aren't meant to be used directly in queries--for example: - To sort on a column and keep the top n records, use the `top(n, columns=["_value"], tables=<-)` function instead of the `_sortLimit` helper function. `top` uses `_sortLimit`. #### Related Guides - [List of all Flux functions](https://docs.influxdata.com/flux/v0.x/stdlib/all-functions/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :return: FluxSuggestions - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_query_suggestions_prepare(**kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/query/suggestions', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='FluxSuggestions', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_query_suggestions_prepare(self, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['zap_trace_span'] # noqa: E501 - self._check_operation_params('get_query_suggestions', all_params, local_var_params) - - path_params = {} - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'text/html']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_query_suggestions_name(self, name, **kwargs): # noqa: E501,D401,D403 - """Retrieve a query suggestion for a branching suggestion. - - Retrieves a query suggestion that contains the name and parameters of the requested function. Use this endpoint to pass a branching suggestion (a Flux function name) and retrieve the parameters of the requested function. #### Limitations - Use `/api/v2/query/suggestions/{name}` (without a trailing slash). `/api/v2/query/suggestions/{name}/` (note the trailing slash) results in a HTTP `301 Moved Permanently` status. - The function `name` must exist and must be spelled correctly. #### Related Guides - [List of all Flux functions](https://docs.influxdata.com/flux/v0.x/stdlib/all-functions/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_query_suggestions_name(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: A [Flux function](https://docs.influxdata.com/flux/v0.x/stdlib/all-functions/) name. (required) - :param str zap_trace_span: OpenTracing span context - :return: FluxSuggestion - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_query_suggestions_name_with_http_info(name, **kwargs) # noqa: E501 - else: - (data) = self.get_query_suggestions_name_with_http_info(name, **kwargs) # noqa: E501 - return data - - def get_query_suggestions_name_with_http_info(self, name, **kwargs): # noqa: E501,D401,D403 - """Retrieve a query suggestion for a branching suggestion. - - Retrieves a query suggestion that contains the name and parameters of the requested function. Use this endpoint to pass a branching suggestion (a Flux function name) and retrieve the parameters of the requested function. #### Limitations - Use `/api/v2/query/suggestions/{name}` (without a trailing slash). `/api/v2/query/suggestions/{name}/` (note the trailing slash) results in a HTTP `301 Moved Permanently` status. - The function `name` must exist and must be spelled correctly. #### Related Guides - [List of all Flux functions](https://docs.influxdata.com/flux/v0.x/stdlib/all-functions/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_query_suggestions_name_with_http_info(name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: A [Flux function](https://docs.influxdata.com/flux/v0.x/stdlib/all-functions/) name. (required) - :param str zap_trace_span: OpenTracing span context - :return: FluxSuggestion - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_query_suggestions_name_prepare(name, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/query/suggestions/{name}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='FluxSuggestion', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_query_suggestions_name_async(self, name, **kwargs): # noqa: E501,D401,D403 - """Retrieve a query suggestion for a branching suggestion. - - Retrieves a query suggestion that contains the name and parameters of the requested function. Use this endpoint to pass a branching suggestion (a Flux function name) and retrieve the parameters of the requested function. #### Limitations - Use `/api/v2/query/suggestions/{name}` (without a trailing slash). `/api/v2/query/suggestions/{name}/` (note the trailing slash) results in a HTTP `301 Moved Permanently` status. - The function `name` must exist and must be spelled correctly. #### Related Guides - [List of all Flux functions](https://docs.influxdata.com/flux/v0.x/stdlib/all-functions/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str name: A [Flux function](https://docs.influxdata.com/flux/v0.x/stdlib/all-functions/) name. (required) - :param str zap_trace_span: OpenTracing span context - :return: FluxSuggestion - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_query_suggestions_name_prepare(name, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/query/suggestions/{name}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='FluxSuggestion', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_query_suggestions_name_prepare(self, name, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['name', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_query_suggestions_name', all_params, local_var_params) - # verify the required parameter 'name' is set - if ('name' not in local_var_params or - local_var_params['name'] is None): - raise ValueError("Missing the required parameter `name` when calling `get_query_suggestions_name`") # noqa: E501 - - path_params = {} - if 'name' in local_var_params: - path_params['name'] = local_var_params['name'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_query(self, **kwargs): # noqa: E501,D401,D403 - """Query data. - - Retrieves data from buckets. Use this endpoint to send a Flux query request and retrieve data from a bucket. #### Rate limits (with InfluxDB Cloud) `read` rate limits apply. For more information, see [limits and adjustable quotas](https://docs.influxdata.com/influxdb/cloud/account-management/limits/). #### Related guides - [Query with the InfluxDB API](https://docs.influxdata.com/influxdb/latest/query-data/execute-queries/influx-api/) - [Get started with Flux](https://docs.influxdata.com/flux/v0.x/get-started/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_query(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param str accept_encoding: The content encoding (usually a compression algorithm) that the client can understand. - :param str content_type: - :param str org: An organization name or ID. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Queries the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either the `org` parameter or `orgID` parameter. - Queries the bucket in the specified organization. - :param str org_id: An organization ID. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Queries the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either the `org` parameter or `orgID` parameter. - Queries the bucket in the specified organization. - :param Query query: Flux query or specification to execute - :return: str - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_query_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.post_query_with_http_info(**kwargs) # noqa: E501 - return data - - def post_query_with_http_info(self, **kwargs): # noqa: E501,D401,D403 - """Query data. - - Retrieves data from buckets. Use this endpoint to send a Flux query request and retrieve data from a bucket. #### Rate limits (with InfluxDB Cloud) `read` rate limits apply. For more information, see [limits and adjustable quotas](https://docs.influxdata.com/influxdb/cloud/account-management/limits/). #### Related guides - [Query with the InfluxDB API](https://docs.influxdata.com/influxdb/latest/query-data/execute-queries/influx-api/) - [Get started with Flux](https://docs.influxdata.com/flux/v0.x/get-started/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_query_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param str accept_encoding: The content encoding (usually a compression algorithm) that the client can understand. - :param str content_type: - :param str org: An organization name or ID. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Queries the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either the `org` parameter or `orgID` parameter. - Queries the bucket in the specified organization. - :param str org_id: An organization ID. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Queries the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either the `org` parameter or `orgID` parameter. - Queries the bucket in the specified organization. - :param Query query: Flux query or specification to execute - :return: str - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_query_prepare(**kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/query', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='str', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_query_async(self, **kwargs): # noqa: E501,D401,D403 - """Query data. - - Retrieves data from buckets. Use this endpoint to send a Flux query request and retrieve data from a bucket. #### Rate limits (with InfluxDB Cloud) `read` rate limits apply. For more information, see [limits and adjustable quotas](https://docs.influxdata.com/influxdb/cloud/account-management/limits/). #### Related guides - [Query with the InfluxDB API](https://docs.influxdata.com/influxdb/latest/query-data/execute-queries/influx-api/) - [Get started with Flux](https://docs.influxdata.com/flux/v0.x/get-started/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param str accept_encoding: The content encoding (usually a compression algorithm) that the client can understand. - :param str content_type: - :param str org: An organization name or ID. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Queries the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either the `org` parameter or `orgID` parameter. - Queries the bucket in the specified organization. - :param str org_id: An organization ID. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Queries the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either the `org` parameter or `orgID` parameter. - Queries the bucket in the specified organization. - :param Query query: Flux query or specification to execute - :return: str - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_query_prepare(**kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/query', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='str', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_query_prepare(self, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['zap_trace_span', 'accept_encoding', 'content_type', 'org', 'org_id', 'query'] # noqa: E501 - self._check_operation_params('post_query', all_params, local_var_params) - - path_params = {} - - query_params = [] - if 'org' in local_var_params: - query_params.append(('org', local_var_params['org'])) # noqa: E501 - if 'org_id' in local_var_params: - query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501 - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - if 'accept_encoding' in local_var_params: - header_params['Accept-Encoding'] = local_var_params['accept_encoding'] # noqa: E501 - if 'content_type' in local_var_params: - header_params['Content-Type'] = local_var_params['content_type'] # noqa: E501 - - body_params = None - if 'query' in local_var_params: - body_params = local_var_params['query'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/csv', 'application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json', 'application/vnd.flux']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_query_analyze(self, **kwargs): # noqa: E501,D401,D403 - r"""Analyze a Flux query. - - Analyzes a [Flux query](https://docs.influxdata.com/flux/v0.x/) for syntax errors and returns the list of errors. In the following sample query, `from()` is missing the property key. ```json { "query": "from(: \\"iot_center\\")\\ |> range(start: -90d)\\ |> filter(fn: (r) => r._measurement == \\"environment\\")", "type": "flux" } ``` If you pass this in a request to the `/api/v2/analyze` endpoint, InfluxDB returns an `errors` list that contains an error object for the missing key. #### Limitations - The endpoint doesn't validate values in the query--for example: - The following sample query has correct syntax, but contains an incorrect `from()` property key: ```json { "query": "from(foo: \\"iot_center\\")\\ |> range(start: -90d)\\ |> filter(fn: (r) => r._measurement == \\"environment\\")", "type": "flux" } ``` If you pass this in a request to the `/api/v2/analyze` endpoint, InfluxDB returns an empty `errors` list. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_query_analyze(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param str content_type: - :param Query query: Flux query to analyze - :return: AnalyzeQueryResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_query_analyze_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.post_query_analyze_with_http_info(**kwargs) # noqa: E501 - return data - - def post_query_analyze_with_http_info(self, **kwargs): # noqa: E501,D401,D403 - r"""Analyze a Flux query. - - Analyzes a [Flux query](https://docs.influxdata.com/flux/v0.x/) for syntax errors and returns the list of errors. In the following sample query, `from()` is missing the property key. ```json { "query": "from(: \\"iot_center\\")\\ |> range(start: -90d)\\ |> filter(fn: (r) => r._measurement == \\"environment\\")", "type": "flux" } ``` If you pass this in a request to the `/api/v2/analyze` endpoint, InfluxDB returns an `errors` list that contains an error object for the missing key. #### Limitations - The endpoint doesn't validate values in the query--for example: - The following sample query has correct syntax, but contains an incorrect `from()` property key: ```json { "query": "from(foo: \\"iot_center\\")\\ |> range(start: -90d)\\ |> filter(fn: (r) => r._measurement == \\"environment\\")", "type": "flux" } ``` If you pass this in a request to the `/api/v2/analyze` endpoint, InfluxDB returns an empty `errors` list. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_query_analyze_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param str content_type: - :param Query query: Flux query to analyze - :return: AnalyzeQueryResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_query_analyze_prepare(**kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/query/analyze', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='AnalyzeQueryResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_query_analyze_async(self, **kwargs): # noqa: E501,D401,D403 - r"""Analyze a Flux query. - - Analyzes a [Flux query](https://docs.influxdata.com/flux/v0.x/) for syntax errors and returns the list of errors. In the following sample query, `from()` is missing the property key. ```json { "query": "from(: \\"iot_center\\")\\ |> range(start: -90d)\\ |> filter(fn: (r) => r._measurement == \\"environment\\")", "type": "flux" } ``` If you pass this in a request to the `/api/v2/analyze` endpoint, InfluxDB returns an `errors` list that contains an error object for the missing key. #### Limitations - The endpoint doesn't validate values in the query--for example: - The following sample query has correct syntax, but contains an incorrect `from()` property key: ```json { "query": "from(foo: \\"iot_center\\")\\ |> range(start: -90d)\\ |> filter(fn: (r) => r._measurement == \\"environment\\")", "type": "flux" } ``` If you pass this in a request to the `/api/v2/analyze` endpoint, InfluxDB returns an empty `errors` list. - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param str content_type: - :param Query query: Flux query to analyze - :return: AnalyzeQueryResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_query_analyze_prepare(**kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/query/analyze', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='AnalyzeQueryResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_query_analyze_prepare(self, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['zap_trace_span', 'content_type', 'query'] # noqa: E501 - self._check_operation_params('post_query_analyze', all_params, local_var_params) - - path_params = {} - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - if 'content_type' in local_var_params: - header_params['Content-Type'] = local_var_params['content_type'] # noqa: E501 - - body_params = None - if 'query' in local_var_params: - body_params = local_var_params['query'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_query_ast(self, **kwargs): # noqa: E501,D401,D403 - r"""Generate a query Abstract Syntax Tree (AST). - - Analyzes a Flux query and returns a complete package source [Abstract Syntax Tree (AST)](https://docs.influxdata.com/influxdb/latest/reference/glossary/#abstract-syntax-tree-ast) for the query. Use this endpoint for deep query analysis such as debugging unexpected query results. A Flux query AST provides a semantic, tree-like representation with contextual information about the query. The AST illustrates how the query is distributed into different components for execution. #### Limitations - The endpoint doesn't validate values in the query--for example: The following sample Flux query has correct syntax, but contains an incorrect `from()` property key: ```js from(foo: "iot_center") |> range(start: -90d) |> filter(fn: (r) => r._measurement == "environment") ``` The following sample JSON shows how to pass the query in the request body: ```js from(foo: "iot_center") |> range(start: -90d) |> filter(fn: (r) => r._measurement == "environment") ``` The following code sample shows how to pass the query as JSON in the request body: ```json { "query": "from(foo: \\"iot_center\\")\\ |> range(start: -90d)\\ |> filter(fn: (r) => r._measurement == \\"environment\\")" } ``` Passing this to `/api/v2/query/ast` will return a successful response with a generated AST. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_query_ast(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param str content_type: - :param LanguageRequest language_request: The Flux query to analyze. - :return: ASTResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_query_ast_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.post_query_ast_with_http_info(**kwargs) # noqa: E501 - return data - - def post_query_ast_with_http_info(self, **kwargs): # noqa: E501,D401,D403 - r"""Generate a query Abstract Syntax Tree (AST). - - Analyzes a Flux query and returns a complete package source [Abstract Syntax Tree (AST)](https://docs.influxdata.com/influxdb/latest/reference/glossary/#abstract-syntax-tree-ast) for the query. Use this endpoint for deep query analysis such as debugging unexpected query results. A Flux query AST provides a semantic, tree-like representation with contextual information about the query. The AST illustrates how the query is distributed into different components for execution. #### Limitations - The endpoint doesn't validate values in the query--for example: The following sample Flux query has correct syntax, but contains an incorrect `from()` property key: ```js from(foo: "iot_center") |> range(start: -90d) |> filter(fn: (r) => r._measurement == "environment") ``` The following sample JSON shows how to pass the query in the request body: ```js from(foo: "iot_center") |> range(start: -90d) |> filter(fn: (r) => r._measurement == "environment") ``` The following code sample shows how to pass the query as JSON in the request body: ```json { "query": "from(foo: \\"iot_center\\")\\ |> range(start: -90d)\\ |> filter(fn: (r) => r._measurement == \\"environment\\")" } ``` Passing this to `/api/v2/query/ast` will return a successful response with a generated AST. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_query_ast_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param str content_type: - :param LanguageRequest language_request: The Flux query to analyze. - :return: ASTResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_query_ast_prepare(**kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/query/ast', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ASTResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_query_ast_async(self, **kwargs): # noqa: E501,D401,D403 - r"""Generate a query Abstract Syntax Tree (AST). - - Analyzes a Flux query and returns a complete package source [Abstract Syntax Tree (AST)](https://docs.influxdata.com/influxdb/latest/reference/glossary/#abstract-syntax-tree-ast) for the query. Use this endpoint for deep query analysis such as debugging unexpected query results. A Flux query AST provides a semantic, tree-like representation with contextual information about the query. The AST illustrates how the query is distributed into different components for execution. #### Limitations - The endpoint doesn't validate values in the query--for example: The following sample Flux query has correct syntax, but contains an incorrect `from()` property key: ```js from(foo: "iot_center") |> range(start: -90d) |> filter(fn: (r) => r._measurement == "environment") ``` The following sample JSON shows how to pass the query in the request body: ```js from(foo: "iot_center") |> range(start: -90d) |> filter(fn: (r) => r._measurement == "environment") ``` The following code sample shows how to pass the query as JSON in the request body: ```json { "query": "from(foo: \\"iot_center\\")\\ |> range(start: -90d)\\ |> filter(fn: (r) => r._measurement == \\"environment\\")" } ``` Passing this to `/api/v2/query/ast` will return a successful response with a generated AST. - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param str content_type: - :param LanguageRequest language_request: The Flux query to analyze. - :return: ASTResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_query_ast_prepare(**kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/query/ast', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ASTResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_query_ast_prepare(self, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['zap_trace_span', 'content_type', 'language_request'] # noqa: E501 - self._check_operation_params('post_query_ast', all_params, local_var_params) - - path_params = {} - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - if 'content_type' in local_var_params: - header_params['Content-Type'] = local_var_params['content_type'] # noqa: E501 - - body_params = None - if 'language_request' in local_var_params: - body_params = local_var_params['language_request'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params diff --git a/frogpilot/third_party/influxdb_client/service/ready_service.py b/frogpilot/third_party/influxdb_client/service/ready_service.py deleted file mode 100644 index 407435ba..00000000 --- a/frogpilot/third_party/influxdb_client/service/ready_service.py +++ /dev/null @@ -1,137 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -from influxdb_client.service._base_service import _BaseService - - -class ReadyService(_BaseService): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): # noqa: E501,D401,D403 - """ReadyService - a operation defined in OpenAPI.""" - super().__init__(api_client) - - def get_ready(self, **kwargs): # noqa: E501,D401,D403 - """Get the readiness of an instance at startup. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_ready(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :return: Ready - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_ready_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_ready_with_http_info(**kwargs) # noqa: E501 - return data - - def get_ready_with_http_info(self, **kwargs): # noqa: E501,D401,D403 - """Get the readiness of an instance at startup. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_ready_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :return: Ready - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_ready_prepare(**kwargs) # noqa: E501 - - return self.api_client.call_api( - '/ready', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Ready', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_ready_async(self, **kwargs): # noqa: E501,D401,D403 - """Get the readiness of an instance at startup. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :return: Ready - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_ready_prepare(**kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/ready', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Ready', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_ready_prepare(self, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['zap_trace_span'] # noqa: E501 - self._check_operation_params('get_ready', all_params, local_var_params) - - path_params = {} - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params diff --git a/frogpilot/third_party/influxdb_client/service/remote_connections_service.py b/frogpilot/third_party/influxdb_client/service/remote_connections_service.py deleted file mode 100644 index 7c591078..00000000 --- a/frogpilot/third_party/influxdb_client/service/remote_connections_service.py +++ /dev/null @@ -1,632 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -from influxdb_client.service._base_service import _BaseService - - -class RemoteConnectionsService(_BaseService): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): # noqa: E501,D401,D403 - """RemoteConnectionsService - a operation defined in OpenAPI.""" - super().__init__(api_client) - - def delete_remote_connection_by_id(self, remote_id, **kwargs): # noqa: E501,D401,D403 - """Delete a remote connection. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_remote_connection_by_id(remote_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str remote_id: (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_remote_connection_by_id_with_http_info(remote_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_remote_connection_by_id_with_http_info(remote_id, **kwargs) # noqa: E501 - return data - - def delete_remote_connection_by_id_with_http_info(self, remote_id, **kwargs): # noqa: E501,D401,D403 - """Delete a remote connection. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_remote_connection_by_id_with_http_info(remote_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str remote_id: (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_remote_connection_by_id_prepare(remote_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/remotes/{remoteID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def delete_remote_connection_by_id_async(self, remote_id, **kwargs): # noqa: E501,D401,D403 - """Delete a remote connection. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str remote_id: (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_remote_connection_by_id_prepare(remote_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/remotes/{remoteID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _delete_remote_connection_by_id_prepare(self, remote_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['remote_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('delete_remote_connection_by_id', all_params, local_var_params) - # verify the required parameter 'remote_id' is set - if ('remote_id' not in local_var_params or - local_var_params['remote_id'] is None): - raise ValueError("Missing the required parameter `remote_id` when calling `delete_remote_connection_by_id`") # noqa: E501 - - path_params = {} - if 'remote_id' in local_var_params: - path_params['remoteID'] = local_var_params['remote_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_remote_connection_by_id(self, remote_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a remote connection. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_remote_connection_by_id(remote_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str remote_id: (required) - :param str zap_trace_span: OpenTracing span context - :return: RemoteConnection - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_remote_connection_by_id_with_http_info(remote_id, **kwargs) # noqa: E501 - else: - (data) = self.get_remote_connection_by_id_with_http_info(remote_id, **kwargs) # noqa: E501 - return data - - def get_remote_connection_by_id_with_http_info(self, remote_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a remote connection. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_remote_connection_by_id_with_http_info(remote_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str remote_id: (required) - :param str zap_trace_span: OpenTracing span context - :return: RemoteConnection - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_remote_connection_by_id_prepare(remote_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/remotes/{remoteID}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='RemoteConnection', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_remote_connection_by_id_async(self, remote_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a remote connection. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str remote_id: (required) - :param str zap_trace_span: OpenTracing span context - :return: RemoteConnection - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_remote_connection_by_id_prepare(remote_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/remotes/{remoteID}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='RemoteConnection', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_remote_connection_by_id_prepare(self, remote_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['remote_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_remote_connection_by_id', all_params, local_var_params) - # verify the required parameter 'remote_id' is set - if ('remote_id' not in local_var_params or - local_var_params['remote_id'] is None): - raise ValueError("Missing the required parameter `remote_id` when calling `get_remote_connection_by_id`") # noqa: E501 - - path_params = {} - if 'remote_id' in local_var_params: - path_params['remoteID'] = local_var_params['remote_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_remote_connections(self, org_id, **kwargs): # noqa: E501,D401,D403 - """List all remote connections. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_remote_connections(org_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str org_id: The organization ID. (required) - :param str zap_trace_span: OpenTracing span context - :param str name: - :param str remote_url: - :return: RemoteConnections - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_remote_connections_with_http_info(org_id, **kwargs) # noqa: E501 - else: - (data) = self.get_remote_connections_with_http_info(org_id, **kwargs) # noqa: E501 - return data - - def get_remote_connections_with_http_info(self, org_id, **kwargs): # noqa: E501,D401,D403 - """List all remote connections. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_remote_connections_with_http_info(org_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str org_id: The organization ID. (required) - :param str zap_trace_span: OpenTracing span context - :param str name: - :param str remote_url: - :return: RemoteConnections - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_remote_connections_prepare(org_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/remotes', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='RemoteConnections', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_remote_connections_async(self, org_id, **kwargs): # noqa: E501,D401,D403 - """List all remote connections. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str org_id: The organization ID. (required) - :param str zap_trace_span: OpenTracing span context - :param str name: - :param str remote_url: - :return: RemoteConnections - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_remote_connections_prepare(org_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/remotes', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='RemoteConnections', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_remote_connections_prepare(self, org_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['org_id', 'zap_trace_span', 'name', 'remote_url'] # noqa: E501 - self._check_operation_params('get_remote_connections', all_params, local_var_params) - # verify the required parameter 'org_id' is set - if ('org_id' not in local_var_params or - local_var_params['org_id'] is None): - raise ValueError("Missing the required parameter `org_id` when calling `get_remote_connections`") # noqa: E501 - - path_params = {} - - query_params = [] - if 'org_id' in local_var_params: - query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501 - if 'name' in local_var_params: - query_params.append(('name', local_var_params['name'])) # noqa: E501 - if 'remote_url' in local_var_params: - query_params.append(('remoteURL', local_var_params['remote_url'])) # noqa: E501 - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def patch_remote_connection_by_id(self, remote_id, remote_connection_update_request, **kwargs): # noqa: E501,D401,D403 - """Update a remote connection. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_remote_connection_by_id(remote_id, remote_connection_update_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str remote_id: (required) - :param RemoteConnectionUpdateRequest remote_connection_update_request: (required) - :param str zap_trace_span: OpenTracing span context - :return: RemoteConnection - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.patch_remote_connection_by_id_with_http_info(remote_id, remote_connection_update_request, **kwargs) # noqa: E501 - else: - (data) = self.patch_remote_connection_by_id_with_http_info(remote_id, remote_connection_update_request, **kwargs) # noqa: E501 - return data - - def patch_remote_connection_by_id_with_http_info(self, remote_id, remote_connection_update_request, **kwargs): # noqa: E501,D401,D403 - """Update a remote connection. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_remote_connection_by_id_with_http_info(remote_id, remote_connection_update_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str remote_id: (required) - :param RemoteConnectionUpdateRequest remote_connection_update_request: (required) - :param str zap_trace_span: OpenTracing span context - :return: RemoteConnection - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_remote_connection_by_id_prepare(remote_id, remote_connection_update_request, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/remotes/{remoteID}', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='RemoteConnection', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def patch_remote_connection_by_id_async(self, remote_id, remote_connection_update_request, **kwargs): # noqa: E501,D401,D403 - """Update a remote connection. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str remote_id: (required) - :param RemoteConnectionUpdateRequest remote_connection_update_request: (required) - :param str zap_trace_span: OpenTracing span context - :return: RemoteConnection - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_remote_connection_by_id_prepare(remote_id, remote_connection_update_request, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/remotes/{remoteID}', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='RemoteConnection', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _patch_remote_connection_by_id_prepare(self, remote_id, remote_connection_update_request, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['remote_id', 'remote_connection_update_request', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('patch_remote_connection_by_id', all_params, local_var_params) - # verify the required parameter 'remote_id' is set - if ('remote_id' not in local_var_params or - local_var_params['remote_id'] is None): - raise ValueError("Missing the required parameter `remote_id` when calling `patch_remote_connection_by_id`") # noqa: E501 - # verify the required parameter 'remote_connection_update_request' is set - if ('remote_connection_update_request' not in local_var_params or - local_var_params['remote_connection_update_request'] is None): - raise ValueError("Missing the required parameter `remote_connection_update_request` when calling `patch_remote_connection_by_id`") # noqa: E501 - - path_params = {} - if 'remote_id' in local_var_params: - path_params['remoteID'] = local_var_params['remote_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'remote_connection_update_request' in local_var_params: - body_params = local_var_params['remote_connection_update_request'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_remote_connection(self, remote_connection_creation_request, **kwargs): # noqa: E501,D401,D403 - """Register a new remote connection. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_remote_connection(remote_connection_creation_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param RemoteConnectionCreationRequest remote_connection_creation_request: (required) - :return: RemoteConnection - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_remote_connection_with_http_info(remote_connection_creation_request, **kwargs) # noqa: E501 - else: - (data) = self.post_remote_connection_with_http_info(remote_connection_creation_request, **kwargs) # noqa: E501 - return data - - def post_remote_connection_with_http_info(self, remote_connection_creation_request, **kwargs): # noqa: E501,D401,D403 - """Register a new remote connection. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_remote_connection_with_http_info(remote_connection_creation_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param RemoteConnectionCreationRequest remote_connection_creation_request: (required) - :return: RemoteConnection - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_remote_connection_prepare(remote_connection_creation_request, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/remotes', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='RemoteConnection', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_remote_connection_async(self, remote_connection_creation_request, **kwargs): # noqa: E501,D401,D403 - """Register a new remote connection. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param RemoteConnectionCreationRequest remote_connection_creation_request: (required) - :return: RemoteConnection - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_remote_connection_prepare(remote_connection_creation_request, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/remotes', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='RemoteConnection', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_remote_connection_prepare(self, remote_connection_creation_request, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['remote_connection_creation_request'] # noqa: E501 - self._check_operation_params('post_remote_connection', all_params, local_var_params) - # verify the required parameter 'remote_connection_creation_request' is set - if ('remote_connection_creation_request' not in local_var_params or - local_var_params['remote_connection_creation_request'] is None): - raise ValueError("Missing the required parameter `remote_connection_creation_request` when calling `post_remote_connection`") # noqa: E501 - - path_params = {} - - query_params = [] - - header_params = {} - - body_params = None - if 'remote_connection_creation_request' in local_var_params: - body_params = local_var_params['remote_connection_creation_request'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params diff --git a/frogpilot/third_party/influxdb_client/service/replications_service.py b/frogpilot/third_party/influxdb_client/service/replications_service.py deleted file mode 100644 index 2130490a..00000000 --- a/frogpilot/third_party/influxdb_client/service/replications_service.py +++ /dev/null @@ -1,768 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -from influxdb_client.service._base_service import _BaseService - - -class ReplicationsService(_BaseService): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): # noqa: E501,D401,D403 - """ReplicationsService - a operation defined in OpenAPI.""" - super().__init__(api_client) - - def delete_replication_by_id(self, replication_id, **kwargs): # noqa: E501,D401,D403 - """Delete a replication. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_replication_by_id(replication_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str replication_id: (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_replication_by_id_with_http_info(replication_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_replication_by_id_with_http_info(replication_id, **kwargs) # noqa: E501 - return data - - def delete_replication_by_id_with_http_info(self, replication_id, **kwargs): # noqa: E501,D401,D403 - """Delete a replication. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_replication_by_id_with_http_info(replication_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str replication_id: (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_replication_by_id_prepare(replication_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/replications/{replicationID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def delete_replication_by_id_async(self, replication_id, **kwargs): # noqa: E501,D401,D403 - """Delete a replication. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str replication_id: (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_replication_by_id_prepare(replication_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/replications/{replicationID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _delete_replication_by_id_prepare(self, replication_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['replication_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('delete_replication_by_id', all_params, local_var_params) - # verify the required parameter 'replication_id' is set - if ('replication_id' not in local_var_params or - local_var_params['replication_id'] is None): - raise ValueError("Missing the required parameter `replication_id` when calling `delete_replication_by_id`") # noqa: E501 - - path_params = {} - if 'replication_id' in local_var_params: - path_params['replicationID'] = local_var_params['replication_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_replication_by_id(self, replication_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a replication. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_replication_by_id(replication_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str replication_id: (required) - :param str zap_trace_span: OpenTracing span context - :return: Replication - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_replication_by_id_with_http_info(replication_id, **kwargs) # noqa: E501 - else: - (data) = self.get_replication_by_id_with_http_info(replication_id, **kwargs) # noqa: E501 - return data - - def get_replication_by_id_with_http_info(self, replication_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a replication. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_replication_by_id_with_http_info(replication_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str replication_id: (required) - :param str zap_trace_span: OpenTracing span context - :return: Replication - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_replication_by_id_prepare(replication_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/replications/{replicationID}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Replication', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_replication_by_id_async(self, replication_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a replication. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str replication_id: (required) - :param str zap_trace_span: OpenTracing span context - :return: Replication - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_replication_by_id_prepare(replication_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/replications/{replicationID}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Replication', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_replication_by_id_prepare(self, replication_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['replication_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_replication_by_id', all_params, local_var_params) - # verify the required parameter 'replication_id' is set - if ('replication_id' not in local_var_params or - local_var_params['replication_id'] is None): - raise ValueError("Missing the required parameter `replication_id` when calling `get_replication_by_id`") # noqa: E501 - - path_params = {} - if 'replication_id' in local_var_params: - path_params['replicationID'] = local_var_params['replication_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_replications(self, org_id, **kwargs): # noqa: E501,D401,D403 - """List all replications. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_replications(org_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str org_id: The organization ID. (required) - :param str zap_trace_span: OpenTracing span context - :param str name: - :param str remote_id: - :param str local_bucket_id: - :return: Replications - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_replications_with_http_info(org_id, **kwargs) # noqa: E501 - else: - (data) = self.get_replications_with_http_info(org_id, **kwargs) # noqa: E501 - return data - - def get_replications_with_http_info(self, org_id, **kwargs): # noqa: E501,D401,D403 - """List all replications. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_replications_with_http_info(org_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str org_id: The organization ID. (required) - :param str zap_trace_span: OpenTracing span context - :param str name: - :param str remote_id: - :param str local_bucket_id: - :return: Replications - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_replications_prepare(org_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/replications', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Replications', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_replications_async(self, org_id, **kwargs): # noqa: E501,D401,D403 - """List all replications. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str org_id: The organization ID. (required) - :param str zap_trace_span: OpenTracing span context - :param str name: - :param str remote_id: - :param str local_bucket_id: - :return: Replications - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_replications_prepare(org_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/replications', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Replications', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_replications_prepare(self, org_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['org_id', 'zap_trace_span', 'name', 'remote_id', 'local_bucket_id'] # noqa: E501 - self._check_operation_params('get_replications', all_params, local_var_params) - # verify the required parameter 'org_id' is set - if ('org_id' not in local_var_params or - local_var_params['org_id'] is None): - raise ValueError("Missing the required parameter `org_id` when calling `get_replications`") # noqa: E501 - - path_params = {} - - query_params = [] - if 'org_id' in local_var_params: - query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501 - if 'name' in local_var_params: - query_params.append(('name', local_var_params['name'])) # noqa: E501 - if 'remote_id' in local_var_params: - query_params.append(('remoteID', local_var_params['remote_id'])) # noqa: E501 - if 'local_bucket_id' in local_var_params: - query_params.append(('localBucketID', local_var_params['local_bucket_id'])) # noqa: E501 - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def patch_replication_by_id(self, replication_id, replication_update_request, **kwargs): # noqa: E501,D401,D403 - """Update a replication. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_replication_by_id(replication_id, replication_update_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str replication_id: (required) - :param ReplicationUpdateRequest replication_update_request: (required) - :param str zap_trace_span: OpenTracing span context - :param bool validate: If true, validate the updated information, but don't save it. - :return: Replication - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.patch_replication_by_id_with_http_info(replication_id, replication_update_request, **kwargs) # noqa: E501 - else: - (data) = self.patch_replication_by_id_with_http_info(replication_id, replication_update_request, **kwargs) # noqa: E501 - return data - - def patch_replication_by_id_with_http_info(self, replication_id, replication_update_request, **kwargs): # noqa: E501,D401,D403 - """Update a replication. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_replication_by_id_with_http_info(replication_id, replication_update_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str replication_id: (required) - :param ReplicationUpdateRequest replication_update_request: (required) - :param str zap_trace_span: OpenTracing span context - :param bool validate: If true, validate the updated information, but don't save it. - :return: Replication - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_replication_by_id_prepare(replication_id, replication_update_request, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/replications/{replicationID}', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Replication', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def patch_replication_by_id_async(self, replication_id, replication_update_request, **kwargs): # noqa: E501,D401,D403 - """Update a replication. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str replication_id: (required) - :param ReplicationUpdateRequest replication_update_request: (required) - :param str zap_trace_span: OpenTracing span context - :param bool validate: If true, validate the updated information, but don't save it. - :return: Replication - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_replication_by_id_prepare(replication_id, replication_update_request, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/replications/{replicationID}', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Replication', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _patch_replication_by_id_prepare(self, replication_id, replication_update_request, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['replication_id', 'replication_update_request', 'zap_trace_span', 'validate'] # noqa: E501 - self._check_operation_params('patch_replication_by_id', all_params, local_var_params) - # verify the required parameter 'replication_id' is set - if ('replication_id' not in local_var_params or - local_var_params['replication_id'] is None): - raise ValueError("Missing the required parameter `replication_id` when calling `patch_replication_by_id`") # noqa: E501 - # verify the required parameter 'replication_update_request' is set - if ('replication_update_request' not in local_var_params or - local_var_params['replication_update_request'] is None): - raise ValueError("Missing the required parameter `replication_update_request` when calling `patch_replication_by_id`") # noqa: E501 - - path_params = {} - if 'replication_id' in local_var_params: - path_params['replicationID'] = local_var_params['replication_id'] # noqa: E501 - - query_params = [] - if 'validate' in local_var_params: - query_params.append(('validate', local_var_params['validate'])) # noqa: E501 - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'replication_update_request' in local_var_params: - body_params = local_var_params['replication_update_request'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_replication(self, replication_creation_request, **kwargs): # noqa: E501,D401,D403 - """Register a new replication. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_replication(replication_creation_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param ReplicationCreationRequest replication_creation_request: (required) - :param str zap_trace_span: OpenTracing span context - :param bool validate: If true, validate the replication, but don't save it. - :return: Replication - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_replication_with_http_info(replication_creation_request, **kwargs) # noqa: E501 - else: - (data) = self.post_replication_with_http_info(replication_creation_request, **kwargs) # noqa: E501 - return data - - def post_replication_with_http_info(self, replication_creation_request, **kwargs): # noqa: E501,D401,D403 - """Register a new replication. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_replication_with_http_info(replication_creation_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param ReplicationCreationRequest replication_creation_request: (required) - :param str zap_trace_span: OpenTracing span context - :param bool validate: If true, validate the replication, but don't save it. - :return: Replication - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_replication_prepare(replication_creation_request, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/replications', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Replication', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_replication_async(self, replication_creation_request, **kwargs): # noqa: E501,D401,D403 - """Register a new replication. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param ReplicationCreationRequest replication_creation_request: (required) - :param str zap_trace_span: OpenTracing span context - :param bool validate: If true, validate the replication, but don't save it. - :return: Replication - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_replication_prepare(replication_creation_request, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/replications', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Replication', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_replication_prepare(self, replication_creation_request, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['replication_creation_request', 'zap_trace_span', 'validate'] # noqa: E501 - self._check_operation_params('post_replication', all_params, local_var_params) - # verify the required parameter 'replication_creation_request' is set - if ('replication_creation_request' not in local_var_params or - local_var_params['replication_creation_request'] is None): - raise ValueError("Missing the required parameter `replication_creation_request` when calling `post_replication`") # noqa: E501 - - path_params = {} - - query_params = [] - if 'validate' in local_var_params: - query_params.append(('validate', local_var_params['validate'])) # noqa: E501 - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'replication_creation_request' in local_var_params: - body_params = local_var_params['replication_creation_request'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_validate_replication_by_id(self, replication_id, **kwargs): # noqa: E501,D401,D403 - """Validate a replication. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_validate_replication_by_id(replication_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str replication_id: (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_validate_replication_by_id_with_http_info(replication_id, **kwargs) # noqa: E501 - else: - (data) = self.post_validate_replication_by_id_with_http_info(replication_id, **kwargs) # noqa: E501 - return data - - def post_validate_replication_by_id_with_http_info(self, replication_id, **kwargs): # noqa: E501,D401,D403 - """Validate a replication. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_validate_replication_by_id_with_http_info(replication_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str replication_id: (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_validate_replication_by_id_prepare(replication_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/replications/{replicationID}/validate', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_validate_replication_by_id_async(self, replication_id, **kwargs): # noqa: E501,D401,D403 - """Validate a replication. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str replication_id: (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_validate_replication_by_id_prepare(replication_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/replications/{replicationID}/validate', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_validate_replication_by_id_prepare(self, replication_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['replication_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('post_validate_replication_by_id', all_params, local_var_params) - # verify the required parameter 'replication_id' is set - if ('replication_id' not in local_var_params or - local_var_params['replication_id'] is None): - raise ValueError("Missing the required parameter `replication_id` when calling `post_validate_replication_by_id`") # noqa: E501 - - path_params = {} - if 'replication_id' in local_var_params: - path_params['replicationID'] = local_var_params['replication_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params diff --git a/frogpilot/third_party/influxdb_client/service/resources_service.py b/frogpilot/third_party/influxdb_client/service/resources_service.py deleted file mode 100644 index d86cfe39..00000000 --- a/frogpilot/third_party/influxdb_client/service/resources_service.py +++ /dev/null @@ -1,137 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -from influxdb_client.service._base_service import _BaseService - - -class ResourcesService(_BaseService): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): # noqa: E501,D401,D403 - """ResourcesService - a operation defined in OpenAPI.""" - super().__init__(api_client) - - def get_resources(self, **kwargs): # noqa: E501,D401,D403 - """List all known resources. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_resources(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :return: list[str] - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_resources_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_resources_with_http_info(**kwargs) # noqa: E501 - return data - - def get_resources_with_http_info(self, **kwargs): # noqa: E501,D401,D403 - """List all known resources. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_resources_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :return: list[str] - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_resources_prepare(**kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/resources', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='list[str]', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_resources_async(self, **kwargs): # noqa: E501,D401,D403 - """List all known resources. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :return: list[str] - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_resources_prepare(**kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/resources', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='list[str]', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_resources_prepare(self, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['zap_trace_span'] # noqa: E501 - self._check_operation_params('get_resources', all_params, local_var_params) - - path_params = {} - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params diff --git a/frogpilot/third_party/influxdb_client/service/restore_service.py b/frogpilot/third_party/influxdb_client/service/restore_service.py deleted file mode 100644 index 6275ed01..00000000 --- a/frogpilot/third_party/influxdb_client/service/restore_service.py +++ /dev/null @@ -1,683 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -from influxdb_client.service._base_service import _BaseService - - -class RestoreService(_BaseService): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): # noqa: E501,D401,D403 - """RestoreService - a operation defined in OpenAPI.""" - super().__init__(api_client) - - def post_restore_bucket_id(self, bucket_id, body, **kwargs): # noqa: E501,D401,D403 - """Overwrite storage metadata for a bucket with shard info from a backup.. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_restore_bucket_id(bucket_id, body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str bucket_id: The bucket ID. (required) - :param str body: Database info serialized as protobuf. (required) - :param str zap_trace_span: OpenTracing span context - :param str content_type: - :return: str - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_restore_bucket_id_with_http_info(bucket_id, body, **kwargs) # noqa: E501 - else: - (data) = self.post_restore_bucket_id_with_http_info(bucket_id, body, **kwargs) # noqa: E501 - return data - - def post_restore_bucket_id_with_http_info(self, bucket_id, body, **kwargs): # noqa: E501,D401,D403 - """Overwrite storage metadata for a bucket with shard info from a backup.. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_restore_bucket_id_with_http_info(bucket_id, body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str bucket_id: The bucket ID. (required) - :param str body: Database info serialized as protobuf. (required) - :param str zap_trace_span: OpenTracing span context - :param str content_type: - :return: str - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_restore_bucket_id_prepare(bucket_id, body, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/restore/bucket/{bucketID}', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='str', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_restore_bucket_id_async(self, bucket_id, body, **kwargs): # noqa: E501,D401,D403 - """Overwrite storage metadata for a bucket with shard info from a backup.. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str bucket_id: The bucket ID. (required) - :param str body: Database info serialized as protobuf. (required) - :param str zap_trace_span: OpenTracing span context - :param str content_type: - :return: str - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_restore_bucket_id_prepare(bucket_id, body, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/restore/bucket/{bucketID}', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='str', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_restore_bucket_id_prepare(self, bucket_id, body, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['bucket_id', 'body', 'zap_trace_span', 'content_type'] # noqa: E501 - self._check_operation_params('post_restore_bucket_id', all_params, local_var_params) - # verify the required parameter 'bucket_id' is set - if ('bucket_id' not in local_var_params or - local_var_params['bucket_id'] is None): - raise ValueError("Missing the required parameter `bucket_id` when calling `post_restore_bucket_id`") # noqa: E501 - # verify the required parameter 'body' is set - if ('body' not in local_var_params or - local_var_params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `post_restore_bucket_id`") # noqa: E501 - - path_params = {} - if 'bucket_id' in local_var_params: - path_params['bucketID'] = local_var_params['bucket_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - if 'content_type' in local_var_params: - header_params['Content-Type'] = local_var_params['content_type'] # noqa: E501 - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['text/plain']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_restore_bucket_metadata(self, bucket_metadata_manifest, **kwargs): # noqa: E501,D401,D403 - """Create a new bucket pre-seeded with shard info from a backup.. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_restore_bucket_metadata(bucket_metadata_manifest, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param BucketMetadataManifest bucket_metadata_manifest: Metadata manifest for a bucket. (required) - :param str zap_trace_span: OpenTracing span context - :return: RestoredBucketMappings - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_restore_bucket_metadata_with_http_info(bucket_metadata_manifest, **kwargs) # noqa: E501 - else: - (data) = self.post_restore_bucket_metadata_with_http_info(bucket_metadata_manifest, **kwargs) # noqa: E501 - return data - - def post_restore_bucket_metadata_with_http_info(self, bucket_metadata_manifest, **kwargs): # noqa: E501,D401,D403 - """Create a new bucket pre-seeded with shard info from a backup.. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_restore_bucket_metadata_with_http_info(bucket_metadata_manifest, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param BucketMetadataManifest bucket_metadata_manifest: Metadata manifest for a bucket. (required) - :param str zap_trace_span: OpenTracing span context - :return: RestoredBucketMappings - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_restore_bucket_metadata_prepare(bucket_metadata_manifest, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/restore/bucketMetadata', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='RestoredBucketMappings', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_restore_bucket_metadata_async(self, bucket_metadata_manifest, **kwargs): # noqa: E501,D401,D403 - """Create a new bucket pre-seeded with shard info from a backup.. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param BucketMetadataManifest bucket_metadata_manifest: Metadata manifest for a bucket. (required) - :param str zap_trace_span: OpenTracing span context - :return: RestoredBucketMappings - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_restore_bucket_metadata_prepare(bucket_metadata_manifest, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/restore/bucketMetadata', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='RestoredBucketMappings', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_restore_bucket_metadata_prepare(self, bucket_metadata_manifest, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['bucket_metadata_manifest', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('post_restore_bucket_metadata', all_params, local_var_params) - # verify the required parameter 'bucket_metadata_manifest' is set - if ('bucket_metadata_manifest' not in local_var_params or - local_var_params['bucket_metadata_manifest'] is None): - raise ValueError("Missing the required parameter `bucket_metadata_manifest` when calling `post_restore_bucket_metadata`") # noqa: E501 - - path_params = {} - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'bucket_metadata_manifest' in local_var_params: - body_params = local_var_params['bucket_metadata_manifest'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_restore_kv(self, body, **kwargs): # noqa: E501,D401,D403 - """Overwrite the embedded KV store on the server with a backed-up snapshot.. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_restore_kv(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param file body: Full KV snapshot. (required) - :param str zap_trace_span: OpenTracing span context - :param str content_encoding: The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header. - :param str content_type: - :return: PostRestoreKVResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_restore_kv_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.post_restore_kv_with_http_info(body, **kwargs) # noqa: E501 - return data - - def post_restore_kv_with_http_info(self, body, **kwargs): # noqa: E501,D401,D403 - """Overwrite the embedded KV store on the server with a backed-up snapshot.. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_restore_kv_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param file body: Full KV snapshot. (required) - :param str zap_trace_span: OpenTracing span context - :param str content_encoding: The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header. - :param str content_type: - :return: PostRestoreKVResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_restore_kv_prepare(body, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/restore/kv', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='PostRestoreKVResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_restore_kv_async(self, body, **kwargs): # noqa: E501,D401,D403 - """Overwrite the embedded KV store on the server with a backed-up snapshot.. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param file body: Full KV snapshot. (required) - :param str zap_trace_span: OpenTracing span context - :param str content_encoding: The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header. - :param str content_type: - :return: PostRestoreKVResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_restore_kv_prepare(body, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/restore/kv', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='PostRestoreKVResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_restore_kv_prepare(self, body, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['body', 'zap_trace_span', 'content_encoding', 'content_type'] # noqa: E501 - self._check_operation_params('post_restore_kv', all_params, local_var_params) - # verify the required parameter 'body' is set - if ('body' not in local_var_params or - local_var_params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `post_restore_kv`") # noqa: E501 - - path_params = {} - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - if 'content_encoding' in local_var_params: - header_params['Content-Encoding'] = local_var_params['content_encoding'] # noqa: E501 - if 'content_type' in local_var_params: - header_params['Content-Type'] = local_var_params['content_type'] # noqa: E501 - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['text/plain']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_restore_shard_id(self, shard_id, body, **kwargs): # noqa: E501,D401,D403 - """Restore a TSM snapshot into a shard.. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_restore_shard_id(shard_id, body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str shard_id: The shard ID. (required) - :param file body: TSM snapshot. (required) - :param str zap_trace_span: OpenTracing span context - :param str content_encoding: The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header. - :param str content_type: - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_restore_shard_id_with_http_info(shard_id, body, **kwargs) # noqa: E501 - else: - (data) = self.post_restore_shard_id_with_http_info(shard_id, body, **kwargs) # noqa: E501 - return data - - def post_restore_shard_id_with_http_info(self, shard_id, body, **kwargs): # noqa: E501,D401,D403 - """Restore a TSM snapshot into a shard.. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_restore_shard_id_with_http_info(shard_id, body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str shard_id: The shard ID. (required) - :param file body: TSM snapshot. (required) - :param str zap_trace_span: OpenTracing span context - :param str content_encoding: The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header. - :param str content_type: - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_restore_shard_id_prepare(shard_id, body, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/restore/shards/{shardID}', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_restore_shard_id_async(self, shard_id, body, **kwargs): # noqa: E501,D401,D403 - """Restore a TSM snapshot into a shard.. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str shard_id: The shard ID. (required) - :param file body: TSM snapshot. (required) - :param str zap_trace_span: OpenTracing span context - :param str content_encoding: The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header. - :param str content_type: - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_restore_shard_id_prepare(shard_id, body, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/restore/shards/{shardID}', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_restore_shard_id_prepare(self, shard_id, body, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['shard_id', 'body', 'zap_trace_span', 'content_encoding', 'content_type'] # noqa: E501 - self._check_operation_params('post_restore_shard_id', all_params, local_var_params) - # verify the required parameter 'shard_id' is set - if ('shard_id' not in local_var_params or - local_var_params['shard_id'] is None): - raise ValueError("Missing the required parameter `shard_id` when calling `post_restore_shard_id`") # noqa: E501 - # verify the required parameter 'body' is set - if ('body' not in local_var_params or - local_var_params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `post_restore_shard_id`") # noqa: E501 - - path_params = {} - if 'shard_id' in local_var_params: - path_params['shardID'] = local_var_params['shard_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - if 'content_encoding' in local_var_params: - header_params['Content-Encoding'] = local_var_params['content_encoding'] # noqa: E501 - if 'content_type' in local_var_params: - header_params['Content-Type'] = local_var_params['content_type'] # noqa: E501 - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['text/plain']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_restore_sql(self, body, **kwargs): # noqa: E501,D401,D403 - """Overwrite the embedded SQL store on the server with a backed-up snapshot.. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_restore_sql(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param file body: Full SQL snapshot. (required) - :param str zap_trace_span: OpenTracing span context - :param str content_encoding: The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header. - :param str content_type: - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_restore_sql_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.post_restore_sql_with_http_info(body, **kwargs) # noqa: E501 - return data - - def post_restore_sql_with_http_info(self, body, **kwargs): # noqa: E501,D401,D403 - """Overwrite the embedded SQL store on the server with a backed-up snapshot.. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_restore_sql_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param file body: Full SQL snapshot. (required) - :param str zap_trace_span: OpenTracing span context - :param str content_encoding: The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header. - :param str content_type: - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_restore_sql_prepare(body, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/restore/sql', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_restore_sql_async(self, body, **kwargs): # noqa: E501,D401,D403 - """Overwrite the embedded SQL store on the server with a backed-up snapshot.. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param file body: Full SQL snapshot. (required) - :param str zap_trace_span: OpenTracing span context - :param str content_encoding: The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header. - :param str content_type: - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_restore_sql_prepare(body, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/restore/sql', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_restore_sql_prepare(self, body, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['body', 'zap_trace_span', 'content_encoding', 'content_type'] # noqa: E501 - self._check_operation_params('post_restore_sql', all_params, local_var_params) - # verify the required parameter 'body' is set - if ('body' not in local_var_params or - local_var_params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `post_restore_sql`") # noqa: E501 - - path_params = {} - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - if 'content_encoding' in local_var_params: - header_params['Content-Encoding'] = local_var_params['content_encoding'] # noqa: E501 - if 'content_type' in local_var_params: - header_params['Content-Type'] = local_var_params['content_type'] # noqa: E501 - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['text/plain']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params diff --git a/frogpilot/third_party/influxdb_client/service/routes_service.py b/frogpilot/third_party/influxdb_client/service/routes_service.py deleted file mode 100644 index 8b79c4f6..00000000 --- a/frogpilot/third_party/influxdb_client/service/routes_service.py +++ /dev/null @@ -1,140 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -from influxdb_client.service._base_service import _BaseService - - -class RoutesService(_BaseService): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): # noqa: E501,D401,D403 - """RoutesService - a operation defined in OpenAPI.""" - super().__init__(api_client) - - def get_routes(self, **kwargs): # noqa: E501,D401,D403 - """List all top level routes. - - Retrieves all the top level routes for the InfluxDB API. #### Limitations - Only returns top level routes--for example, the response contains `"tasks":"/api/v2/tasks"`, and doesn't contain resource-specific routes for tasks (`/api/v2/tasks/TASK_ID/...`). - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_routes(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :return: Routes - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_routes_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_routes_with_http_info(**kwargs) # noqa: E501 - return data - - def get_routes_with_http_info(self, **kwargs): # noqa: E501,D401,D403 - """List all top level routes. - - Retrieves all the top level routes for the InfluxDB API. #### Limitations - Only returns top level routes--for example, the response contains `"tasks":"/api/v2/tasks"`, and doesn't contain resource-specific routes for tasks (`/api/v2/tasks/TASK_ID/...`). - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_routes_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :return: Routes - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_routes_prepare(**kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Routes', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_routes_async(self, **kwargs): # noqa: E501,D401,D403 - """List all top level routes. - - Retrieves all the top level routes for the InfluxDB API. #### Limitations - Only returns top level routes--for example, the response contains `"tasks":"/api/v2/tasks"`, and doesn't contain resource-specific routes for tasks (`/api/v2/tasks/TASK_ID/...`). - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :return: Routes - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_routes_prepare(**kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Routes', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_routes_prepare(self, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['zap_trace_span'] # noqa: E501 - self._check_operation_params('get_routes', all_params, local_var_params) - - path_params = {} - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params diff --git a/frogpilot/third_party/influxdb_client/service/rules_service.py b/frogpilot/third_party/influxdb_client/service/rules_service.py deleted file mode 100644 index 38a74f4a..00000000 --- a/frogpilot/third_party/influxdb_client/service/rules_service.py +++ /dev/null @@ -1,146 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -from influxdb_client.service._base_service import _BaseService - - -class RulesService(_BaseService): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): # noqa: E501,D401,D403 - """RulesService - a operation defined in OpenAPI.""" - super().__init__(api_client) - - def get_notification_rules_id_query(self, rule_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a notification rule query. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_notification_rules_id_query(rule_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str rule_id: The notification rule ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: FluxResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_notification_rules_id_query_with_http_info(rule_id, **kwargs) # noqa: E501 - else: - (data) = self.get_notification_rules_id_query_with_http_info(rule_id, **kwargs) # noqa: E501 - return data - - def get_notification_rules_id_query_with_http_info(self, rule_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a notification rule query. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_notification_rules_id_query_with_http_info(rule_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str rule_id: The notification rule ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: FluxResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_notification_rules_id_query_prepare(rule_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/notificationRules/{ruleID}/query', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='FluxResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_notification_rules_id_query_async(self, rule_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a notification rule query. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str rule_id: The notification rule ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: FluxResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_notification_rules_id_query_prepare(rule_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/notificationRules/{ruleID}/query', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='FluxResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_notification_rules_id_query_prepare(self, rule_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['rule_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_notification_rules_id_query', all_params, local_var_params) - # verify the required parameter 'rule_id' is set - if ('rule_id' not in local_var_params or - local_var_params['rule_id'] is None): - raise ValueError("Missing the required parameter `rule_id` when calling `get_notification_rules_id_query`") # noqa: E501 - - path_params = {} - if 'rule_id' in local_var_params: - path_params['ruleID'] = local_var_params['rule_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params diff --git a/frogpilot/third_party/influxdb_client/service/scraper_targets_service.py b/frogpilot/third_party/influxdb_client/service/scraper_targets_service.py deleted file mode 100644 index 144a3931..00000000 --- a/frogpilot/third_party/influxdb_client/service/scraper_targets_service.py +++ /dev/null @@ -1,1748 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -from influxdb_client.service._base_service import _BaseService - - -class ScraperTargetsService(_BaseService): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): # noqa: E501,D401,D403 - """ScraperTargetsService - a operation defined in OpenAPI.""" - super().__init__(api_client) - - def delete_scrapers_id(self, scraper_target_id, **kwargs): # noqa: E501,D401,D403 - """Delete a scraper target. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_scrapers_id(scraper_target_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str scraper_target_id: The identifier of the scraper target. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_scrapers_id_with_http_info(scraper_target_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_scrapers_id_with_http_info(scraper_target_id, **kwargs) # noqa: E501 - return data - - def delete_scrapers_id_with_http_info(self, scraper_target_id, **kwargs): # noqa: E501,D401,D403 - """Delete a scraper target. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_scrapers_id_with_http_info(scraper_target_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str scraper_target_id: The identifier of the scraper target. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_scrapers_id_prepare(scraper_target_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/scrapers/{scraperTargetID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def delete_scrapers_id_async(self, scraper_target_id, **kwargs): # noqa: E501,D401,D403 - """Delete a scraper target. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str scraper_target_id: The identifier of the scraper target. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_scrapers_id_prepare(scraper_target_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/scrapers/{scraperTargetID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _delete_scrapers_id_prepare(self, scraper_target_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['scraper_target_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('delete_scrapers_id', all_params, local_var_params) - # verify the required parameter 'scraper_target_id' is set - if ('scraper_target_id' not in local_var_params or - local_var_params['scraper_target_id'] is None): - raise ValueError("Missing the required parameter `scraper_target_id` when calling `delete_scrapers_id`") # noqa: E501 - - path_params = {} - if 'scraper_target_id' in local_var_params: - path_params['scraperTargetID'] = local_var_params['scraper_target_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def delete_scrapers_id_labels_id(self, scraper_target_id, label_id, **kwargs): # noqa: E501,D401,D403 - """Delete a label from a scraper target. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_scrapers_id_labels_id(scraper_target_id, label_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str scraper_target_id: The scraper target ID. (required) - :param str label_id: The label ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_scrapers_id_labels_id_with_http_info(scraper_target_id, label_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_scrapers_id_labels_id_with_http_info(scraper_target_id, label_id, **kwargs) # noqa: E501 - return data - - def delete_scrapers_id_labels_id_with_http_info(self, scraper_target_id, label_id, **kwargs): # noqa: E501,D401,D403 - """Delete a label from a scraper target. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_scrapers_id_labels_id_with_http_info(scraper_target_id, label_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str scraper_target_id: The scraper target ID. (required) - :param str label_id: The label ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_scrapers_id_labels_id_prepare(scraper_target_id, label_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/scrapers/{scraperTargetID}/labels/{labelID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def delete_scrapers_id_labels_id_async(self, scraper_target_id, label_id, **kwargs): # noqa: E501,D401,D403 - """Delete a label from a scraper target. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str scraper_target_id: The scraper target ID. (required) - :param str label_id: The label ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_scrapers_id_labels_id_prepare(scraper_target_id, label_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/scrapers/{scraperTargetID}/labels/{labelID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _delete_scrapers_id_labels_id_prepare(self, scraper_target_id, label_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['scraper_target_id', 'label_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('delete_scrapers_id_labels_id', all_params, local_var_params) - # verify the required parameter 'scraper_target_id' is set - if ('scraper_target_id' not in local_var_params or - local_var_params['scraper_target_id'] is None): - raise ValueError("Missing the required parameter `scraper_target_id` when calling `delete_scrapers_id_labels_id`") # noqa: E501 - # verify the required parameter 'label_id' is set - if ('label_id' not in local_var_params or - local_var_params['label_id'] is None): - raise ValueError("Missing the required parameter `label_id` when calling `delete_scrapers_id_labels_id`") # noqa: E501 - - path_params = {} - if 'scraper_target_id' in local_var_params: - path_params['scraperTargetID'] = local_var_params['scraper_target_id'] # noqa: E501 - if 'label_id' in local_var_params: - path_params['labelID'] = local_var_params['label_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def delete_scrapers_id_members_id(self, user_id, scraper_target_id, **kwargs): # noqa: E501,D401,D403 - """Remove a member from a scraper target. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_scrapers_id_members_id(user_id, scraper_target_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_id: The ID of member to remove. (required) - :param str scraper_target_id: The scraper target ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_scrapers_id_members_id_with_http_info(user_id, scraper_target_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_scrapers_id_members_id_with_http_info(user_id, scraper_target_id, **kwargs) # noqa: E501 - return data - - def delete_scrapers_id_members_id_with_http_info(self, user_id, scraper_target_id, **kwargs): # noqa: E501,D401,D403 - """Remove a member from a scraper target. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_scrapers_id_members_id_with_http_info(user_id, scraper_target_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_id: The ID of member to remove. (required) - :param str scraper_target_id: The scraper target ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_scrapers_id_members_id_prepare(user_id, scraper_target_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/scrapers/{scraperTargetID}/members/{userID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def delete_scrapers_id_members_id_async(self, user_id, scraper_target_id, **kwargs): # noqa: E501,D401,D403 - """Remove a member from a scraper target. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str user_id: The ID of member to remove. (required) - :param str scraper_target_id: The scraper target ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_scrapers_id_members_id_prepare(user_id, scraper_target_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/scrapers/{scraperTargetID}/members/{userID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _delete_scrapers_id_members_id_prepare(self, user_id, scraper_target_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['user_id', 'scraper_target_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('delete_scrapers_id_members_id', all_params, local_var_params) - # verify the required parameter 'user_id' is set - if ('user_id' not in local_var_params or - local_var_params['user_id'] is None): - raise ValueError("Missing the required parameter `user_id` when calling `delete_scrapers_id_members_id`") # noqa: E501 - # verify the required parameter 'scraper_target_id' is set - if ('scraper_target_id' not in local_var_params or - local_var_params['scraper_target_id'] is None): - raise ValueError("Missing the required parameter `scraper_target_id` when calling `delete_scrapers_id_members_id`") # noqa: E501 - - path_params = {} - if 'user_id' in local_var_params: - path_params['userID'] = local_var_params['user_id'] # noqa: E501 - if 'scraper_target_id' in local_var_params: - path_params['scraperTargetID'] = local_var_params['scraper_target_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def delete_scrapers_id_owners_id(self, user_id, scraper_target_id, **kwargs): # noqa: E501,D401,D403 - """Remove an owner from a scraper target. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_scrapers_id_owners_id(user_id, scraper_target_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_id: The ID of owner to remove. (required) - :param str scraper_target_id: The scraper target ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_scrapers_id_owners_id_with_http_info(user_id, scraper_target_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_scrapers_id_owners_id_with_http_info(user_id, scraper_target_id, **kwargs) # noqa: E501 - return data - - def delete_scrapers_id_owners_id_with_http_info(self, user_id, scraper_target_id, **kwargs): # noqa: E501,D401,D403 - """Remove an owner from a scraper target. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_scrapers_id_owners_id_with_http_info(user_id, scraper_target_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_id: The ID of owner to remove. (required) - :param str scraper_target_id: The scraper target ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_scrapers_id_owners_id_prepare(user_id, scraper_target_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/scrapers/{scraperTargetID}/owners/{userID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def delete_scrapers_id_owners_id_async(self, user_id, scraper_target_id, **kwargs): # noqa: E501,D401,D403 - """Remove an owner from a scraper target. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str user_id: The ID of owner to remove. (required) - :param str scraper_target_id: The scraper target ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_scrapers_id_owners_id_prepare(user_id, scraper_target_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/scrapers/{scraperTargetID}/owners/{userID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _delete_scrapers_id_owners_id_prepare(self, user_id, scraper_target_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['user_id', 'scraper_target_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('delete_scrapers_id_owners_id', all_params, local_var_params) - # verify the required parameter 'user_id' is set - if ('user_id' not in local_var_params or - local_var_params['user_id'] is None): - raise ValueError("Missing the required parameter `user_id` when calling `delete_scrapers_id_owners_id`") # noqa: E501 - # verify the required parameter 'scraper_target_id' is set - if ('scraper_target_id' not in local_var_params or - local_var_params['scraper_target_id'] is None): - raise ValueError("Missing the required parameter `scraper_target_id` when calling `delete_scrapers_id_owners_id`") # noqa: E501 - - path_params = {} - if 'user_id' in local_var_params: - path_params['userID'] = local_var_params['user_id'] # noqa: E501 - if 'scraper_target_id' in local_var_params: - path_params['scraperTargetID'] = local_var_params['scraper_target_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_scrapers(self, **kwargs): # noqa: E501,D401,D403 - """List all scraper targets. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_scrapers(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param str name: Specifies the name of the scraper target. - :param list[str] id: List of scraper target IDs to return. If both `id` and `owner` are specified, only `id` is used. - :param str org_id: Specifies the organization ID of the scraper target. - :param str org: Specifies the organization name of the scraper target. - :return: ScraperTargetResponses - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_scrapers_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_scrapers_with_http_info(**kwargs) # noqa: E501 - return data - - def get_scrapers_with_http_info(self, **kwargs): # noqa: E501,D401,D403 - """List all scraper targets. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_scrapers_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param str name: Specifies the name of the scraper target. - :param list[str] id: List of scraper target IDs to return. If both `id` and `owner` are specified, only `id` is used. - :param str org_id: Specifies the organization ID of the scraper target. - :param str org: Specifies the organization name of the scraper target. - :return: ScraperTargetResponses - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_scrapers_prepare(**kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/scrapers', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ScraperTargetResponses', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_scrapers_async(self, **kwargs): # noqa: E501,D401,D403 - """List all scraper targets. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param str name: Specifies the name of the scraper target. - :param list[str] id: List of scraper target IDs to return. If both `id` and `owner` are specified, only `id` is used. - :param str org_id: Specifies the organization ID of the scraper target. - :param str org: Specifies the organization name of the scraper target. - :return: ScraperTargetResponses - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_scrapers_prepare(**kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/scrapers', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ScraperTargetResponses', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_scrapers_prepare(self, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['zap_trace_span', 'name', 'id', 'org_id', 'org'] # noqa: E501 - self._check_operation_params('get_scrapers', all_params, local_var_params) - - path_params = {} - - query_params = [] - if 'name' in local_var_params: - query_params.append(('name', local_var_params['name'])) # noqa: E501 - if 'id' in local_var_params: - query_params.append(('id', local_var_params['id'])) # noqa: E501 - if 'org_id' in local_var_params: - query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501 - if 'org' in local_var_params: - query_params.append(('org', local_var_params['org'])) # noqa: E501 - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_scrapers_id(self, scraper_target_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a scraper target. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_scrapers_id(scraper_target_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str scraper_target_id: The identifier of the scraper target. (required) - :param str zap_trace_span: OpenTracing span context - :return: ScraperTargetResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_scrapers_id_with_http_info(scraper_target_id, **kwargs) # noqa: E501 - else: - (data) = self.get_scrapers_id_with_http_info(scraper_target_id, **kwargs) # noqa: E501 - return data - - def get_scrapers_id_with_http_info(self, scraper_target_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a scraper target. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_scrapers_id_with_http_info(scraper_target_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str scraper_target_id: The identifier of the scraper target. (required) - :param str zap_trace_span: OpenTracing span context - :return: ScraperTargetResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_scrapers_id_prepare(scraper_target_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/scrapers/{scraperTargetID}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ScraperTargetResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_scrapers_id_async(self, scraper_target_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a scraper target. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str scraper_target_id: The identifier of the scraper target. (required) - :param str zap_trace_span: OpenTracing span context - :return: ScraperTargetResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_scrapers_id_prepare(scraper_target_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/scrapers/{scraperTargetID}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ScraperTargetResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_scrapers_id_prepare(self, scraper_target_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['scraper_target_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_scrapers_id', all_params, local_var_params) - # verify the required parameter 'scraper_target_id' is set - if ('scraper_target_id' not in local_var_params or - local_var_params['scraper_target_id'] is None): - raise ValueError("Missing the required parameter `scraper_target_id` when calling `get_scrapers_id`") # noqa: E501 - - path_params = {} - if 'scraper_target_id' in local_var_params: - path_params['scraperTargetID'] = local_var_params['scraper_target_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_scrapers_id_labels(self, scraper_target_id, **kwargs): # noqa: E501,D401,D403 - """List all labels for a scraper target. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_scrapers_id_labels(scraper_target_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str scraper_target_id: The scraper target ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelsResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_scrapers_id_labels_with_http_info(scraper_target_id, **kwargs) # noqa: E501 - else: - (data) = self.get_scrapers_id_labels_with_http_info(scraper_target_id, **kwargs) # noqa: E501 - return data - - def get_scrapers_id_labels_with_http_info(self, scraper_target_id, **kwargs): # noqa: E501,D401,D403 - """List all labels for a scraper target. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_scrapers_id_labels_with_http_info(scraper_target_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str scraper_target_id: The scraper target ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelsResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_scrapers_id_labels_prepare(scraper_target_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/scrapers/{scraperTargetID}/labels', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='LabelsResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_scrapers_id_labels_async(self, scraper_target_id, **kwargs): # noqa: E501,D401,D403 - """List all labels for a scraper target. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str scraper_target_id: The scraper target ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelsResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_scrapers_id_labels_prepare(scraper_target_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/scrapers/{scraperTargetID}/labels', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='LabelsResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_scrapers_id_labels_prepare(self, scraper_target_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['scraper_target_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_scrapers_id_labels', all_params, local_var_params) - # verify the required parameter 'scraper_target_id' is set - if ('scraper_target_id' not in local_var_params or - local_var_params['scraper_target_id'] is None): - raise ValueError("Missing the required parameter `scraper_target_id` when calling `get_scrapers_id_labels`") # noqa: E501 - - path_params = {} - if 'scraper_target_id' in local_var_params: - path_params['scraperTargetID'] = local_var_params['scraper_target_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_scrapers_id_members(self, scraper_target_id, **kwargs): # noqa: E501,D401,D403 - """List all users with member privileges for a scraper target. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_scrapers_id_members(scraper_target_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str scraper_target_id: The scraper target ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceMembers - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_scrapers_id_members_with_http_info(scraper_target_id, **kwargs) # noqa: E501 - else: - (data) = self.get_scrapers_id_members_with_http_info(scraper_target_id, **kwargs) # noqa: E501 - return data - - def get_scrapers_id_members_with_http_info(self, scraper_target_id, **kwargs): # noqa: E501,D401,D403 - """List all users with member privileges for a scraper target. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_scrapers_id_members_with_http_info(scraper_target_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str scraper_target_id: The scraper target ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceMembers - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_scrapers_id_members_prepare(scraper_target_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/scrapers/{scraperTargetID}/members', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceMembers', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_scrapers_id_members_async(self, scraper_target_id, **kwargs): # noqa: E501,D401,D403 - """List all users with member privileges for a scraper target. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str scraper_target_id: The scraper target ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceMembers - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_scrapers_id_members_prepare(scraper_target_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/scrapers/{scraperTargetID}/members', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceMembers', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_scrapers_id_members_prepare(self, scraper_target_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['scraper_target_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_scrapers_id_members', all_params, local_var_params) - # verify the required parameter 'scraper_target_id' is set - if ('scraper_target_id' not in local_var_params or - local_var_params['scraper_target_id'] is None): - raise ValueError("Missing the required parameter `scraper_target_id` when calling `get_scrapers_id_members`") # noqa: E501 - - path_params = {} - if 'scraper_target_id' in local_var_params: - path_params['scraperTargetID'] = local_var_params['scraper_target_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_scrapers_id_owners(self, scraper_target_id, **kwargs): # noqa: E501,D401,D403 - """List all owners of a scraper target. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_scrapers_id_owners(scraper_target_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str scraper_target_id: The scraper target ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceOwners - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_scrapers_id_owners_with_http_info(scraper_target_id, **kwargs) # noqa: E501 - else: - (data) = self.get_scrapers_id_owners_with_http_info(scraper_target_id, **kwargs) # noqa: E501 - return data - - def get_scrapers_id_owners_with_http_info(self, scraper_target_id, **kwargs): # noqa: E501,D401,D403 - """List all owners of a scraper target. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_scrapers_id_owners_with_http_info(scraper_target_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str scraper_target_id: The scraper target ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceOwners - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_scrapers_id_owners_prepare(scraper_target_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/scrapers/{scraperTargetID}/owners', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceOwners', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_scrapers_id_owners_async(self, scraper_target_id, **kwargs): # noqa: E501,D401,D403 - """List all owners of a scraper target. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str scraper_target_id: The scraper target ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceOwners - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_scrapers_id_owners_prepare(scraper_target_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/scrapers/{scraperTargetID}/owners', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceOwners', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_scrapers_id_owners_prepare(self, scraper_target_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['scraper_target_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_scrapers_id_owners', all_params, local_var_params) - # verify the required parameter 'scraper_target_id' is set - if ('scraper_target_id' not in local_var_params or - local_var_params['scraper_target_id'] is None): - raise ValueError("Missing the required parameter `scraper_target_id` when calling `get_scrapers_id_owners`") # noqa: E501 - - path_params = {} - if 'scraper_target_id' in local_var_params: - path_params['scraperTargetID'] = local_var_params['scraper_target_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def patch_scrapers_id(self, scraper_target_id, scraper_target_request, **kwargs): # noqa: E501,D401,D403 - """Update a scraper target. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_scrapers_id(scraper_target_id, scraper_target_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str scraper_target_id: The identifier of the scraper target. (required) - :param ScraperTargetRequest scraper_target_request: Scraper target update to apply (required) - :param str zap_trace_span: OpenTracing span context - :return: ScraperTargetResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.patch_scrapers_id_with_http_info(scraper_target_id, scraper_target_request, **kwargs) # noqa: E501 - else: - (data) = self.patch_scrapers_id_with_http_info(scraper_target_id, scraper_target_request, **kwargs) # noqa: E501 - return data - - def patch_scrapers_id_with_http_info(self, scraper_target_id, scraper_target_request, **kwargs): # noqa: E501,D401,D403 - """Update a scraper target. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_scrapers_id_with_http_info(scraper_target_id, scraper_target_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str scraper_target_id: The identifier of the scraper target. (required) - :param ScraperTargetRequest scraper_target_request: Scraper target update to apply (required) - :param str zap_trace_span: OpenTracing span context - :return: ScraperTargetResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_scrapers_id_prepare(scraper_target_id, scraper_target_request, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/scrapers/{scraperTargetID}', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ScraperTargetResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def patch_scrapers_id_async(self, scraper_target_id, scraper_target_request, **kwargs): # noqa: E501,D401,D403 - """Update a scraper target. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str scraper_target_id: The identifier of the scraper target. (required) - :param ScraperTargetRequest scraper_target_request: Scraper target update to apply (required) - :param str zap_trace_span: OpenTracing span context - :return: ScraperTargetResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_scrapers_id_prepare(scraper_target_id, scraper_target_request, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/scrapers/{scraperTargetID}', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ScraperTargetResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _patch_scrapers_id_prepare(self, scraper_target_id, scraper_target_request, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['scraper_target_id', 'scraper_target_request', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('patch_scrapers_id', all_params, local_var_params) - # verify the required parameter 'scraper_target_id' is set - if ('scraper_target_id' not in local_var_params or - local_var_params['scraper_target_id'] is None): - raise ValueError("Missing the required parameter `scraper_target_id` when calling `patch_scrapers_id`") # noqa: E501 - # verify the required parameter 'scraper_target_request' is set - if ('scraper_target_request' not in local_var_params or - local_var_params['scraper_target_request'] is None): - raise ValueError("Missing the required parameter `scraper_target_request` when calling `patch_scrapers_id`") # noqa: E501 - - path_params = {} - if 'scraper_target_id' in local_var_params: - path_params['scraperTargetID'] = local_var_params['scraper_target_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'scraper_target_request' in local_var_params: - body_params = local_var_params['scraper_target_request'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_scrapers(self, scraper_target_request, **kwargs): # noqa: E501,D401,D403 - """Create a scraper target. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_scrapers(scraper_target_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param ScraperTargetRequest scraper_target_request: Scraper target to create (required) - :param str zap_trace_span: OpenTracing span context - :return: ScraperTargetResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_scrapers_with_http_info(scraper_target_request, **kwargs) # noqa: E501 - else: - (data) = self.post_scrapers_with_http_info(scraper_target_request, **kwargs) # noqa: E501 - return data - - def post_scrapers_with_http_info(self, scraper_target_request, **kwargs): # noqa: E501,D401,D403 - """Create a scraper target. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_scrapers_with_http_info(scraper_target_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param ScraperTargetRequest scraper_target_request: Scraper target to create (required) - :param str zap_trace_span: OpenTracing span context - :return: ScraperTargetResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_scrapers_prepare(scraper_target_request, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/scrapers', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ScraperTargetResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_scrapers_async(self, scraper_target_request, **kwargs): # noqa: E501,D401,D403 - """Create a scraper target. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param ScraperTargetRequest scraper_target_request: Scraper target to create (required) - :param str zap_trace_span: OpenTracing span context - :return: ScraperTargetResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_scrapers_prepare(scraper_target_request, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/scrapers', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ScraperTargetResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_scrapers_prepare(self, scraper_target_request, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['scraper_target_request', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('post_scrapers', all_params, local_var_params) - # verify the required parameter 'scraper_target_request' is set - if ('scraper_target_request' not in local_var_params or - local_var_params['scraper_target_request'] is None): - raise ValueError("Missing the required parameter `scraper_target_request` when calling `post_scrapers`") # noqa: E501 - - path_params = {} - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'scraper_target_request' in local_var_params: - body_params = local_var_params['scraper_target_request'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_scrapers_id_labels(self, scraper_target_id, label_mapping, **kwargs): # noqa: E501,D401,D403 - """Add a label to a scraper target. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_scrapers_id_labels(scraper_target_id, label_mapping, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str scraper_target_id: The scraper target ID. (required) - :param LabelMapping label_mapping: Label to add (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_scrapers_id_labels_with_http_info(scraper_target_id, label_mapping, **kwargs) # noqa: E501 - else: - (data) = self.post_scrapers_id_labels_with_http_info(scraper_target_id, label_mapping, **kwargs) # noqa: E501 - return data - - def post_scrapers_id_labels_with_http_info(self, scraper_target_id, label_mapping, **kwargs): # noqa: E501,D401,D403 - """Add a label to a scraper target. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_scrapers_id_labels_with_http_info(scraper_target_id, label_mapping, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str scraper_target_id: The scraper target ID. (required) - :param LabelMapping label_mapping: Label to add (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_scrapers_id_labels_prepare(scraper_target_id, label_mapping, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/scrapers/{scraperTargetID}/labels', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='LabelResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_scrapers_id_labels_async(self, scraper_target_id, label_mapping, **kwargs): # noqa: E501,D401,D403 - """Add a label to a scraper target. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str scraper_target_id: The scraper target ID. (required) - :param LabelMapping label_mapping: Label to add (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_scrapers_id_labels_prepare(scraper_target_id, label_mapping, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/scrapers/{scraperTargetID}/labels', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='LabelResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_scrapers_id_labels_prepare(self, scraper_target_id, label_mapping, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['scraper_target_id', 'label_mapping', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('post_scrapers_id_labels', all_params, local_var_params) - # verify the required parameter 'scraper_target_id' is set - if ('scraper_target_id' not in local_var_params or - local_var_params['scraper_target_id'] is None): - raise ValueError("Missing the required parameter `scraper_target_id` when calling `post_scrapers_id_labels`") # noqa: E501 - # verify the required parameter 'label_mapping' is set - if ('label_mapping' not in local_var_params or - local_var_params['label_mapping'] is None): - raise ValueError("Missing the required parameter `label_mapping` when calling `post_scrapers_id_labels`") # noqa: E501 - - path_params = {} - if 'scraper_target_id' in local_var_params: - path_params['scraperTargetID'] = local_var_params['scraper_target_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'label_mapping' in local_var_params: - body_params = local_var_params['label_mapping'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_scrapers_id_members(self, scraper_target_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - """Add a member to a scraper target. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_scrapers_id_members(scraper_target_id, add_resource_member_request_body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str scraper_target_id: The scraper target ID. (required) - :param AddResourceMemberRequestBody add_resource_member_request_body: User to add as member (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceMember - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_scrapers_id_members_with_http_info(scraper_target_id, add_resource_member_request_body, **kwargs) # noqa: E501 - else: - (data) = self.post_scrapers_id_members_with_http_info(scraper_target_id, add_resource_member_request_body, **kwargs) # noqa: E501 - return data - - def post_scrapers_id_members_with_http_info(self, scraper_target_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - """Add a member to a scraper target. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_scrapers_id_members_with_http_info(scraper_target_id, add_resource_member_request_body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str scraper_target_id: The scraper target ID. (required) - :param AddResourceMemberRequestBody add_resource_member_request_body: User to add as member (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceMember - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_scrapers_id_members_prepare(scraper_target_id, add_resource_member_request_body, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/scrapers/{scraperTargetID}/members', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceMember', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_scrapers_id_members_async(self, scraper_target_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - """Add a member to a scraper target. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str scraper_target_id: The scraper target ID. (required) - :param AddResourceMemberRequestBody add_resource_member_request_body: User to add as member (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceMember - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_scrapers_id_members_prepare(scraper_target_id, add_resource_member_request_body, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/scrapers/{scraperTargetID}/members', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceMember', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_scrapers_id_members_prepare(self, scraper_target_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['scraper_target_id', 'add_resource_member_request_body', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('post_scrapers_id_members', all_params, local_var_params) - # verify the required parameter 'scraper_target_id' is set - if ('scraper_target_id' not in local_var_params or - local_var_params['scraper_target_id'] is None): - raise ValueError("Missing the required parameter `scraper_target_id` when calling `post_scrapers_id_members`") # noqa: E501 - # verify the required parameter 'add_resource_member_request_body' is set - if ('add_resource_member_request_body' not in local_var_params or - local_var_params['add_resource_member_request_body'] is None): - raise ValueError("Missing the required parameter `add_resource_member_request_body` when calling `post_scrapers_id_members`") # noqa: E501 - - path_params = {} - if 'scraper_target_id' in local_var_params: - path_params['scraperTargetID'] = local_var_params['scraper_target_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'add_resource_member_request_body' in local_var_params: - body_params = local_var_params['add_resource_member_request_body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_scrapers_id_owners(self, scraper_target_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - """Add an owner to a scraper target. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_scrapers_id_owners(scraper_target_id, add_resource_member_request_body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str scraper_target_id: The scraper target ID. (required) - :param AddResourceMemberRequestBody add_resource_member_request_body: User to add as owner (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceOwner - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_scrapers_id_owners_with_http_info(scraper_target_id, add_resource_member_request_body, **kwargs) # noqa: E501 - else: - (data) = self.post_scrapers_id_owners_with_http_info(scraper_target_id, add_resource_member_request_body, **kwargs) # noqa: E501 - return data - - def post_scrapers_id_owners_with_http_info(self, scraper_target_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - """Add an owner to a scraper target. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_scrapers_id_owners_with_http_info(scraper_target_id, add_resource_member_request_body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str scraper_target_id: The scraper target ID. (required) - :param AddResourceMemberRequestBody add_resource_member_request_body: User to add as owner (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceOwner - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_scrapers_id_owners_prepare(scraper_target_id, add_resource_member_request_body, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/scrapers/{scraperTargetID}/owners', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceOwner', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_scrapers_id_owners_async(self, scraper_target_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - """Add an owner to a scraper target. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str scraper_target_id: The scraper target ID. (required) - :param AddResourceMemberRequestBody add_resource_member_request_body: User to add as owner (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceOwner - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_scrapers_id_owners_prepare(scraper_target_id, add_resource_member_request_body, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/scrapers/{scraperTargetID}/owners', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceOwner', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_scrapers_id_owners_prepare(self, scraper_target_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['scraper_target_id', 'add_resource_member_request_body', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('post_scrapers_id_owners', all_params, local_var_params) - # verify the required parameter 'scraper_target_id' is set - if ('scraper_target_id' not in local_var_params or - local_var_params['scraper_target_id'] is None): - raise ValueError("Missing the required parameter `scraper_target_id` when calling `post_scrapers_id_owners`") # noqa: E501 - # verify the required parameter 'add_resource_member_request_body' is set - if ('add_resource_member_request_body' not in local_var_params or - local_var_params['add_resource_member_request_body'] is None): - raise ValueError("Missing the required parameter `add_resource_member_request_body` when calling `post_scrapers_id_owners`") # noqa: E501 - - path_params = {} - if 'scraper_target_id' in local_var_params: - path_params['scraperTargetID'] = local_var_params['scraper_target_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'add_resource_member_request_body' in local_var_params: - body_params = local_var_params['add_resource_member_request_body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params diff --git a/frogpilot/third_party/influxdb_client/service/secrets_service.py b/frogpilot/third_party/influxdb_client/service/secrets_service.py deleted file mode 100644 index 495ac952..00000000 --- a/frogpilot/third_party/influxdb_client/service/secrets_service.py +++ /dev/null @@ -1,529 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -from influxdb_client.service._base_service import _BaseService - - -class SecretsService(_BaseService): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): # noqa: E501,D401,D403 - """SecretsService - a operation defined in OpenAPI.""" - super().__init__(api_client) - - def delete_orgs_id_secrets_id(self, org_id, secret_id, **kwargs): # noqa: E501,D401,D403 - """Delete a secret from an organization. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_orgs_id_secrets_id(org_id, secret_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str org_id: The organization ID. (required) - :param str secret_id: The secret ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_orgs_id_secrets_id_with_http_info(org_id, secret_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_orgs_id_secrets_id_with_http_info(org_id, secret_id, **kwargs) # noqa: E501 - return data - - def delete_orgs_id_secrets_id_with_http_info(self, org_id, secret_id, **kwargs): # noqa: E501,D401,D403 - """Delete a secret from an organization. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_orgs_id_secrets_id_with_http_info(org_id, secret_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str org_id: The organization ID. (required) - :param str secret_id: The secret ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_orgs_id_secrets_id_prepare(org_id, secret_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/orgs/{orgID}/secrets/{secretID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def delete_orgs_id_secrets_id_async(self, org_id, secret_id, **kwargs): # noqa: E501,D401,D403 - """Delete a secret from an organization. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str org_id: The organization ID. (required) - :param str secret_id: The secret ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_orgs_id_secrets_id_prepare(org_id, secret_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/orgs/{orgID}/secrets/{secretID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _delete_orgs_id_secrets_id_prepare(self, org_id, secret_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['org_id', 'secret_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('delete_orgs_id_secrets_id', all_params, local_var_params) - # verify the required parameter 'org_id' is set - if ('org_id' not in local_var_params or - local_var_params['org_id'] is None): - raise ValueError("Missing the required parameter `org_id` when calling `delete_orgs_id_secrets_id`") # noqa: E501 - # verify the required parameter 'secret_id' is set - if ('secret_id' not in local_var_params or - local_var_params['secret_id'] is None): - raise ValueError("Missing the required parameter `secret_id` when calling `delete_orgs_id_secrets_id`") # noqa: E501 - - path_params = {} - if 'org_id' in local_var_params: - path_params['orgID'] = local_var_params['org_id'] # noqa: E501 - if 'secret_id' in local_var_params: - path_params['secretID'] = local_var_params['secret_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_orgs_id_secrets(self, org_id, **kwargs): # noqa: E501,D401,D403 - """List all secret keys for an organization. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_orgs_id_secrets(org_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str org_id: The organization ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: SecretKeysResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_orgs_id_secrets_with_http_info(org_id, **kwargs) # noqa: E501 - else: - (data) = self.get_orgs_id_secrets_with_http_info(org_id, **kwargs) # noqa: E501 - return data - - def get_orgs_id_secrets_with_http_info(self, org_id, **kwargs): # noqa: E501,D401,D403 - """List all secret keys for an organization. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_orgs_id_secrets_with_http_info(org_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str org_id: The organization ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: SecretKeysResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_orgs_id_secrets_prepare(org_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/orgs/{orgID}/secrets', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='SecretKeysResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_orgs_id_secrets_async(self, org_id, **kwargs): # noqa: E501,D401,D403 - """List all secret keys for an organization. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str org_id: The organization ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: SecretKeysResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_orgs_id_secrets_prepare(org_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/orgs/{orgID}/secrets', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='SecretKeysResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_orgs_id_secrets_prepare(self, org_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['org_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_orgs_id_secrets', all_params, local_var_params) - # verify the required parameter 'org_id' is set - if ('org_id' not in local_var_params or - local_var_params['org_id'] is None): - raise ValueError("Missing the required parameter `org_id` when calling `get_orgs_id_secrets`") # noqa: E501 - - path_params = {} - if 'org_id' in local_var_params: - path_params['orgID'] = local_var_params['org_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def patch_orgs_id_secrets(self, org_id, request_body, **kwargs): # noqa: E501,D401,D403 - """Update secrets in an organization. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_orgs_id_secrets(org_id, request_body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str org_id: The organization ID. (required) - :param dict(str, str) request_body: Secret key value pairs to update/add (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.patch_orgs_id_secrets_with_http_info(org_id, request_body, **kwargs) # noqa: E501 - else: - (data) = self.patch_orgs_id_secrets_with_http_info(org_id, request_body, **kwargs) # noqa: E501 - return data - - def patch_orgs_id_secrets_with_http_info(self, org_id, request_body, **kwargs): # noqa: E501,D401,D403 - """Update secrets in an organization. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_orgs_id_secrets_with_http_info(org_id, request_body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str org_id: The organization ID. (required) - :param dict(str, str) request_body: Secret key value pairs to update/add (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_orgs_id_secrets_prepare(org_id, request_body, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/orgs/{orgID}/secrets', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def patch_orgs_id_secrets_async(self, org_id, request_body, **kwargs): # noqa: E501,D401,D403 - """Update secrets in an organization. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str org_id: The organization ID. (required) - :param dict(str, str) request_body: Secret key value pairs to update/add (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_orgs_id_secrets_prepare(org_id, request_body, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/orgs/{orgID}/secrets', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _patch_orgs_id_secrets_prepare(self, org_id, request_body, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['org_id', 'request_body', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('patch_orgs_id_secrets', all_params, local_var_params) - # verify the required parameter 'org_id' is set - if ('org_id' not in local_var_params or - local_var_params['org_id'] is None): - raise ValueError("Missing the required parameter `org_id` when calling `patch_orgs_id_secrets`") # noqa: E501 - # verify the required parameter 'request_body' is set - if ('request_body' not in local_var_params or - local_var_params['request_body'] is None): - raise ValueError("Missing the required parameter `request_body` when calling `patch_orgs_id_secrets`") # noqa: E501 - - path_params = {} - if 'org_id' in local_var_params: - path_params['orgID'] = local_var_params['org_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'request_body' in local_var_params: - body_params = local_var_params['request_body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_orgs_id_secrets(self, org_id, secret_keys, **kwargs): # noqa: E501,D401,D403 - """Delete secrets from an organization. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_orgs_id_secrets(org_id, secret_keys, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str org_id: The organization ID. (required) - :param SecretKeys secret_keys: Secret key to delete (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_orgs_id_secrets_with_http_info(org_id, secret_keys, **kwargs) # noqa: E501 - else: - (data) = self.post_orgs_id_secrets_with_http_info(org_id, secret_keys, **kwargs) # noqa: E501 - return data - - def post_orgs_id_secrets_with_http_info(self, org_id, secret_keys, **kwargs): # noqa: E501,D401,D403 - """Delete secrets from an organization. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_orgs_id_secrets_with_http_info(org_id, secret_keys, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str org_id: The organization ID. (required) - :param SecretKeys secret_keys: Secret key to delete (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_orgs_id_secrets_prepare(org_id, secret_keys, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/orgs/{orgID}/secrets/delete', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_orgs_id_secrets_async(self, org_id, secret_keys, **kwargs): # noqa: E501,D401,D403 - """Delete secrets from an organization. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str org_id: The organization ID. (required) - :param SecretKeys secret_keys: Secret key to delete (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_orgs_id_secrets_prepare(org_id, secret_keys, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/orgs/{orgID}/secrets/delete', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_orgs_id_secrets_prepare(self, org_id, secret_keys, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['org_id', 'secret_keys', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('post_orgs_id_secrets', all_params, local_var_params) - # verify the required parameter 'org_id' is set - if ('org_id' not in local_var_params or - local_var_params['org_id'] is None): - raise ValueError("Missing the required parameter `org_id` when calling `post_orgs_id_secrets`") # noqa: E501 - # verify the required parameter 'secret_keys' is set - if ('secret_keys' not in local_var_params or - local_var_params['secret_keys'] is None): - raise ValueError("Missing the required parameter `secret_keys` when calling `post_orgs_id_secrets`") # noqa: E501 - - path_params = {} - if 'org_id' in local_var_params: - path_params['orgID'] = local_var_params['org_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'secret_keys' in local_var_params: - body_params = local_var_params['secret_keys'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params diff --git a/frogpilot/third_party/influxdb_client/service/setup_service.py b/frogpilot/third_party/influxdb_client/service/setup_service.py deleted file mode 100644 index ed12bde0..00000000 --- a/frogpilot/third_party/influxdb_client/service/setup_service.py +++ /dev/null @@ -1,263 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -from influxdb_client.service._base_service import _BaseService - - -class SetupService(_BaseService): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): # noqa: E501,D401,D403 - """SetupService - a operation defined in OpenAPI.""" - super().__init__(api_client) - - def get_setup(self, **kwargs): # noqa: E501,D401,D403 - """Check if database has default user, org, bucket. - - Returns `true` if no default user, organization, or bucket has been created. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_setup(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :return: IsOnboarding - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_setup_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_setup_with_http_info(**kwargs) # noqa: E501 - return data - - def get_setup_with_http_info(self, **kwargs): # noqa: E501,D401,D403 - """Check if database has default user, org, bucket. - - Returns `true` if no default user, organization, or bucket has been created. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_setup_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :return: IsOnboarding - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_setup_prepare(**kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/setup', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='IsOnboarding', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_setup_async(self, **kwargs): # noqa: E501,D401,D403 - """Check if database has default user, org, bucket. - - Returns `true` if no default user, organization, or bucket has been created. - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :return: IsOnboarding - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_setup_prepare(**kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/setup', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='IsOnboarding', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_setup_prepare(self, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['zap_trace_span'] # noqa: E501 - self._check_operation_params('get_setup', all_params, local_var_params) - - path_params = {} - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_setup(self, onboarding_request, **kwargs): # noqa: E501,D401,D403 - """Set up initial user, org and bucket. - - Post an onboarding request to set up initial user, org and bucket. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_setup(onboarding_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param OnboardingRequest onboarding_request: Source to create (required) - :param str zap_trace_span: OpenTracing span context - :return: OnboardingResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_setup_with_http_info(onboarding_request, **kwargs) # noqa: E501 - else: - (data) = self.post_setup_with_http_info(onboarding_request, **kwargs) # noqa: E501 - return data - - def post_setup_with_http_info(self, onboarding_request, **kwargs): # noqa: E501,D401,D403 - """Set up initial user, org and bucket. - - Post an onboarding request to set up initial user, org and bucket. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_setup_with_http_info(onboarding_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param OnboardingRequest onboarding_request: Source to create (required) - :param str zap_trace_span: OpenTracing span context - :return: OnboardingResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_setup_prepare(onboarding_request, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/setup', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='OnboardingResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_setup_async(self, onboarding_request, **kwargs): # noqa: E501,D401,D403 - """Set up initial user, org and bucket. - - Post an onboarding request to set up initial user, org and bucket. - This method makes an asynchronous HTTP request. - - :param async_req bool - :param OnboardingRequest onboarding_request: Source to create (required) - :param str zap_trace_span: OpenTracing span context - :return: OnboardingResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_setup_prepare(onboarding_request, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/setup', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='OnboardingResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_setup_prepare(self, onboarding_request, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['onboarding_request', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('post_setup', all_params, local_var_params) - # verify the required parameter 'onboarding_request' is set - if ('onboarding_request' not in local_var_params or - local_var_params['onboarding_request'] is None): - raise ValueError("Missing the required parameter `onboarding_request` when calling `post_setup`") # noqa: E501 - - path_params = {} - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'onboarding_request' in local_var_params: - body_params = local_var_params['onboarding_request'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params diff --git a/frogpilot/third_party/influxdb_client/service/signin_service.py b/frogpilot/third_party/influxdb_client/service/signin_service.py deleted file mode 100644 index f3ca698a..00000000 --- a/frogpilot/third_party/influxdb_client/service/signin_service.py +++ /dev/null @@ -1,145 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -from influxdb_client.service._base_service import _BaseService - - -class SigninService(_BaseService): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): # noqa: E501,D401,D403 - """SigninService - a operation defined in OpenAPI.""" - super().__init__(api_client) - - def post_signin(self, **kwargs): # noqa: E501,D401,D403 - """Create a user session.. - - Authenticates [Basic authentication credentials](#section/Authentication/BasicAuthentication) for a [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user), and then, if successful, generates a user session. To authenticate a user, pass the HTTP `Authorization` header with the `Basic` scheme and the base64-encoded username and password. For syntax and more information, see [Basic Authentication](#section/Authentication/BasicAuthentication) for syntax and more information. If authentication is successful, InfluxDB creates a new session for the user and then returns the session cookie in the `Set-Cookie` response header. InfluxDB stores user sessions in memory only. They expire within ten minutes and during restarts of the InfluxDB instance. #### User sessions with authorizations - In InfluxDB Cloud, a user session inherits all the user's permissions for the organization. - In InfluxDB OSS, a user session inherits all the user's permissions for all the organizations that the user belongs to. #### Related endpoints - [Signout](#tag/Signout) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_signin(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param str authorization: An auth credential for the Basic scheme - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_signin_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.post_signin_with_http_info(**kwargs) # noqa: E501 - return data - - def post_signin_with_http_info(self, **kwargs): # noqa: E501,D401,D403 - """Create a user session.. - - Authenticates [Basic authentication credentials](#section/Authentication/BasicAuthentication) for a [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user), and then, if successful, generates a user session. To authenticate a user, pass the HTTP `Authorization` header with the `Basic` scheme and the base64-encoded username and password. For syntax and more information, see [Basic Authentication](#section/Authentication/BasicAuthentication) for syntax and more information. If authentication is successful, InfluxDB creates a new session for the user and then returns the session cookie in the `Set-Cookie` response header. InfluxDB stores user sessions in memory only. They expire within ten minutes and during restarts of the InfluxDB instance. #### User sessions with authorizations - In InfluxDB Cloud, a user session inherits all the user's permissions for the organization. - In InfluxDB OSS, a user session inherits all the user's permissions for all the organizations that the user belongs to. #### Related endpoints - [Signout](#tag/Signout) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_signin_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param str authorization: An auth credential for the Basic scheme - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_signin_prepare(**kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/signin', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=['BasicAuthentication'], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_signin_async(self, **kwargs): # noqa: E501,D401,D403 - """Create a user session.. - - Authenticates [Basic authentication credentials](#section/Authentication/BasicAuthentication) for a [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user), and then, if successful, generates a user session. To authenticate a user, pass the HTTP `Authorization` header with the `Basic` scheme and the base64-encoded username and password. For syntax and more information, see [Basic Authentication](#section/Authentication/BasicAuthentication) for syntax and more information. If authentication is successful, InfluxDB creates a new session for the user and then returns the session cookie in the `Set-Cookie` response header. InfluxDB stores user sessions in memory only. They expire within ten minutes and during restarts of the InfluxDB instance. #### User sessions with authorizations - In InfluxDB Cloud, a user session inherits all the user's permissions for the organization. - In InfluxDB OSS, a user session inherits all the user's permissions for all the organizations that the user belongs to. #### Related endpoints - [Signout](#tag/Signout) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param str authorization: An auth credential for the Basic scheme - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_signin_prepare(**kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/signin', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=['BasicAuthentication'], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_signin_prepare(self, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['zap_trace_span', 'authorization'] # noqa: E501 - self._check_operation_params('post_signin', all_params, local_var_params) - - path_params = {} - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - if 'authorization' in local_var_params: - header_params['Authorization'] = local_var_params['authorization'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params diff --git a/frogpilot/third_party/influxdb_client/service/signout_service.py b/frogpilot/third_party/influxdb_client/service/signout_service.py deleted file mode 100644 index 882e7873..00000000 --- a/frogpilot/third_party/influxdb_client/service/signout_service.py +++ /dev/null @@ -1,140 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -from influxdb_client.service._base_service import _BaseService - - -class SignoutService(_BaseService): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): # noqa: E501,D401,D403 - """SignoutService - a operation defined in OpenAPI.""" - super().__init__(api_client) - - def post_signout(self, **kwargs): # noqa: E501,D401,D403 - """Expire a user session. - - Expires a user session specified by a session cookie. Use this endpoint to expire a user session that was generated when the user authenticated with the InfluxDB Developer Console (UI) or the `POST /api/v2/signin` endpoint. For example, the `POST /api/v2/signout` endpoint represents the third step in the following three-step process to authenticate a user, retrieve the `user` resource, and then expire the session: 1. Send a request with the user's [Basic authentication credentials](#section/Authentication/BasicAuthentication) to the `POST /api/v2/signin` endpoint to create a user session and generate a session cookie. 2. Send a request to the `GET /api/v2/me` endpoint, passing the stored session cookie from step 1 to retrieve user information. 3. Send a request to the `POST /api/v2/signout` endpoint, passing the stored session cookie to expire the session. _See the complete example in request samples._ InfluxDB stores user sessions in memory only. If a user doesn't sign out, then the user session automatically expires within ten minutes or during a restart of the InfluxDB instance. To learn more about cookies in HTTP requests, see [Mozilla Developer Network (MDN) Web Docs, HTTP cookies](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies). #### Related endpoints - [Signin](#tag/Signin) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_signout(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_signout_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.post_signout_with_http_info(**kwargs) # noqa: E501 - return data - - def post_signout_with_http_info(self, **kwargs): # noqa: E501,D401,D403 - """Expire a user session. - - Expires a user session specified by a session cookie. Use this endpoint to expire a user session that was generated when the user authenticated with the InfluxDB Developer Console (UI) or the `POST /api/v2/signin` endpoint. For example, the `POST /api/v2/signout` endpoint represents the third step in the following three-step process to authenticate a user, retrieve the `user` resource, and then expire the session: 1. Send a request with the user's [Basic authentication credentials](#section/Authentication/BasicAuthentication) to the `POST /api/v2/signin` endpoint to create a user session and generate a session cookie. 2. Send a request to the `GET /api/v2/me` endpoint, passing the stored session cookie from step 1 to retrieve user information. 3. Send a request to the `POST /api/v2/signout` endpoint, passing the stored session cookie to expire the session. _See the complete example in request samples._ InfluxDB stores user sessions in memory only. If a user doesn't sign out, then the user session automatically expires within ten minutes or during a restart of the InfluxDB instance. To learn more about cookies in HTTP requests, see [Mozilla Developer Network (MDN) Web Docs, HTTP cookies](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies). #### Related endpoints - [Signin](#tag/Signin) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_signout_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_signout_prepare(**kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/signout', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_signout_async(self, **kwargs): # noqa: E501,D401,D403 - """Expire a user session. - - Expires a user session specified by a session cookie. Use this endpoint to expire a user session that was generated when the user authenticated with the InfluxDB Developer Console (UI) or the `POST /api/v2/signin` endpoint. For example, the `POST /api/v2/signout` endpoint represents the third step in the following three-step process to authenticate a user, retrieve the `user` resource, and then expire the session: 1. Send a request with the user's [Basic authentication credentials](#section/Authentication/BasicAuthentication) to the `POST /api/v2/signin` endpoint to create a user session and generate a session cookie. 2. Send a request to the `GET /api/v2/me` endpoint, passing the stored session cookie from step 1 to retrieve user information. 3. Send a request to the `POST /api/v2/signout` endpoint, passing the stored session cookie to expire the session. _See the complete example in request samples._ InfluxDB stores user sessions in memory only. If a user doesn't sign out, then the user session automatically expires within ten minutes or during a restart of the InfluxDB instance. To learn more about cookies in HTTP requests, see [Mozilla Developer Network (MDN) Web Docs, HTTP cookies](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies). #### Related endpoints - [Signin](#tag/Signin) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_signout_prepare(**kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/signout', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_signout_prepare(self, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['zap_trace_span'] # noqa: E501 - self._check_operation_params('post_signout', all_params, local_var_params) - - path_params = {} - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params diff --git a/frogpilot/third_party/influxdb_client/service/sources_service.py b/frogpilot/third_party/influxdb_client/service/sources_service.py deleted file mode 100644 index 5bb381f1..00000000 --- a/frogpilot/third_party/influxdb_client/service/sources_service.py +++ /dev/null @@ -1,860 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -from influxdb_client.service._base_service import _BaseService - - -class SourcesService(_BaseService): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): # noqa: E501,D401,D403 - """SourcesService - a operation defined in OpenAPI.""" - super().__init__(api_client) - - def delete_sources_id(self, source_id, **kwargs): # noqa: E501,D401,D403 - """Delete a source. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_sources_id(source_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str source_id: The source ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_sources_id_with_http_info(source_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_sources_id_with_http_info(source_id, **kwargs) # noqa: E501 - return data - - def delete_sources_id_with_http_info(self, source_id, **kwargs): # noqa: E501,D401,D403 - """Delete a source. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_sources_id_with_http_info(source_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str source_id: The source ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_sources_id_prepare(source_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/sources/{sourceID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def delete_sources_id_async(self, source_id, **kwargs): # noqa: E501,D401,D403 - """Delete a source. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str source_id: The source ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_sources_id_prepare(source_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/sources/{sourceID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _delete_sources_id_prepare(self, source_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['source_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('delete_sources_id', all_params, local_var_params) - # verify the required parameter 'source_id' is set - if ('source_id' not in local_var_params or - local_var_params['source_id'] is None): - raise ValueError("Missing the required parameter `source_id` when calling `delete_sources_id`") # noqa: E501 - - path_params = {} - if 'source_id' in local_var_params: - path_params['sourceID'] = local_var_params['source_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_sources(self, **kwargs): # noqa: E501,D401,D403 - """List all sources. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_sources(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param str org: The name of the organization. - :return: Sources - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_sources_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_sources_with_http_info(**kwargs) # noqa: E501 - return data - - def get_sources_with_http_info(self, **kwargs): # noqa: E501,D401,D403 - """List all sources. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_sources_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param str org: The name of the organization. - :return: Sources - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_sources_prepare(**kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/sources', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Sources', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_sources_async(self, **kwargs): # noqa: E501,D401,D403 - """List all sources. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param str org: The name of the organization. - :return: Sources - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_sources_prepare(**kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/sources', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Sources', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_sources_prepare(self, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['zap_trace_span', 'org'] # noqa: E501 - self._check_operation_params('get_sources', all_params, local_var_params) - - path_params = {} - - query_params = [] - if 'org' in local_var_params: - query_params.append(('org', local_var_params['org'])) # noqa: E501 - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_sources_id(self, source_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a source. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_sources_id(source_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str source_id: The source ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: Source - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_sources_id_with_http_info(source_id, **kwargs) # noqa: E501 - else: - (data) = self.get_sources_id_with_http_info(source_id, **kwargs) # noqa: E501 - return data - - def get_sources_id_with_http_info(self, source_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a source. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_sources_id_with_http_info(source_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str source_id: The source ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: Source - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_sources_id_prepare(source_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/sources/{sourceID}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Source', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_sources_id_async(self, source_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a source. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str source_id: The source ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: Source - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_sources_id_prepare(source_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/sources/{sourceID}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Source', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_sources_id_prepare(self, source_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['source_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_sources_id', all_params, local_var_params) - # verify the required parameter 'source_id' is set - if ('source_id' not in local_var_params or - local_var_params['source_id'] is None): - raise ValueError("Missing the required parameter `source_id` when calling `get_sources_id`") # noqa: E501 - - path_params = {} - if 'source_id' in local_var_params: - path_params['sourceID'] = local_var_params['source_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_sources_id_buckets(self, source_id, **kwargs): # noqa: E501,D401,D403 - """Get buckets in a source. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_sources_id_buckets(source_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str source_id: The source ID. (required) - :param str zap_trace_span: OpenTracing span context - :param str org: The name of the organization. - :return: Buckets - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_sources_id_buckets_with_http_info(source_id, **kwargs) # noqa: E501 - else: - (data) = self.get_sources_id_buckets_with_http_info(source_id, **kwargs) # noqa: E501 - return data - - def get_sources_id_buckets_with_http_info(self, source_id, **kwargs): # noqa: E501,D401,D403 - """Get buckets in a source. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_sources_id_buckets_with_http_info(source_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str source_id: The source ID. (required) - :param str zap_trace_span: OpenTracing span context - :param str org: The name of the organization. - :return: Buckets - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_sources_id_buckets_prepare(source_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/sources/{sourceID}/buckets', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Buckets', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_sources_id_buckets_async(self, source_id, **kwargs): # noqa: E501,D401,D403 - """Get buckets in a source. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str source_id: The source ID. (required) - :param str zap_trace_span: OpenTracing span context - :param str org: The name of the organization. - :return: Buckets - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_sources_id_buckets_prepare(source_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/sources/{sourceID}/buckets', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Buckets', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_sources_id_buckets_prepare(self, source_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['source_id', 'zap_trace_span', 'org'] # noqa: E501 - self._check_operation_params('get_sources_id_buckets', all_params, local_var_params) - # verify the required parameter 'source_id' is set - if ('source_id' not in local_var_params or - local_var_params['source_id'] is None): - raise ValueError("Missing the required parameter `source_id` when calling `get_sources_id_buckets`") # noqa: E501 - - path_params = {} - if 'source_id' in local_var_params: - path_params['sourceID'] = local_var_params['source_id'] # noqa: E501 - - query_params = [] - if 'org' in local_var_params: - query_params.append(('org', local_var_params['org'])) # noqa: E501 - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_sources_id_health(self, source_id, **kwargs): # noqa: E501,D401,D403 - """Get the health of a source. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_sources_id_health(source_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str source_id: The source ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: HealthCheck - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_sources_id_health_with_http_info(source_id, **kwargs) # noqa: E501 - else: - (data) = self.get_sources_id_health_with_http_info(source_id, **kwargs) # noqa: E501 - return data - - def get_sources_id_health_with_http_info(self, source_id, **kwargs): # noqa: E501,D401,D403 - """Get the health of a source. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_sources_id_health_with_http_info(source_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str source_id: The source ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: HealthCheck - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_sources_id_health_prepare(source_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/sources/{sourceID}/health', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='HealthCheck', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_sources_id_health_async(self, source_id, **kwargs): # noqa: E501,D401,D403 - """Get the health of a source. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str source_id: The source ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: HealthCheck - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_sources_id_health_prepare(source_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/sources/{sourceID}/health', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='HealthCheck', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_sources_id_health_prepare(self, source_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['source_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_sources_id_health', all_params, local_var_params) - # verify the required parameter 'source_id' is set - if ('source_id' not in local_var_params or - local_var_params['source_id'] is None): - raise ValueError("Missing the required parameter `source_id` when calling `get_sources_id_health`") # noqa: E501 - - path_params = {} - if 'source_id' in local_var_params: - path_params['sourceID'] = local_var_params['source_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def patch_sources_id(self, source_id, source, **kwargs): # noqa: E501,D401,D403 - """Update a Source. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_sources_id(source_id, source, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str source_id: The source ID. (required) - :param Source source: Source update (required) - :param str zap_trace_span: OpenTracing span context - :return: Source - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.patch_sources_id_with_http_info(source_id, source, **kwargs) # noqa: E501 - else: - (data) = self.patch_sources_id_with_http_info(source_id, source, **kwargs) # noqa: E501 - return data - - def patch_sources_id_with_http_info(self, source_id, source, **kwargs): # noqa: E501,D401,D403 - """Update a Source. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_sources_id_with_http_info(source_id, source, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str source_id: The source ID. (required) - :param Source source: Source update (required) - :param str zap_trace_span: OpenTracing span context - :return: Source - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_sources_id_prepare(source_id, source, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/sources/{sourceID}', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Source', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def patch_sources_id_async(self, source_id, source, **kwargs): # noqa: E501,D401,D403 - """Update a Source. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str source_id: The source ID. (required) - :param Source source: Source update (required) - :param str zap_trace_span: OpenTracing span context - :return: Source - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_sources_id_prepare(source_id, source, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/sources/{sourceID}', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Source', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _patch_sources_id_prepare(self, source_id, source, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['source_id', 'source', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('patch_sources_id', all_params, local_var_params) - # verify the required parameter 'source_id' is set - if ('source_id' not in local_var_params or - local_var_params['source_id'] is None): - raise ValueError("Missing the required parameter `source_id` when calling `patch_sources_id`") # noqa: E501 - # verify the required parameter 'source' is set - if ('source' not in local_var_params or - local_var_params['source'] is None): - raise ValueError("Missing the required parameter `source` when calling `patch_sources_id`") # noqa: E501 - - path_params = {} - if 'source_id' in local_var_params: - path_params['sourceID'] = local_var_params['source_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'source' in local_var_params: - body_params = local_var_params['source'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_sources(self, source, **kwargs): # noqa: E501,D401,D403 - """Create a source. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_sources(source, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param Source source: Source to create (required) - :param str zap_trace_span: OpenTracing span context - :return: Source - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_sources_with_http_info(source, **kwargs) # noqa: E501 - else: - (data) = self.post_sources_with_http_info(source, **kwargs) # noqa: E501 - return data - - def post_sources_with_http_info(self, source, **kwargs): # noqa: E501,D401,D403 - """Create a source. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_sources_with_http_info(source, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param Source source: Source to create (required) - :param str zap_trace_span: OpenTracing span context - :return: Source - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_sources_prepare(source, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/sources', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Source', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_sources_async(self, source, **kwargs): # noqa: E501,D401,D403 - """Create a source. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param Source source: Source to create (required) - :param str zap_trace_span: OpenTracing span context - :return: Source - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_sources_prepare(source, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/sources', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Source', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_sources_prepare(self, source, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['source', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('post_sources', all_params, local_var_params) - # verify the required parameter 'source' is set - if ('source' not in local_var_params or - local_var_params['source'] is None): - raise ValueError("Missing the required parameter `source` when calling `post_sources`") # noqa: E501 - - path_params = {} - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'source' in local_var_params: - body_params = local_var_params['source'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params diff --git a/frogpilot/third_party/influxdb_client/service/tasks_service.py b/frogpilot/third_party/influxdb_client/service/tasks_service.py deleted file mode 100644 index 91429514..00000000 --- a/frogpilot/third_party/influxdb_client/service/tasks_service.py +++ /dev/null @@ -1,2725 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -from influxdb_client.service._base_service import _BaseService - - -class TasksService(_BaseService): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): # noqa: E501,D401,D403 - """TasksService - a operation defined in OpenAPI.""" - super().__init__(api_client) - - def delete_tasks_id(self, task_id, **kwargs): # noqa: E501,D401,D403 - """Delete a task. - - Deletes a task and associated records. Use this endpoint to delete a task and all associated records (task runs, logs, and labels). Once the task is deleted, InfluxDB cancels all scheduled runs of the task. If you want to disable a task instead of delete it, [update the task status to `inactive`](#operation/PatchTasksID). - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_tasks_id(task_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_id: The ID of the task to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_tasks_id_with_http_info(task_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_tasks_id_with_http_info(task_id, **kwargs) # noqa: E501 - return data - - def delete_tasks_id_with_http_info(self, task_id, **kwargs): # noqa: E501,D401,D403 - """Delete a task. - - Deletes a task and associated records. Use this endpoint to delete a task and all associated records (task runs, logs, and labels). Once the task is deleted, InfluxDB cancels all scheduled runs of the task. If you want to disable a task instead of delete it, [update the task status to `inactive`](#operation/PatchTasksID). - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_tasks_id_with_http_info(task_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_id: The ID of the task to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_tasks_id_prepare(task_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/tasks/{taskID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def delete_tasks_id_async(self, task_id, **kwargs): # noqa: E501,D401,D403 - """Delete a task. - - Deletes a task and associated records. Use this endpoint to delete a task and all associated records (task runs, logs, and labels). Once the task is deleted, InfluxDB cancels all scheduled runs of the task. If you want to disable a task instead of delete it, [update the task status to `inactive`](#operation/PatchTasksID). - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str task_id: The ID of the task to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_tasks_id_prepare(task_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/tasks/{taskID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _delete_tasks_id_prepare(self, task_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['task_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('delete_tasks_id', all_params, local_var_params) - # verify the required parameter 'task_id' is set - if ('task_id' not in local_var_params or - local_var_params['task_id'] is None): - raise ValueError("Missing the required parameter `task_id` when calling `delete_tasks_id`") # noqa: E501 - - path_params = {} - if 'task_id' in local_var_params: - path_params['taskID'] = local_var_params['task_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def delete_tasks_id_labels_id(self, task_id, label_id, **kwargs): # noqa: E501,D401,D403 - """Delete a label from a task. - - Deletes a label from a task. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_tasks_id_labels_id(task_id, label_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_id: The ID of the task to delete the label from. (required) - :param str label_id: The ID of the label to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_tasks_id_labels_id_with_http_info(task_id, label_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_tasks_id_labels_id_with_http_info(task_id, label_id, **kwargs) # noqa: E501 - return data - - def delete_tasks_id_labels_id_with_http_info(self, task_id, label_id, **kwargs): # noqa: E501,D401,D403 - """Delete a label from a task. - - Deletes a label from a task. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_tasks_id_labels_id_with_http_info(task_id, label_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_id: The ID of the task to delete the label from. (required) - :param str label_id: The ID of the label to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_tasks_id_labels_id_prepare(task_id, label_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/tasks/{taskID}/labels/{labelID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def delete_tasks_id_labels_id_async(self, task_id, label_id, **kwargs): # noqa: E501,D401,D403 - """Delete a label from a task. - - Deletes a label from a task. - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str task_id: The ID of the task to delete the label from. (required) - :param str label_id: The ID of the label to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_tasks_id_labels_id_prepare(task_id, label_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/tasks/{taskID}/labels/{labelID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _delete_tasks_id_labels_id_prepare(self, task_id, label_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['task_id', 'label_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('delete_tasks_id_labels_id', all_params, local_var_params) - # verify the required parameter 'task_id' is set - if ('task_id' not in local_var_params or - local_var_params['task_id'] is None): - raise ValueError("Missing the required parameter `task_id` when calling `delete_tasks_id_labels_id`") # noqa: E501 - # verify the required parameter 'label_id' is set - if ('label_id' not in local_var_params or - local_var_params['label_id'] is None): - raise ValueError("Missing the required parameter `label_id` when calling `delete_tasks_id_labels_id`") # noqa: E501 - - path_params = {} - if 'task_id' in local_var_params: - path_params['taskID'] = local_var_params['task_id'] # noqa: E501 - if 'label_id' in local_var_params: - path_params['labelID'] = local_var_params['label_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def delete_tasks_id_members_id(self, user_id, task_id, **kwargs): # noqa: E501,D401,D403 - """Remove a member from a task. - - **Deprecated**: Tasks don't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. Removes a member from a [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task). - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_tasks_id_members_id(user_id, task_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_id: The ID of the member to remove. (required) - :param str task_id: The task ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_tasks_id_members_id_with_http_info(user_id, task_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_tasks_id_members_id_with_http_info(user_id, task_id, **kwargs) # noqa: E501 - return data - - def delete_tasks_id_members_id_with_http_info(self, user_id, task_id, **kwargs): # noqa: E501,D401,D403 - """Remove a member from a task. - - **Deprecated**: Tasks don't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. Removes a member from a [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task). - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_tasks_id_members_id_with_http_info(user_id, task_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_id: The ID of the member to remove. (required) - :param str task_id: The task ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_tasks_id_members_id_prepare(user_id, task_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/tasks/{taskID}/members/{userID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def delete_tasks_id_members_id_async(self, user_id, task_id, **kwargs): # noqa: E501,D401,D403 - """Remove a member from a task. - - **Deprecated**: Tasks don't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. Removes a member from a [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task). - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str user_id: The ID of the member to remove. (required) - :param str task_id: The task ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_tasks_id_members_id_prepare(user_id, task_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/tasks/{taskID}/members/{userID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _delete_tasks_id_members_id_prepare(self, user_id, task_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['user_id', 'task_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('delete_tasks_id_members_id', all_params, local_var_params) - # verify the required parameter 'user_id' is set - if ('user_id' not in local_var_params or - local_var_params['user_id'] is None): - raise ValueError("Missing the required parameter `user_id` when calling `delete_tasks_id_members_id`") # noqa: E501 - # verify the required parameter 'task_id' is set - if ('task_id' not in local_var_params or - local_var_params['task_id'] is None): - raise ValueError("Missing the required parameter `task_id` when calling `delete_tasks_id_members_id`") # noqa: E501 - - path_params = {} - if 'user_id' in local_var_params: - path_params['userID'] = local_var_params['user_id'] # noqa: E501 - if 'task_id' in local_var_params: - path_params['taskID'] = local_var_params['task_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def delete_tasks_id_owners_id(self, user_id, task_id, **kwargs): # noqa: E501,D401,D403 - """Remove an owner from a task. - - **Deprecated**: Tasks don't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_tasks_id_owners_id(user_id, task_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_id: The ID of the owner to remove. (required) - :param str task_id: The task ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_tasks_id_owners_id_with_http_info(user_id, task_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_tasks_id_owners_id_with_http_info(user_id, task_id, **kwargs) # noqa: E501 - return data - - def delete_tasks_id_owners_id_with_http_info(self, user_id, task_id, **kwargs): # noqa: E501,D401,D403 - """Remove an owner from a task. - - **Deprecated**: Tasks don't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_tasks_id_owners_id_with_http_info(user_id, task_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_id: The ID of the owner to remove. (required) - :param str task_id: The task ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_tasks_id_owners_id_prepare(user_id, task_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/tasks/{taskID}/owners/{userID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def delete_tasks_id_owners_id_async(self, user_id, task_id, **kwargs): # noqa: E501,D401,D403 - """Remove an owner from a task. - - **Deprecated**: Tasks don't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str user_id: The ID of the owner to remove. (required) - :param str task_id: The task ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_tasks_id_owners_id_prepare(user_id, task_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/tasks/{taskID}/owners/{userID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _delete_tasks_id_owners_id_prepare(self, user_id, task_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['user_id', 'task_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('delete_tasks_id_owners_id', all_params, local_var_params) - # verify the required parameter 'user_id' is set - if ('user_id' not in local_var_params or - local_var_params['user_id'] is None): - raise ValueError("Missing the required parameter `user_id` when calling `delete_tasks_id_owners_id`") # noqa: E501 - # verify the required parameter 'task_id' is set - if ('task_id' not in local_var_params or - local_var_params['task_id'] is None): - raise ValueError("Missing the required parameter `task_id` when calling `delete_tasks_id_owners_id`") # noqa: E501 - - path_params = {} - if 'user_id' in local_var_params: - path_params['userID'] = local_var_params['user_id'] # noqa: E501 - if 'task_id' in local_var_params: - path_params['taskID'] = local_var_params['task_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def delete_tasks_id_runs_id(self, task_id, run_id, **kwargs): # noqa: E501,D401,D403 - """Cancel a running task. - - Cancels a running [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task). Use this endpoint with InfluxDB OSS to cancel a running task. #### InfluxDB Cloud - Doesn't support this operation. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_tasks_id_runs_id(task_id, run_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_id: The ID of the task to cancel. (required) - :param str run_id: The ID of the task run to cancel. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_tasks_id_runs_id_with_http_info(task_id, run_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_tasks_id_runs_id_with_http_info(task_id, run_id, **kwargs) # noqa: E501 - return data - - def delete_tasks_id_runs_id_with_http_info(self, task_id, run_id, **kwargs): # noqa: E501,D401,D403 - """Cancel a running task. - - Cancels a running [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task). Use this endpoint with InfluxDB OSS to cancel a running task. #### InfluxDB Cloud - Doesn't support this operation. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_tasks_id_runs_id_with_http_info(task_id, run_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_id: The ID of the task to cancel. (required) - :param str run_id: The ID of the task run to cancel. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_tasks_id_runs_id_prepare(task_id, run_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/tasks/{taskID}/runs/{runID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def delete_tasks_id_runs_id_async(self, task_id, run_id, **kwargs): # noqa: E501,D401,D403 - """Cancel a running task. - - Cancels a running [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task). Use this endpoint with InfluxDB OSS to cancel a running task. #### InfluxDB Cloud - Doesn't support this operation. - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str task_id: The ID of the task to cancel. (required) - :param str run_id: The ID of the task run to cancel. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_tasks_id_runs_id_prepare(task_id, run_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/tasks/{taskID}/runs/{runID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _delete_tasks_id_runs_id_prepare(self, task_id, run_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['task_id', 'run_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('delete_tasks_id_runs_id', all_params, local_var_params) - # verify the required parameter 'task_id' is set - if ('task_id' not in local_var_params or - local_var_params['task_id'] is None): - raise ValueError("Missing the required parameter `task_id` when calling `delete_tasks_id_runs_id`") # noqa: E501 - # verify the required parameter 'run_id' is set - if ('run_id' not in local_var_params or - local_var_params['run_id'] is None): - raise ValueError("Missing the required parameter `run_id` when calling `delete_tasks_id_runs_id`") # noqa: E501 - - path_params = {} - if 'task_id' in local_var_params: - path_params['taskID'] = local_var_params['task_id'] # noqa: E501 - if 'run_id' in local_var_params: - path_params['runID'] = local_var_params['run_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_tasks(self, **kwargs): # noqa: E501,D401,D403 - """List tasks. - - Retrieves a list of [tasks](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task). To limit which tasks are returned, pass query parameters in your request. If no query parameters are passed, InfluxDB returns all tasks up to the default `limit`. #### Related guide - [Process data with InfluxDB tasks](https://docs.influxdata.com/influxdb/latest/process-data/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tasks(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param str name: A [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) name. Only returns tasks with the specified name. Different tasks may have the same name. - :param str after: A [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) ID. Only returns tasks created after the specified task. - :param str user: A [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user) ID. Only returns tasks owned by the specified user. - :param str org: An [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization) name. Only returns tasks owned by the specified organization. - :param str org_id: An [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization) ID. Only returns tasks owned by the specified organization. - :param str status: A [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) status. Only returns tasks that have the specified status (`active` or `inactive`). - :param int limit: The maximum number of [tasks](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) to return. Default is `100`. The minimum is `1` and the maximum is `500`. To reduce the payload size, combine _`type=basic`_ and _`limit`_ (see _Request samples_). For more information about the `basic` response, see the _`type`_ parameter. - :param str type: A [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) type (`basic` or `system`). Default is `system`. Specifies the level of detail for tasks in the response. The default (`system`) response contains all the metadata properties for tasks. To reduce the response size, pass `basic` to omit some task properties (`flux`, `createdAt`, `updatedAt`). - :return: Tasks - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_tasks_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_tasks_with_http_info(**kwargs) # noqa: E501 - return data - - def get_tasks_with_http_info(self, **kwargs): # noqa: E501,D401,D403 - """List tasks. - - Retrieves a list of [tasks](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task). To limit which tasks are returned, pass query parameters in your request. If no query parameters are passed, InfluxDB returns all tasks up to the default `limit`. #### Related guide - [Process data with InfluxDB tasks](https://docs.influxdata.com/influxdb/latest/process-data/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tasks_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param str name: A [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) name. Only returns tasks with the specified name. Different tasks may have the same name. - :param str after: A [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) ID. Only returns tasks created after the specified task. - :param str user: A [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user) ID. Only returns tasks owned by the specified user. - :param str org: An [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization) name. Only returns tasks owned by the specified organization. - :param str org_id: An [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization) ID. Only returns tasks owned by the specified organization. - :param str status: A [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) status. Only returns tasks that have the specified status (`active` or `inactive`). - :param int limit: The maximum number of [tasks](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) to return. Default is `100`. The minimum is `1` and the maximum is `500`. To reduce the payload size, combine _`type=basic`_ and _`limit`_ (see _Request samples_). For more information about the `basic` response, see the _`type`_ parameter. - :param str type: A [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) type (`basic` or `system`). Default is `system`. Specifies the level of detail for tasks in the response. The default (`system`) response contains all the metadata properties for tasks. To reduce the response size, pass `basic` to omit some task properties (`flux`, `createdAt`, `updatedAt`). - :return: Tasks - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_tasks_prepare(**kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/tasks', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Tasks', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_tasks_async(self, **kwargs): # noqa: E501,D401,D403 - """List tasks. - - Retrieves a list of [tasks](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task). To limit which tasks are returned, pass query parameters in your request. If no query parameters are passed, InfluxDB returns all tasks up to the default `limit`. #### Related guide - [Process data with InfluxDB tasks](https://docs.influxdata.com/influxdb/latest/process-data/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param str name: A [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) name. Only returns tasks with the specified name. Different tasks may have the same name. - :param str after: A [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) ID. Only returns tasks created after the specified task. - :param str user: A [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user) ID. Only returns tasks owned by the specified user. - :param str org: An [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization) name. Only returns tasks owned by the specified organization. - :param str org_id: An [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization) ID. Only returns tasks owned by the specified organization. - :param str status: A [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) status. Only returns tasks that have the specified status (`active` or `inactive`). - :param int limit: The maximum number of [tasks](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) to return. Default is `100`. The minimum is `1` and the maximum is `500`. To reduce the payload size, combine _`type=basic`_ and _`limit`_ (see _Request samples_). For more information about the `basic` response, see the _`type`_ parameter. - :param str type: A [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) type (`basic` or `system`). Default is `system`. Specifies the level of detail for tasks in the response. The default (`system`) response contains all the metadata properties for tasks. To reduce the response size, pass `basic` to omit some task properties (`flux`, `createdAt`, `updatedAt`). - :return: Tasks - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_tasks_prepare(**kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/tasks', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Tasks', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_tasks_prepare(self, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['zap_trace_span', 'name', 'after', 'user', 'org', 'org_id', 'status', 'limit', 'type'] # noqa: E501 - self._check_operation_params('get_tasks', all_params, local_var_params) - - if 'limit' in local_var_params and local_var_params['limit'] > 500: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `get_tasks`, must be a value less than or equal to `500`") # noqa: E501 - if 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `get_tasks`, must be a value greater than or equal to `1`") # noqa: E501 - path_params = {} - - query_params = [] - if 'name' in local_var_params: - query_params.append(('name', local_var_params['name'])) # noqa: E501 - if 'after' in local_var_params: - query_params.append(('after', local_var_params['after'])) # noqa: E501 - if 'user' in local_var_params: - query_params.append(('user', local_var_params['user'])) # noqa: E501 - if 'org' in local_var_params: - query_params.append(('org', local_var_params['org'])) # noqa: E501 - if 'org_id' in local_var_params: - query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501 - if 'status' in local_var_params: - query_params.append(('status', local_var_params['status'])) # noqa: E501 - if 'limit' in local_var_params: - query_params.append(('limit', local_var_params['limit'])) # noqa: E501 - if 'type' in local_var_params: - query_params.append(('type', local_var_params['type'])) # noqa: E501 - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_tasks_id(self, task_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a task. - - Retrieves a [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task). - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tasks_id(task_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_id: The ID of the task to retrieve. (required) - :param str zap_trace_span: OpenTracing span context - :return: Task - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_tasks_id_with_http_info(task_id, **kwargs) # noqa: E501 - else: - (data) = self.get_tasks_id_with_http_info(task_id, **kwargs) # noqa: E501 - return data - - def get_tasks_id_with_http_info(self, task_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a task. - - Retrieves a [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task). - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tasks_id_with_http_info(task_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_id: The ID of the task to retrieve. (required) - :param str zap_trace_span: OpenTracing span context - :return: Task - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_tasks_id_prepare(task_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/tasks/{taskID}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Task', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_tasks_id_async(self, task_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a task. - - Retrieves a [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task). - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str task_id: The ID of the task to retrieve. (required) - :param str zap_trace_span: OpenTracing span context - :return: Task - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_tasks_id_prepare(task_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/tasks/{taskID}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Task', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_tasks_id_prepare(self, task_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['task_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_tasks_id', all_params, local_var_params) - # verify the required parameter 'task_id' is set - if ('task_id' not in local_var_params or - local_var_params['task_id'] is None): - raise ValueError("Missing the required parameter `task_id` when calling `get_tasks_id`") # noqa: E501 - - path_params = {} - if 'task_id' in local_var_params: - path_params['taskID'] = local_var_params['task_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_tasks_id_labels(self, task_id, **kwargs): # noqa: E501,D401,D403 - """List labels for a task. - - Retrieves a list of all labels for a task. Labels may be used for grouping and filtering tasks. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tasks_id_labels(task_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_id: The ID of the task to retrieve labels for. (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelsResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_tasks_id_labels_with_http_info(task_id, **kwargs) # noqa: E501 - else: - (data) = self.get_tasks_id_labels_with_http_info(task_id, **kwargs) # noqa: E501 - return data - - def get_tasks_id_labels_with_http_info(self, task_id, **kwargs): # noqa: E501,D401,D403 - """List labels for a task. - - Retrieves a list of all labels for a task. Labels may be used for grouping and filtering tasks. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tasks_id_labels_with_http_info(task_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_id: The ID of the task to retrieve labels for. (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelsResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_tasks_id_labels_prepare(task_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/tasks/{taskID}/labels', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='LabelsResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_tasks_id_labels_async(self, task_id, **kwargs): # noqa: E501,D401,D403 - """List labels for a task. - - Retrieves a list of all labels for a task. Labels may be used for grouping and filtering tasks. - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str task_id: The ID of the task to retrieve labels for. (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelsResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_tasks_id_labels_prepare(task_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/tasks/{taskID}/labels', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='LabelsResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_tasks_id_labels_prepare(self, task_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['task_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_tasks_id_labels', all_params, local_var_params) - # verify the required parameter 'task_id' is set - if ('task_id' not in local_var_params or - local_var_params['task_id'] is None): - raise ValueError("Missing the required parameter `task_id` when calling `get_tasks_id_labels`") # noqa: E501 - - path_params = {} - if 'task_id' in local_var_params: - path_params['taskID'] = local_var_params['task_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_tasks_id_logs(self, task_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve all logs for a task. - - Retrieves a list of all logs for a [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task). When an InfluxDB task runs, a “run” record is created in the task’s history. Logs associated with each run provide relevant log messages, timestamps, and the exit status of the run attempt. Use this endpoint to retrieve only the log events for a task, without additional task metadata. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tasks_id_logs(task_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_id: The task ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: Logs - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_tasks_id_logs_with_http_info(task_id, **kwargs) # noqa: E501 - else: - (data) = self.get_tasks_id_logs_with_http_info(task_id, **kwargs) # noqa: E501 - return data - - def get_tasks_id_logs_with_http_info(self, task_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve all logs for a task. - - Retrieves a list of all logs for a [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task). When an InfluxDB task runs, a “run” record is created in the task’s history. Logs associated with each run provide relevant log messages, timestamps, and the exit status of the run attempt. Use this endpoint to retrieve only the log events for a task, without additional task metadata. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tasks_id_logs_with_http_info(task_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_id: The task ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: Logs - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_tasks_id_logs_prepare(task_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/tasks/{taskID}/logs', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Logs', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_tasks_id_logs_async(self, task_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve all logs for a task. - - Retrieves a list of all logs for a [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task). When an InfluxDB task runs, a “run” record is created in the task’s history. Logs associated with each run provide relevant log messages, timestamps, and the exit status of the run attempt. Use this endpoint to retrieve only the log events for a task, without additional task metadata. - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str task_id: The task ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: Logs - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_tasks_id_logs_prepare(task_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/tasks/{taskID}/logs', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Logs', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_tasks_id_logs_prepare(self, task_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['task_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_tasks_id_logs', all_params, local_var_params) - # verify the required parameter 'task_id' is set - if ('task_id' not in local_var_params or - local_var_params['task_id'] is None): - raise ValueError("Missing the required parameter `task_id` when calling `get_tasks_id_logs`") # noqa: E501 - - path_params = {} - if 'task_id' in local_var_params: - path_params['taskID'] = local_var_params['task_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_tasks_id_members(self, task_id, **kwargs): # noqa: E501,D401,D403 - """List all task members. - - **Deprecated**: Tasks don't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. Lists all users that have the `member` role for the specified [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task). - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tasks_id_members(task_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_id: The task ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceMembers - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_tasks_id_members_with_http_info(task_id, **kwargs) # noqa: E501 - else: - (data) = self.get_tasks_id_members_with_http_info(task_id, **kwargs) # noqa: E501 - return data - - def get_tasks_id_members_with_http_info(self, task_id, **kwargs): # noqa: E501,D401,D403 - """List all task members. - - **Deprecated**: Tasks don't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. Lists all users that have the `member` role for the specified [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task). - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tasks_id_members_with_http_info(task_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_id: The task ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceMembers - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_tasks_id_members_prepare(task_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/tasks/{taskID}/members', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceMembers', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_tasks_id_members_async(self, task_id, **kwargs): # noqa: E501,D401,D403 - """List all task members. - - **Deprecated**: Tasks don't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. Lists all users that have the `member` role for the specified [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task). - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str task_id: The task ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceMembers - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_tasks_id_members_prepare(task_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/tasks/{taskID}/members', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceMembers', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_tasks_id_members_prepare(self, task_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['task_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_tasks_id_members', all_params, local_var_params) - # verify the required parameter 'task_id' is set - if ('task_id' not in local_var_params or - local_var_params['task_id'] is None): - raise ValueError("Missing the required parameter `task_id` when calling `get_tasks_id_members`") # noqa: E501 - - path_params = {} - if 'task_id' in local_var_params: - path_params['taskID'] = local_var_params['task_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_tasks_id_owners(self, task_id, **kwargs): # noqa: E501,D401,D403 - """List all owners of a task. - - **Deprecated**: Tasks don't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. Retrieves all users that have owner permission for a task. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tasks_id_owners(task_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_id: The ID of the task to retrieve owners for. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceOwners - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_tasks_id_owners_with_http_info(task_id, **kwargs) # noqa: E501 - else: - (data) = self.get_tasks_id_owners_with_http_info(task_id, **kwargs) # noqa: E501 - return data - - def get_tasks_id_owners_with_http_info(self, task_id, **kwargs): # noqa: E501,D401,D403 - """List all owners of a task. - - **Deprecated**: Tasks don't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. Retrieves all users that have owner permission for a task. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tasks_id_owners_with_http_info(task_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_id: The ID of the task to retrieve owners for. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceOwners - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_tasks_id_owners_prepare(task_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/tasks/{taskID}/owners', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceOwners', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_tasks_id_owners_async(self, task_id, **kwargs): # noqa: E501,D401,D403 - """List all owners of a task. - - **Deprecated**: Tasks don't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. Retrieves all users that have owner permission for a task. - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str task_id: The ID of the task to retrieve owners for. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceOwners - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_tasks_id_owners_prepare(task_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/tasks/{taskID}/owners', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceOwners', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_tasks_id_owners_prepare(self, task_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['task_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_tasks_id_owners', all_params, local_var_params) - # verify the required parameter 'task_id' is set - if ('task_id' not in local_var_params or - local_var_params['task_id'] is None): - raise ValueError("Missing the required parameter `task_id` when calling `get_tasks_id_owners`") # noqa: E501 - - path_params = {} - if 'task_id' in local_var_params: - path_params['taskID'] = local_var_params['task_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_tasks_id_runs(self, task_id, **kwargs): # noqa: E501,D401,D403 - """List runs for a task. - - Retrieves a list of runs for a [task](https://docs.influxdata.com/influxdb/latest/process-data/). To limit which task runs are returned, pass query parameters in your request. If no query parameters are passed, InfluxDB returns all task runs up to the default `limit`. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tasks_id_runs(task_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_id: The ID of the task to get runs for. Only returns runs for this task. (required) - :param str zap_trace_span: OpenTracing span context - :param str after: A task run ID. Only returns runs created after this run. - :param int limit: Limits the number of task runs returned. Default is `100`. - :param datetime after_time: A timestamp ([RFC3339 date/time format](https://docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339-timestamp)). Only returns runs scheduled after this time. - :param datetime before_time: A timestamp ([RFC3339 date/time format](https://docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339-timestamp)). Only returns runs scheduled before this time. - :return: Runs - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_tasks_id_runs_with_http_info(task_id, **kwargs) # noqa: E501 - else: - (data) = self.get_tasks_id_runs_with_http_info(task_id, **kwargs) # noqa: E501 - return data - - def get_tasks_id_runs_with_http_info(self, task_id, **kwargs): # noqa: E501,D401,D403 - """List runs for a task. - - Retrieves a list of runs for a [task](https://docs.influxdata.com/influxdb/latest/process-data/). To limit which task runs are returned, pass query parameters in your request. If no query parameters are passed, InfluxDB returns all task runs up to the default `limit`. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tasks_id_runs_with_http_info(task_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_id: The ID of the task to get runs for. Only returns runs for this task. (required) - :param str zap_trace_span: OpenTracing span context - :param str after: A task run ID. Only returns runs created after this run. - :param int limit: Limits the number of task runs returned. Default is `100`. - :param datetime after_time: A timestamp ([RFC3339 date/time format](https://docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339-timestamp)). Only returns runs scheduled after this time. - :param datetime before_time: A timestamp ([RFC3339 date/time format](https://docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339-timestamp)). Only returns runs scheduled before this time. - :return: Runs - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_tasks_id_runs_prepare(task_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/tasks/{taskID}/runs', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Runs', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_tasks_id_runs_async(self, task_id, **kwargs): # noqa: E501,D401,D403 - """List runs for a task. - - Retrieves a list of runs for a [task](https://docs.influxdata.com/influxdb/latest/process-data/). To limit which task runs are returned, pass query parameters in your request. If no query parameters are passed, InfluxDB returns all task runs up to the default `limit`. - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str task_id: The ID of the task to get runs for. Only returns runs for this task. (required) - :param str zap_trace_span: OpenTracing span context - :param str after: A task run ID. Only returns runs created after this run. - :param int limit: Limits the number of task runs returned. Default is `100`. - :param datetime after_time: A timestamp ([RFC3339 date/time format](https://docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339-timestamp)). Only returns runs scheduled after this time. - :param datetime before_time: A timestamp ([RFC3339 date/time format](https://docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339-timestamp)). Only returns runs scheduled before this time. - :return: Runs - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_tasks_id_runs_prepare(task_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/tasks/{taskID}/runs', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Runs', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_tasks_id_runs_prepare(self, task_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['task_id', 'zap_trace_span', 'after', 'limit', 'after_time', 'before_time'] # noqa: E501 - self._check_operation_params('get_tasks_id_runs', all_params, local_var_params) - # verify the required parameter 'task_id' is set - if ('task_id' not in local_var_params or - local_var_params['task_id'] is None): - raise ValueError("Missing the required parameter `task_id` when calling `get_tasks_id_runs`") # noqa: E501 - - if 'limit' in local_var_params and local_var_params['limit'] > 500: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `get_tasks_id_runs`, must be a value less than or equal to `500`") # noqa: E501 - if 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `get_tasks_id_runs`, must be a value greater than or equal to `1`") # noqa: E501 - path_params = {} - if 'task_id' in local_var_params: - path_params['taskID'] = local_var_params['task_id'] # noqa: E501 - - query_params = [] - if 'after' in local_var_params: - query_params.append(('after', local_var_params['after'])) # noqa: E501 - if 'limit' in local_var_params: - query_params.append(('limit', local_var_params['limit'])) # noqa: E501 - if 'after_time' in local_var_params: - query_params.append(('afterTime', local_var_params['after_time'])) # noqa: E501 - if 'before_time' in local_var_params: - query_params.append(('beforeTime', local_var_params['before_time'])) # noqa: E501 - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_tasks_id_runs_id(self, task_id, run_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a run for a task.. - - Retrieves a specific run for a [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task). Use this endpoint to retrieve detail and logs for a specific task run. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tasks_id_runs_id(task_id, run_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_id: The ID of the task to retrieve runs for. (required) - :param str run_id: The ID of the run to retrieve. (required) - :param str zap_trace_span: OpenTracing span context - :return: Run - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_tasks_id_runs_id_with_http_info(task_id, run_id, **kwargs) # noqa: E501 - else: - (data) = self.get_tasks_id_runs_id_with_http_info(task_id, run_id, **kwargs) # noqa: E501 - return data - - def get_tasks_id_runs_id_with_http_info(self, task_id, run_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a run for a task.. - - Retrieves a specific run for a [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task). Use this endpoint to retrieve detail and logs for a specific task run. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tasks_id_runs_id_with_http_info(task_id, run_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_id: The ID of the task to retrieve runs for. (required) - :param str run_id: The ID of the run to retrieve. (required) - :param str zap_trace_span: OpenTracing span context - :return: Run - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_tasks_id_runs_id_prepare(task_id, run_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/tasks/{taskID}/runs/{runID}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Run', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_tasks_id_runs_id_async(self, task_id, run_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a run for a task.. - - Retrieves a specific run for a [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task). Use this endpoint to retrieve detail and logs for a specific task run. - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str task_id: The ID of the task to retrieve runs for. (required) - :param str run_id: The ID of the run to retrieve. (required) - :param str zap_trace_span: OpenTracing span context - :return: Run - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_tasks_id_runs_id_prepare(task_id, run_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/tasks/{taskID}/runs/{runID}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Run', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_tasks_id_runs_id_prepare(self, task_id, run_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['task_id', 'run_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_tasks_id_runs_id', all_params, local_var_params) - # verify the required parameter 'task_id' is set - if ('task_id' not in local_var_params or - local_var_params['task_id'] is None): - raise ValueError("Missing the required parameter `task_id` when calling `get_tasks_id_runs_id`") # noqa: E501 - # verify the required parameter 'run_id' is set - if ('run_id' not in local_var_params or - local_var_params['run_id'] is None): - raise ValueError("Missing the required parameter `run_id` when calling `get_tasks_id_runs_id`") # noqa: E501 - - path_params = {} - if 'task_id' in local_var_params: - path_params['taskID'] = local_var_params['task_id'] # noqa: E501 - if 'run_id' in local_var_params: - path_params['runID'] = local_var_params['run_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_tasks_id_runs_id_logs(self, task_id, run_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve all logs for a run. - - Retrieves all logs for a task run. A log is a list of run events with `runID`, `time`, and `message` properties. Use this endpoint to help analyze task performance and troubleshoot failed task runs. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tasks_id_runs_id_logs(task_id, run_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_id: The ID of the task to get logs for. (required) - :param str run_id: The ID of the run to get logs for. (required) - :param str zap_trace_span: OpenTracing span context - :return: Logs - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_tasks_id_runs_id_logs_with_http_info(task_id, run_id, **kwargs) # noqa: E501 - else: - (data) = self.get_tasks_id_runs_id_logs_with_http_info(task_id, run_id, **kwargs) # noqa: E501 - return data - - def get_tasks_id_runs_id_logs_with_http_info(self, task_id, run_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve all logs for a run. - - Retrieves all logs for a task run. A log is a list of run events with `runID`, `time`, and `message` properties. Use this endpoint to help analyze task performance and troubleshoot failed task runs. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tasks_id_runs_id_logs_with_http_info(task_id, run_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_id: The ID of the task to get logs for. (required) - :param str run_id: The ID of the run to get logs for. (required) - :param str zap_trace_span: OpenTracing span context - :return: Logs - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_tasks_id_runs_id_logs_prepare(task_id, run_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/tasks/{taskID}/runs/{runID}/logs', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Logs', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_tasks_id_runs_id_logs_async(self, task_id, run_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve all logs for a run. - - Retrieves all logs for a task run. A log is a list of run events with `runID`, `time`, and `message` properties. Use this endpoint to help analyze task performance and troubleshoot failed task runs. - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str task_id: The ID of the task to get logs for. (required) - :param str run_id: The ID of the run to get logs for. (required) - :param str zap_trace_span: OpenTracing span context - :return: Logs - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_tasks_id_runs_id_logs_prepare(task_id, run_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/tasks/{taskID}/runs/{runID}/logs', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Logs', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_tasks_id_runs_id_logs_prepare(self, task_id, run_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['task_id', 'run_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_tasks_id_runs_id_logs', all_params, local_var_params) - # verify the required parameter 'task_id' is set - if ('task_id' not in local_var_params or - local_var_params['task_id'] is None): - raise ValueError("Missing the required parameter `task_id` when calling `get_tasks_id_runs_id_logs`") # noqa: E501 - # verify the required parameter 'run_id' is set - if ('run_id' not in local_var_params or - local_var_params['run_id'] is None): - raise ValueError("Missing the required parameter `run_id` when calling `get_tasks_id_runs_id_logs`") # noqa: E501 - - path_params = {} - if 'task_id' in local_var_params: - path_params['taskID'] = local_var_params['task_id'] # noqa: E501 - if 'run_id' in local_var_params: - path_params['runID'] = local_var_params['run_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def patch_tasks_id(self, task_id, task_update_request, **kwargs): # noqa: E501,D401,D403 - """Update a task. - - Updates a task and then cancels all scheduled runs of the task. Use this endpoint to set, modify, and clear task properties (for example: `cron`, `name`, `flux`, `status`). Once InfluxDB applies the update, it cancels all previously scheduled runs of the task. To update a task, pass an object that contains the updated key-value pairs. To activate or inactivate a task, set the `status` property. _`"status": "inactive"`_ cancels scheduled runs and prevents manual runs of the task. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_tasks_id(task_id, task_update_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_id: The ID of the task to update. (required) - :param TaskUpdateRequest task_update_request: An object that contains updated task properties to apply. (required) - :param str zap_trace_span: OpenTracing span context - :return: Task - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.patch_tasks_id_with_http_info(task_id, task_update_request, **kwargs) # noqa: E501 - else: - (data) = self.patch_tasks_id_with_http_info(task_id, task_update_request, **kwargs) # noqa: E501 - return data - - def patch_tasks_id_with_http_info(self, task_id, task_update_request, **kwargs): # noqa: E501,D401,D403 - """Update a task. - - Updates a task and then cancels all scheduled runs of the task. Use this endpoint to set, modify, and clear task properties (for example: `cron`, `name`, `flux`, `status`). Once InfluxDB applies the update, it cancels all previously scheduled runs of the task. To update a task, pass an object that contains the updated key-value pairs. To activate or inactivate a task, set the `status` property. _`"status": "inactive"`_ cancels scheduled runs and prevents manual runs of the task. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_tasks_id_with_http_info(task_id, task_update_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_id: The ID of the task to update. (required) - :param TaskUpdateRequest task_update_request: An object that contains updated task properties to apply. (required) - :param str zap_trace_span: OpenTracing span context - :return: Task - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_tasks_id_prepare(task_id, task_update_request, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/tasks/{taskID}', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Task', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def patch_tasks_id_async(self, task_id, task_update_request, **kwargs): # noqa: E501,D401,D403 - """Update a task. - - Updates a task and then cancels all scheduled runs of the task. Use this endpoint to set, modify, and clear task properties (for example: `cron`, `name`, `flux`, `status`). Once InfluxDB applies the update, it cancels all previously scheduled runs of the task. To update a task, pass an object that contains the updated key-value pairs. To activate or inactivate a task, set the `status` property. _`"status": "inactive"`_ cancels scheduled runs and prevents manual runs of the task. - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str task_id: The ID of the task to update. (required) - :param TaskUpdateRequest task_update_request: An object that contains updated task properties to apply. (required) - :param str zap_trace_span: OpenTracing span context - :return: Task - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_tasks_id_prepare(task_id, task_update_request, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/tasks/{taskID}', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Task', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _patch_tasks_id_prepare(self, task_id, task_update_request, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['task_id', 'task_update_request', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('patch_tasks_id', all_params, local_var_params) - # verify the required parameter 'task_id' is set - if ('task_id' not in local_var_params or - local_var_params['task_id'] is None): - raise ValueError("Missing the required parameter `task_id` when calling `patch_tasks_id`") # noqa: E501 - # verify the required parameter 'task_update_request' is set - if ('task_update_request' not in local_var_params or - local_var_params['task_update_request'] is None): - raise ValueError("Missing the required parameter `task_update_request` when calling `patch_tasks_id`") # noqa: E501 - - path_params = {} - if 'task_id' in local_var_params: - path_params['taskID'] = local_var_params['task_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'task_update_request' in local_var_params: - body_params = local_var_params['task_update_request'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_tasks(self, task_create_request, **kwargs): # noqa: E501,D401,D403 - """Create a task. - - Creates a [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) and returns the task. #### Related guides - [Get started with tasks](https://docs.influxdata.com/influxdb/latest/process-data/get-started/) - [Create a task](https://docs.influxdata.com/influxdb/latest/process-data/manage-tasks/create-task/) - [Common tasks](https://docs.influxdata.com/influxdb/latest/process-data/common-tasks/) - [Task configuration options](https://docs.influxdata.com/influxdb/latest/process-data/task-options/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_tasks(task_create_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TaskCreateRequest task_create_request: The task to create. (required) - :param str zap_trace_span: OpenTracing span context - :return: Task - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_tasks_with_http_info(task_create_request, **kwargs) # noqa: E501 - else: - (data) = self.post_tasks_with_http_info(task_create_request, **kwargs) # noqa: E501 - return data - - def post_tasks_with_http_info(self, task_create_request, **kwargs): # noqa: E501,D401,D403 - """Create a task. - - Creates a [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) and returns the task. #### Related guides - [Get started with tasks](https://docs.influxdata.com/influxdb/latest/process-data/get-started/) - [Create a task](https://docs.influxdata.com/influxdb/latest/process-data/manage-tasks/create-task/) - [Common tasks](https://docs.influxdata.com/influxdb/latest/process-data/common-tasks/) - [Task configuration options](https://docs.influxdata.com/influxdb/latest/process-data/task-options/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_tasks_with_http_info(task_create_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TaskCreateRequest task_create_request: The task to create. (required) - :param str zap_trace_span: OpenTracing span context - :return: Task - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_tasks_prepare(task_create_request, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/tasks', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Task', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_tasks_async(self, task_create_request, **kwargs): # noqa: E501,D401,D403 - """Create a task. - - Creates a [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) and returns the task. #### Related guides - [Get started with tasks](https://docs.influxdata.com/influxdb/latest/process-data/get-started/) - [Create a task](https://docs.influxdata.com/influxdb/latest/process-data/manage-tasks/create-task/) - [Common tasks](https://docs.influxdata.com/influxdb/latest/process-data/common-tasks/) - [Task configuration options](https://docs.influxdata.com/influxdb/latest/process-data/task-options/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param TaskCreateRequest task_create_request: The task to create. (required) - :param str zap_trace_span: OpenTracing span context - :return: Task - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_tasks_prepare(task_create_request, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/tasks', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Task', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_tasks_prepare(self, task_create_request, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['task_create_request', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('post_tasks', all_params, local_var_params) - # verify the required parameter 'task_create_request' is set - if ('task_create_request' not in local_var_params or - local_var_params['task_create_request'] is None): - raise ValueError("Missing the required parameter `task_create_request` when calling `post_tasks`") # noqa: E501 - - path_params = {} - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'task_create_request' in local_var_params: - body_params = local_var_params['task_create_request'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_tasks_id_labels(self, task_id, label_mapping, **kwargs): # noqa: E501,D401,D403 - """Add a label to a task. - - Adds a label to a task. Use this endpoint to add a label that you can use to filter tasks in the InfluxDB UI. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_tasks_id_labels(task_id, label_mapping, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_id: The ID of the task to label. (required) - :param LabelMapping label_mapping: An object that contains a _`labelID`_ to add to the task. (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_tasks_id_labels_with_http_info(task_id, label_mapping, **kwargs) # noqa: E501 - else: - (data) = self.post_tasks_id_labels_with_http_info(task_id, label_mapping, **kwargs) # noqa: E501 - return data - - def post_tasks_id_labels_with_http_info(self, task_id, label_mapping, **kwargs): # noqa: E501,D401,D403 - """Add a label to a task. - - Adds a label to a task. Use this endpoint to add a label that you can use to filter tasks in the InfluxDB UI. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_tasks_id_labels_with_http_info(task_id, label_mapping, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_id: The ID of the task to label. (required) - :param LabelMapping label_mapping: An object that contains a _`labelID`_ to add to the task. (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_tasks_id_labels_prepare(task_id, label_mapping, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/tasks/{taskID}/labels', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='LabelResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_tasks_id_labels_async(self, task_id, label_mapping, **kwargs): # noqa: E501,D401,D403 - """Add a label to a task. - - Adds a label to a task. Use this endpoint to add a label that you can use to filter tasks in the InfluxDB UI. - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str task_id: The ID of the task to label. (required) - :param LabelMapping label_mapping: An object that contains a _`labelID`_ to add to the task. (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_tasks_id_labels_prepare(task_id, label_mapping, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/tasks/{taskID}/labels', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='LabelResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_tasks_id_labels_prepare(self, task_id, label_mapping, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['task_id', 'label_mapping', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('post_tasks_id_labels', all_params, local_var_params) - # verify the required parameter 'task_id' is set - if ('task_id' not in local_var_params or - local_var_params['task_id'] is None): - raise ValueError("Missing the required parameter `task_id` when calling `post_tasks_id_labels`") # noqa: E501 - # verify the required parameter 'label_mapping' is set - if ('label_mapping' not in local_var_params or - local_var_params['label_mapping'] is None): - raise ValueError("Missing the required parameter `label_mapping` when calling `post_tasks_id_labels`") # noqa: E501 - - path_params = {} - if 'task_id' in local_var_params: - path_params['taskID'] = local_var_params['task_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'label_mapping' in local_var_params: - body_params = local_var_params['label_mapping'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_tasks_id_members(self, task_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - """Add a member to a task. - - **Deprecated**: Tasks don't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. Adds a user to members of a task and returns the member. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_tasks_id_members(task_id, add_resource_member_request_body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_id: The task ID. (required) - :param AddResourceMemberRequestBody add_resource_member_request_body: A user to add as a member of the task. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceMember - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_tasks_id_members_with_http_info(task_id, add_resource_member_request_body, **kwargs) # noqa: E501 - else: - (data) = self.post_tasks_id_members_with_http_info(task_id, add_resource_member_request_body, **kwargs) # noqa: E501 - return data - - def post_tasks_id_members_with_http_info(self, task_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - """Add a member to a task. - - **Deprecated**: Tasks don't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. Adds a user to members of a task and returns the member. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_tasks_id_members_with_http_info(task_id, add_resource_member_request_body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_id: The task ID. (required) - :param AddResourceMemberRequestBody add_resource_member_request_body: A user to add as a member of the task. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceMember - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_tasks_id_members_prepare(task_id, add_resource_member_request_body, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/tasks/{taskID}/members', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceMember', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_tasks_id_members_async(self, task_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - """Add a member to a task. - - **Deprecated**: Tasks don't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. Adds a user to members of a task and returns the member. - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str task_id: The task ID. (required) - :param AddResourceMemberRequestBody add_resource_member_request_body: A user to add as a member of the task. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceMember - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_tasks_id_members_prepare(task_id, add_resource_member_request_body, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/tasks/{taskID}/members', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceMember', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_tasks_id_members_prepare(self, task_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['task_id', 'add_resource_member_request_body', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('post_tasks_id_members', all_params, local_var_params) - # verify the required parameter 'task_id' is set - if ('task_id' not in local_var_params or - local_var_params['task_id'] is None): - raise ValueError("Missing the required parameter `task_id` when calling `post_tasks_id_members`") # noqa: E501 - # verify the required parameter 'add_resource_member_request_body' is set - if ('add_resource_member_request_body' not in local_var_params or - local_var_params['add_resource_member_request_body'] is None): - raise ValueError("Missing the required parameter `add_resource_member_request_body` when calling `post_tasks_id_members`") # noqa: E501 - - path_params = {} - if 'task_id' in local_var_params: - path_params['taskID'] = local_var_params['task_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'add_resource_member_request_body' in local_var_params: - body_params = local_var_params['add_resource_member_request_body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_tasks_id_owners(self, task_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - """Add an owner for a task. - - **Deprecated**: Tasks don't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. Assigns a task `owner` role to a user. Use this endpoint to create a _resource owner_ for the task. A _resource owner_ is a user with `role: owner` for a specific resource. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_tasks_id_owners(task_id, add_resource_member_request_body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_id: The task ID. (required) - :param AddResourceMemberRequestBody add_resource_member_request_body: A user to add as an owner of the task. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceOwner - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_tasks_id_owners_with_http_info(task_id, add_resource_member_request_body, **kwargs) # noqa: E501 - else: - (data) = self.post_tasks_id_owners_with_http_info(task_id, add_resource_member_request_body, **kwargs) # noqa: E501 - return data - - def post_tasks_id_owners_with_http_info(self, task_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - """Add an owner for a task. - - **Deprecated**: Tasks don't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. Assigns a task `owner` role to a user. Use this endpoint to create a _resource owner_ for the task. A _resource owner_ is a user with `role: owner` for a specific resource. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_tasks_id_owners_with_http_info(task_id, add_resource_member_request_body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_id: The task ID. (required) - :param AddResourceMemberRequestBody add_resource_member_request_body: A user to add as an owner of the task. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceOwner - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_tasks_id_owners_prepare(task_id, add_resource_member_request_body, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/tasks/{taskID}/owners', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceOwner', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_tasks_id_owners_async(self, task_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - """Add an owner for a task. - - **Deprecated**: Tasks don't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. Assigns a task `owner` role to a user. Use this endpoint to create a _resource owner_ for the task. A _resource owner_ is a user with `role: owner` for a specific resource. - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str task_id: The task ID. (required) - :param AddResourceMemberRequestBody add_resource_member_request_body: A user to add as an owner of the task. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceOwner - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_tasks_id_owners_prepare(task_id, add_resource_member_request_body, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/tasks/{taskID}/owners', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceOwner', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_tasks_id_owners_prepare(self, task_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['task_id', 'add_resource_member_request_body', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('post_tasks_id_owners', all_params, local_var_params) - # verify the required parameter 'task_id' is set - if ('task_id' not in local_var_params or - local_var_params['task_id'] is None): - raise ValueError("Missing the required parameter `task_id` when calling `post_tasks_id_owners`") # noqa: E501 - # verify the required parameter 'add_resource_member_request_body' is set - if ('add_resource_member_request_body' not in local_var_params or - local_var_params['add_resource_member_request_body'] is None): - raise ValueError("Missing the required parameter `add_resource_member_request_body` when calling `post_tasks_id_owners`") # noqa: E501 - - path_params = {} - if 'task_id' in local_var_params: - path_params['taskID'] = local_var_params['task_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'add_resource_member_request_body' in local_var_params: - body_params = local_var_params['add_resource_member_request_body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_tasks_id_runs(self, task_id, **kwargs): # noqa: E501,D401,D403 - """Start a task run, overriding the schedule. - - Schedules a task run to start immediately, ignoring scheduled runs. Use this endpoint to manually start a task run. Scheduled runs will continue to run as scheduled. This may result in concurrently running tasks. To _retry_ a previous run (and avoid creating a new run), use the [`POST /api/v2/tasks/{taskID}/runs/{runID}/retry` endpoint](#operation/PostTasksIDRunsIDRetry). - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_tasks_id_runs(task_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_id: (required) - :param str zap_trace_span: OpenTracing span context - :param RunManually run_manually: - :return: Run - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_tasks_id_runs_with_http_info(task_id, **kwargs) # noqa: E501 - else: - (data) = self.post_tasks_id_runs_with_http_info(task_id, **kwargs) # noqa: E501 - return data - - def post_tasks_id_runs_with_http_info(self, task_id, **kwargs): # noqa: E501,D401,D403 - """Start a task run, overriding the schedule. - - Schedules a task run to start immediately, ignoring scheduled runs. Use this endpoint to manually start a task run. Scheduled runs will continue to run as scheduled. This may result in concurrently running tasks. To _retry_ a previous run (and avoid creating a new run), use the [`POST /api/v2/tasks/{taskID}/runs/{runID}/retry` endpoint](#operation/PostTasksIDRunsIDRetry). - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_tasks_id_runs_with_http_info(task_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_id: (required) - :param str zap_trace_span: OpenTracing span context - :param RunManually run_manually: - :return: Run - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_tasks_id_runs_prepare(task_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/tasks/{taskID}/runs', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Run', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_tasks_id_runs_async(self, task_id, **kwargs): # noqa: E501,D401,D403 - """Start a task run, overriding the schedule. - - Schedules a task run to start immediately, ignoring scheduled runs. Use this endpoint to manually start a task run. Scheduled runs will continue to run as scheduled. This may result in concurrently running tasks. To _retry_ a previous run (and avoid creating a new run), use the [`POST /api/v2/tasks/{taskID}/runs/{runID}/retry` endpoint](#operation/PostTasksIDRunsIDRetry). - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str task_id: (required) - :param str zap_trace_span: OpenTracing span context - :param RunManually run_manually: - :return: Run - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_tasks_id_runs_prepare(task_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/tasks/{taskID}/runs', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Run', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_tasks_id_runs_prepare(self, task_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['task_id', 'zap_trace_span', 'run_manually'] # noqa: E501 - self._check_operation_params('post_tasks_id_runs', all_params, local_var_params) - # verify the required parameter 'task_id' is set - if ('task_id' not in local_var_params or - local_var_params['task_id'] is None): - raise ValueError("Missing the required parameter `task_id` when calling `post_tasks_id_runs`") # noqa: E501 - - path_params = {} - if 'task_id' in local_var_params: - path_params['taskID'] = local_var_params['task_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'run_manually' in local_var_params: - body_params = local_var_params['run_manually'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_tasks_id_runs_id_retry(self, task_id, run_id, **kwargs): # noqa: E501,D401,D403 - """Retry a task run. - - Queues a [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) run to retry and returns the scheduled run. To manually start a _new_ task run, use the [`POST /api/v2/tasks/{taskID}/runs` endpoint](#operation/PostTasksIDRuns). #### Limitations - The task must be _active_ (`status: "active"`). - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_tasks_id_runs_id_retry(task_id, run_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_id: A [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) ID. Specifies the task to retry. (required) - :param str run_id: A [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) run ID. Specifies the task run to retry. To find a task run ID, use the [`GET /api/v2/tasks/{taskID}/runs` endpoint](#operation/GetTasksIDRuns) to list task runs. (required) - :param str zap_trace_span: OpenTracing span context - :param str body: - :return: Run - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_tasks_id_runs_id_retry_with_http_info(task_id, run_id, **kwargs) # noqa: E501 - else: - (data) = self.post_tasks_id_runs_id_retry_with_http_info(task_id, run_id, **kwargs) # noqa: E501 - return data - - def post_tasks_id_runs_id_retry_with_http_info(self, task_id, run_id, **kwargs): # noqa: E501,D401,D403 - """Retry a task run. - - Queues a [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) run to retry and returns the scheduled run. To manually start a _new_ task run, use the [`POST /api/v2/tasks/{taskID}/runs` endpoint](#operation/PostTasksIDRuns). #### Limitations - The task must be _active_ (`status: "active"`). - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_tasks_id_runs_id_retry_with_http_info(task_id, run_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_id: A [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) ID. Specifies the task to retry. (required) - :param str run_id: A [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) run ID. Specifies the task run to retry. To find a task run ID, use the [`GET /api/v2/tasks/{taskID}/runs` endpoint](#operation/GetTasksIDRuns) to list task runs. (required) - :param str zap_trace_span: OpenTracing span context - :param str body: - :return: Run - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_tasks_id_runs_id_retry_prepare(task_id, run_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/tasks/{taskID}/runs/{runID}/retry', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Run', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_tasks_id_runs_id_retry_async(self, task_id, run_id, **kwargs): # noqa: E501,D401,D403 - """Retry a task run. - - Queues a [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) run to retry and returns the scheduled run. To manually start a _new_ task run, use the [`POST /api/v2/tasks/{taskID}/runs` endpoint](#operation/PostTasksIDRuns). #### Limitations - The task must be _active_ (`status: "active"`). - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str task_id: A [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) ID. Specifies the task to retry. (required) - :param str run_id: A [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) run ID. Specifies the task run to retry. To find a task run ID, use the [`GET /api/v2/tasks/{taskID}/runs` endpoint](#operation/GetTasksIDRuns) to list task runs. (required) - :param str zap_trace_span: OpenTracing span context - :param str body: - :return: Run - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_tasks_id_runs_id_retry_prepare(task_id, run_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/tasks/{taskID}/runs/{runID}/retry', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Run', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_tasks_id_runs_id_retry_prepare(self, task_id, run_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['task_id', 'run_id', 'zap_trace_span', 'body'] # noqa: E501 - self._check_operation_params('post_tasks_id_runs_id_retry', all_params, local_var_params) - # verify the required parameter 'task_id' is set - if ('task_id' not in local_var_params or - local_var_params['task_id'] is None): - raise ValueError("Missing the required parameter `task_id` when calling `post_tasks_id_runs_id_retry`") # noqa: E501 - # verify the required parameter 'run_id' is set - if ('run_id' not in local_var_params or - local_var_params['run_id'] is None): - raise ValueError("Missing the required parameter `run_id` when calling `post_tasks_id_runs_id_retry`") # noqa: E501 - - path_params = {} - if 'task_id' in local_var_params: - path_params['taskID'] = local_var_params['task_id'] # noqa: E501 - if 'run_id' in local_var_params: - path_params['runID'] = local_var_params['run_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=utf-8']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params diff --git a/frogpilot/third_party/influxdb_client/service/telegraf_plugins_service.py b/frogpilot/third_party/influxdb_client/service/telegraf_plugins_service.py deleted file mode 100644 index 905fdd34..00000000 --- a/frogpilot/third_party/influxdb_client/service/telegraf_plugins_service.py +++ /dev/null @@ -1,142 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -from influxdb_client.service._base_service import _BaseService - - -class TelegrafPluginsService(_BaseService): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): # noqa: E501,D401,D403 - """TelegrafPluginsService - a operation defined in OpenAPI.""" - super().__init__(api_client) - - def get_telegraf_plugins(self, **kwargs): # noqa: E501,D401,D403 - """List all Telegraf plugins. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_telegraf_plugins(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param str type: The type of plugin desired. - :return: TelegrafPlugins - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_telegraf_plugins_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_telegraf_plugins_with_http_info(**kwargs) # noqa: E501 - return data - - def get_telegraf_plugins_with_http_info(self, **kwargs): # noqa: E501,D401,D403 - """List all Telegraf plugins. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_telegraf_plugins_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param str type: The type of plugin desired. - :return: TelegrafPlugins - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_telegraf_plugins_prepare(**kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/telegraf/plugins', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='TelegrafPlugins', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_telegraf_plugins_async(self, **kwargs): # noqa: E501,D401,D403 - """List all Telegraf plugins. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param str type: The type of plugin desired. - :return: TelegrafPlugins - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_telegraf_plugins_prepare(**kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/telegraf/plugins', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='TelegrafPlugins', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_telegraf_plugins_prepare(self, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['zap_trace_span', 'type'] # noqa: E501 - self._check_operation_params('get_telegraf_plugins', all_params, local_var_params) - - path_params = {} - - query_params = [] - if 'type' in local_var_params: - query_params.append(('type', local_var_params['type'])) # noqa: E501 - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params diff --git a/frogpilot/third_party/influxdb_client/service/telegrafs_service.py b/frogpilot/third_party/influxdb_client/service/telegrafs_service.py deleted file mode 100644 index 4c3bfe9e..00000000 --- a/frogpilot/third_party/influxdb_client/service/telegrafs_service.py +++ /dev/null @@ -1,1738 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -from influxdb_client.service._base_service import _BaseService - - -class TelegrafsService(_BaseService): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): # noqa: E501,D401,D403 - """TelegrafsService - a operation defined in OpenAPI.""" - super().__init__(api_client) - - def delete_telegrafs_id(self, telegraf_id, **kwargs): # noqa: E501,D401,D403 - """Delete a Telegraf configuration. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_telegrafs_id(telegraf_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str telegraf_id: The Telegraf configuration ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_telegrafs_id_with_http_info(telegraf_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_telegrafs_id_with_http_info(telegraf_id, **kwargs) # noqa: E501 - return data - - def delete_telegrafs_id_with_http_info(self, telegraf_id, **kwargs): # noqa: E501,D401,D403 - """Delete a Telegraf configuration. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_telegrafs_id_with_http_info(telegraf_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str telegraf_id: The Telegraf configuration ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_telegrafs_id_prepare(telegraf_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/telegrafs/{telegrafID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def delete_telegrafs_id_async(self, telegraf_id, **kwargs): # noqa: E501,D401,D403 - """Delete a Telegraf configuration. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str telegraf_id: The Telegraf configuration ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_telegrafs_id_prepare(telegraf_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/telegrafs/{telegrafID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _delete_telegrafs_id_prepare(self, telegraf_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['telegraf_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('delete_telegrafs_id', all_params, local_var_params) - # verify the required parameter 'telegraf_id' is set - if ('telegraf_id' not in local_var_params or - local_var_params['telegraf_id'] is None): - raise ValueError("Missing the required parameter `telegraf_id` when calling `delete_telegrafs_id`") # noqa: E501 - - path_params = {} - if 'telegraf_id' in local_var_params: - path_params['telegrafID'] = local_var_params['telegraf_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def delete_telegrafs_id_labels_id(self, telegraf_id, label_id, **kwargs): # noqa: E501,D401,D403 - """Delete a label from a Telegraf config. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_telegrafs_id_labels_id(telegraf_id, label_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str telegraf_id: The Telegraf config ID. (required) - :param str label_id: The label ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_telegrafs_id_labels_id_with_http_info(telegraf_id, label_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_telegrafs_id_labels_id_with_http_info(telegraf_id, label_id, **kwargs) # noqa: E501 - return data - - def delete_telegrafs_id_labels_id_with_http_info(self, telegraf_id, label_id, **kwargs): # noqa: E501,D401,D403 - """Delete a label from a Telegraf config. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_telegrafs_id_labels_id_with_http_info(telegraf_id, label_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str telegraf_id: The Telegraf config ID. (required) - :param str label_id: The label ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_telegrafs_id_labels_id_prepare(telegraf_id, label_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/telegrafs/{telegrafID}/labels/{labelID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def delete_telegrafs_id_labels_id_async(self, telegraf_id, label_id, **kwargs): # noqa: E501,D401,D403 - """Delete a label from a Telegraf config. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str telegraf_id: The Telegraf config ID. (required) - :param str label_id: The label ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_telegrafs_id_labels_id_prepare(telegraf_id, label_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/telegrafs/{telegrafID}/labels/{labelID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _delete_telegrafs_id_labels_id_prepare(self, telegraf_id, label_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['telegraf_id', 'label_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('delete_telegrafs_id_labels_id', all_params, local_var_params) - # verify the required parameter 'telegraf_id' is set - if ('telegraf_id' not in local_var_params or - local_var_params['telegraf_id'] is None): - raise ValueError("Missing the required parameter `telegraf_id` when calling `delete_telegrafs_id_labels_id`") # noqa: E501 - # verify the required parameter 'label_id' is set - if ('label_id' not in local_var_params or - local_var_params['label_id'] is None): - raise ValueError("Missing the required parameter `label_id` when calling `delete_telegrafs_id_labels_id`") # noqa: E501 - - path_params = {} - if 'telegraf_id' in local_var_params: - path_params['telegrafID'] = local_var_params['telegraf_id'] # noqa: E501 - if 'label_id' in local_var_params: - path_params['labelID'] = local_var_params['label_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def delete_telegrafs_id_members_id(self, user_id, telegraf_id, **kwargs): # noqa: E501,D401,D403 - """Remove a member from a Telegraf config. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_telegrafs_id_members_id(user_id, telegraf_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_id: The ID of the member to remove. (required) - :param str telegraf_id: The Telegraf config ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_telegrafs_id_members_id_with_http_info(user_id, telegraf_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_telegrafs_id_members_id_with_http_info(user_id, telegraf_id, **kwargs) # noqa: E501 - return data - - def delete_telegrafs_id_members_id_with_http_info(self, user_id, telegraf_id, **kwargs): # noqa: E501,D401,D403 - """Remove a member from a Telegraf config. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_telegrafs_id_members_id_with_http_info(user_id, telegraf_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_id: The ID of the member to remove. (required) - :param str telegraf_id: The Telegraf config ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_telegrafs_id_members_id_prepare(user_id, telegraf_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/telegrafs/{telegrafID}/members/{userID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def delete_telegrafs_id_members_id_async(self, user_id, telegraf_id, **kwargs): # noqa: E501,D401,D403 - """Remove a member from a Telegraf config. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str user_id: The ID of the member to remove. (required) - :param str telegraf_id: The Telegraf config ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_telegrafs_id_members_id_prepare(user_id, telegraf_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/telegrafs/{telegrafID}/members/{userID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _delete_telegrafs_id_members_id_prepare(self, user_id, telegraf_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['user_id', 'telegraf_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('delete_telegrafs_id_members_id', all_params, local_var_params) - # verify the required parameter 'user_id' is set - if ('user_id' not in local_var_params or - local_var_params['user_id'] is None): - raise ValueError("Missing the required parameter `user_id` when calling `delete_telegrafs_id_members_id`") # noqa: E501 - # verify the required parameter 'telegraf_id' is set - if ('telegraf_id' not in local_var_params or - local_var_params['telegraf_id'] is None): - raise ValueError("Missing the required parameter `telegraf_id` when calling `delete_telegrafs_id_members_id`") # noqa: E501 - - path_params = {} - if 'user_id' in local_var_params: - path_params['userID'] = local_var_params['user_id'] # noqa: E501 - if 'telegraf_id' in local_var_params: - path_params['telegrafID'] = local_var_params['telegraf_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def delete_telegrafs_id_owners_id(self, user_id, telegraf_id, **kwargs): # noqa: E501,D401,D403 - """Remove an owner from a Telegraf config. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_telegrafs_id_owners_id(user_id, telegraf_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_id: The ID of the owner to remove. (required) - :param str telegraf_id: The Telegraf config ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_telegrafs_id_owners_id_with_http_info(user_id, telegraf_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_telegrafs_id_owners_id_with_http_info(user_id, telegraf_id, **kwargs) # noqa: E501 - return data - - def delete_telegrafs_id_owners_id_with_http_info(self, user_id, telegraf_id, **kwargs): # noqa: E501,D401,D403 - """Remove an owner from a Telegraf config. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_telegrafs_id_owners_id_with_http_info(user_id, telegraf_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_id: The ID of the owner to remove. (required) - :param str telegraf_id: The Telegraf config ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_telegrafs_id_owners_id_prepare(user_id, telegraf_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/telegrafs/{telegrafID}/owners/{userID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def delete_telegrafs_id_owners_id_async(self, user_id, telegraf_id, **kwargs): # noqa: E501,D401,D403 - """Remove an owner from a Telegraf config. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str user_id: The ID of the owner to remove. (required) - :param str telegraf_id: The Telegraf config ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_telegrafs_id_owners_id_prepare(user_id, telegraf_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/telegrafs/{telegrafID}/owners/{userID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _delete_telegrafs_id_owners_id_prepare(self, user_id, telegraf_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['user_id', 'telegraf_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('delete_telegrafs_id_owners_id', all_params, local_var_params) - # verify the required parameter 'user_id' is set - if ('user_id' not in local_var_params or - local_var_params['user_id'] is None): - raise ValueError("Missing the required parameter `user_id` when calling `delete_telegrafs_id_owners_id`") # noqa: E501 - # verify the required parameter 'telegraf_id' is set - if ('telegraf_id' not in local_var_params or - local_var_params['telegraf_id'] is None): - raise ValueError("Missing the required parameter `telegraf_id` when calling `delete_telegrafs_id_owners_id`") # noqa: E501 - - path_params = {} - if 'user_id' in local_var_params: - path_params['userID'] = local_var_params['user_id'] # noqa: E501 - if 'telegraf_id' in local_var_params: - path_params['telegrafID'] = local_var_params['telegraf_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_telegrafs(self, **kwargs): # noqa: E501,D401,D403 - """List all Telegraf configurations. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_telegrafs(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param str org_id: The organization ID the Telegraf config belongs to. - :return: Telegrafs - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_telegrafs_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_telegrafs_with_http_info(**kwargs) # noqa: E501 - return data - - def get_telegrafs_with_http_info(self, **kwargs): # noqa: E501,D401,D403 - """List all Telegraf configurations. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_telegrafs_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param str org_id: The organization ID the Telegraf config belongs to. - :return: Telegrafs - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_telegrafs_prepare(**kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/telegrafs', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Telegrafs', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_telegrafs_async(self, **kwargs): # noqa: E501,D401,D403 - """List all Telegraf configurations. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param str org_id: The organization ID the Telegraf config belongs to. - :return: Telegrafs - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_telegrafs_prepare(**kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/telegrafs', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Telegrafs', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_telegrafs_prepare(self, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['zap_trace_span', 'org_id'] # noqa: E501 - self._check_operation_params('get_telegrafs', all_params, local_var_params) - - path_params = {} - - query_params = [] - if 'org_id' in local_var_params: - query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501 - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_telegrafs_id(self, telegraf_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a Telegraf configuration. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_telegrafs_id(telegraf_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str telegraf_id: The Telegraf configuration ID. (required) - :param str zap_trace_span: OpenTracing span context - :param str accept: - :return: str - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_telegrafs_id_with_http_info(telegraf_id, **kwargs) # noqa: E501 - else: - (data) = self.get_telegrafs_id_with_http_info(telegraf_id, **kwargs) # noqa: E501 - return data - - def get_telegrafs_id_with_http_info(self, telegraf_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a Telegraf configuration. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_telegrafs_id_with_http_info(telegraf_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str telegraf_id: The Telegraf configuration ID. (required) - :param str zap_trace_span: OpenTracing span context - :param str accept: - :return: str - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_telegrafs_id_prepare(telegraf_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/telegrafs/{telegrafID}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='str', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_telegrafs_id_async(self, telegraf_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a Telegraf configuration. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str telegraf_id: The Telegraf configuration ID. (required) - :param str zap_trace_span: OpenTracing span context - :param str accept: - :return: str - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_telegrafs_id_prepare(telegraf_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/telegrafs/{telegrafID}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='str', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_telegrafs_id_prepare(self, telegraf_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['telegraf_id', 'zap_trace_span', 'accept'] # noqa: E501 - self._check_operation_params('get_telegrafs_id', all_params, local_var_params) - # verify the required parameter 'telegraf_id' is set - if ('telegraf_id' not in local_var_params or - local_var_params['telegraf_id'] is None): - raise ValueError("Missing the required parameter `telegraf_id` when calling `get_telegrafs_id`") # noqa: E501 - - path_params = {} - if 'telegraf_id' in local_var_params: - path_params['telegrafID'] = local_var_params['telegraf_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - if 'accept' in local_var_params: - header_params['Accept'] = local_var_params['accept'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/toml', 'application/json', 'application/octet-stream']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_telegrafs_id_labels(self, telegraf_id, **kwargs): # noqa: E501,D401,D403 - """List all labels for a Telegraf config. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_telegrafs_id_labels(telegraf_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str telegraf_id: The Telegraf config ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelsResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_telegrafs_id_labels_with_http_info(telegraf_id, **kwargs) # noqa: E501 - else: - (data) = self.get_telegrafs_id_labels_with_http_info(telegraf_id, **kwargs) # noqa: E501 - return data - - def get_telegrafs_id_labels_with_http_info(self, telegraf_id, **kwargs): # noqa: E501,D401,D403 - """List all labels for a Telegraf config. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_telegrafs_id_labels_with_http_info(telegraf_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str telegraf_id: The Telegraf config ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelsResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_telegrafs_id_labels_prepare(telegraf_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/telegrafs/{telegrafID}/labels', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='LabelsResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_telegrafs_id_labels_async(self, telegraf_id, **kwargs): # noqa: E501,D401,D403 - """List all labels for a Telegraf config. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str telegraf_id: The Telegraf config ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelsResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_telegrafs_id_labels_prepare(telegraf_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/telegrafs/{telegrafID}/labels', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='LabelsResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_telegrafs_id_labels_prepare(self, telegraf_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['telegraf_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_telegrafs_id_labels', all_params, local_var_params) - # verify the required parameter 'telegraf_id' is set - if ('telegraf_id' not in local_var_params or - local_var_params['telegraf_id'] is None): - raise ValueError("Missing the required parameter `telegraf_id` when calling `get_telegrafs_id_labels`") # noqa: E501 - - path_params = {} - if 'telegraf_id' in local_var_params: - path_params['telegrafID'] = local_var_params['telegraf_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_telegrafs_id_members(self, telegraf_id, **kwargs): # noqa: E501,D401,D403 - """List all users with member privileges for a Telegraf config. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_telegrafs_id_members(telegraf_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str telegraf_id: The Telegraf config ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceMembers - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_telegrafs_id_members_with_http_info(telegraf_id, **kwargs) # noqa: E501 - else: - (data) = self.get_telegrafs_id_members_with_http_info(telegraf_id, **kwargs) # noqa: E501 - return data - - def get_telegrafs_id_members_with_http_info(self, telegraf_id, **kwargs): # noqa: E501,D401,D403 - """List all users with member privileges for a Telegraf config. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_telegrafs_id_members_with_http_info(telegraf_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str telegraf_id: The Telegraf config ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceMembers - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_telegrafs_id_members_prepare(telegraf_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/telegrafs/{telegrafID}/members', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceMembers', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_telegrafs_id_members_async(self, telegraf_id, **kwargs): # noqa: E501,D401,D403 - """List all users with member privileges for a Telegraf config. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str telegraf_id: The Telegraf config ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceMembers - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_telegrafs_id_members_prepare(telegraf_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/telegrafs/{telegrafID}/members', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceMembers', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_telegrafs_id_members_prepare(self, telegraf_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['telegraf_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_telegrafs_id_members', all_params, local_var_params) - # verify the required parameter 'telegraf_id' is set - if ('telegraf_id' not in local_var_params or - local_var_params['telegraf_id'] is None): - raise ValueError("Missing the required parameter `telegraf_id` when calling `get_telegrafs_id_members`") # noqa: E501 - - path_params = {} - if 'telegraf_id' in local_var_params: - path_params['telegrafID'] = local_var_params['telegraf_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_telegrafs_id_owners(self, telegraf_id, **kwargs): # noqa: E501,D401,D403 - """List all owners of a Telegraf configuration. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_telegrafs_id_owners(telegraf_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str telegraf_id: The Telegraf configuration ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceOwners - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_telegrafs_id_owners_with_http_info(telegraf_id, **kwargs) # noqa: E501 - else: - (data) = self.get_telegrafs_id_owners_with_http_info(telegraf_id, **kwargs) # noqa: E501 - return data - - def get_telegrafs_id_owners_with_http_info(self, telegraf_id, **kwargs): # noqa: E501,D401,D403 - """List all owners of a Telegraf configuration. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_telegrafs_id_owners_with_http_info(telegraf_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str telegraf_id: The Telegraf configuration ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceOwners - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_telegrafs_id_owners_prepare(telegraf_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/telegrafs/{telegrafID}/owners', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceOwners', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_telegrafs_id_owners_async(self, telegraf_id, **kwargs): # noqa: E501,D401,D403 - """List all owners of a Telegraf configuration. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str telegraf_id: The Telegraf configuration ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceOwners - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_telegrafs_id_owners_prepare(telegraf_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/telegrafs/{telegrafID}/owners', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceOwners', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_telegrafs_id_owners_prepare(self, telegraf_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['telegraf_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_telegrafs_id_owners', all_params, local_var_params) - # verify the required parameter 'telegraf_id' is set - if ('telegraf_id' not in local_var_params or - local_var_params['telegraf_id'] is None): - raise ValueError("Missing the required parameter `telegraf_id` when calling `get_telegrafs_id_owners`") # noqa: E501 - - path_params = {} - if 'telegraf_id' in local_var_params: - path_params['telegrafID'] = local_var_params['telegraf_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_telegrafs(self, telegraf_plugin_request, **kwargs): # noqa: E501,D401,D403 - """Create a Telegraf configuration. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_telegrafs(telegraf_plugin_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TelegrafPluginRequest telegraf_plugin_request: Telegraf configuration to create (required) - :param str zap_trace_span: OpenTracing span context - :return: Telegraf - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_telegrafs_with_http_info(telegraf_plugin_request, **kwargs) # noqa: E501 - else: - (data) = self.post_telegrafs_with_http_info(telegraf_plugin_request, **kwargs) # noqa: E501 - return data - - def post_telegrafs_with_http_info(self, telegraf_plugin_request, **kwargs): # noqa: E501,D401,D403 - """Create a Telegraf configuration. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_telegrafs_with_http_info(telegraf_plugin_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TelegrafPluginRequest telegraf_plugin_request: Telegraf configuration to create (required) - :param str zap_trace_span: OpenTracing span context - :return: Telegraf - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_telegrafs_prepare(telegraf_plugin_request, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/telegrafs', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Telegraf', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_telegrafs_async(self, telegraf_plugin_request, **kwargs): # noqa: E501,D401,D403 - """Create a Telegraf configuration. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param TelegrafPluginRequest telegraf_plugin_request: Telegraf configuration to create (required) - :param str zap_trace_span: OpenTracing span context - :return: Telegraf - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_telegrafs_prepare(telegraf_plugin_request, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/telegrafs', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Telegraf', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_telegrafs_prepare(self, telegraf_plugin_request, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['telegraf_plugin_request', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('post_telegrafs', all_params, local_var_params) - # verify the required parameter 'telegraf_plugin_request' is set - if ('telegraf_plugin_request' not in local_var_params or - local_var_params['telegraf_plugin_request'] is None): - raise ValueError("Missing the required parameter `telegraf_plugin_request` when calling `post_telegrafs`") # noqa: E501 - - path_params = {} - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'telegraf_plugin_request' in local_var_params: - body_params = local_var_params['telegraf_plugin_request'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_telegrafs_id_labels(self, telegraf_id, label_mapping, **kwargs): # noqa: E501,D401,D403 - """Add a label to a Telegraf config. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_telegrafs_id_labels(telegraf_id, label_mapping, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str telegraf_id: The Telegraf config ID. (required) - :param LabelMapping label_mapping: Label to add (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_telegrafs_id_labels_with_http_info(telegraf_id, label_mapping, **kwargs) # noqa: E501 - else: - (data) = self.post_telegrafs_id_labels_with_http_info(telegraf_id, label_mapping, **kwargs) # noqa: E501 - return data - - def post_telegrafs_id_labels_with_http_info(self, telegraf_id, label_mapping, **kwargs): # noqa: E501,D401,D403 - """Add a label to a Telegraf config. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_telegrafs_id_labels_with_http_info(telegraf_id, label_mapping, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str telegraf_id: The Telegraf config ID. (required) - :param LabelMapping label_mapping: Label to add (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_telegrafs_id_labels_prepare(telegraf_id, label_mapping, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/telegrafs/{telegrafID}/labels', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='LabelResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_telegrafs_id_labels_async(self, telegraf_id, label_mapping, **kwargs): # noqa: E501,D401,D403 - """Add a label to a Telegraf config. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str telegraf_id: The Telegraf config ID. (required) - :param LabelMapping label_mapping: Label to add (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_telegrafs_id_labels_prepare(telegraf_id, label_mapping, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/telegrafs/{telegrafID}/labels', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='LabelResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_telegrafs_id_labels_prepare(self, telegraf_id, label_mapping, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['telegraf_id', 'label_mapping', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('post_telegrafs_id_labels', all_params, local_var_params) - # verify the required parameter 'telegraf_id' is set - if ('telegraf_id' not in local_var_params or - local_var_params['telegraf_id'] is None): - raise ValueError("Missing the required parameter `telegraf_id` when calling `post_telegrafs_id_labels`") # noqa: E501 - # verify the required parameter 'label_mapping' is set - if ('label_mapping' not in local_var_params or - local_var_params['label_mapping'] is None): - raise ValueError("Missing the required parameter `label_mapping` when calling `post_telegrafs_id_labels`") # noqa: E501 - - path_params = {} - if 'telegraf_id' in local_var_params: - path_params['telegrafID'] = local_var_params['telegraf_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'label_mapping' in local_var_params: - body_params = local_var_params['label_mapping'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_telegrafs_id_members(self, telegraf_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - """Add a member to a Telegraf config. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_telegrafs_id_members(telegraf_id, add_resource_member_request_body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str telegraf_id: The Telegraf config ID. (required) - :param AddResourceMemberRequestBody add_resource_member_request_body: User to add as member (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceMember - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_telegrafs_id_members_with_http_info(telegraf_id, add_resource_member_request_body, **kwargs) # noqa: E501 - else: - (data) = self.post_telegrafs_id_members_with_http_info(telegraf_id, add_resource_member_request_body, **kwargs) # noqa: E501 - return data - - def post_telegrafs_id_members_with_http_info(self, telegraf_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - """Add a member to a Telegraf config. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_telegrafs_id_members_with_http_info(telegraf_id, add_resource_member_request_body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str telegraf_id: The Telegraf config ID. (required) - :param AddResourceMemberRequestBody add_resource_member_request_body: User to add as member (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceMember - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_telegrafs_id_members_prepare(telegraf_id, add_resource_member_request_body, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/telegrafs/{telegrafID}/members', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceMember', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_telegrafs_id_members_async(self, telegraf_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - """Add a member to a Telegraf config. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str telegraf_id: The Telegraf config ID. (required) - :param AddResourceMemberRequestBody add_resource_member_request_body: User to add as member (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceMember - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_telegrafs_id_members_prepare(telegraf_id, add_resource_member_request_body, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/telegrafs/{telegrafID}/members', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceMember', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_telegrafs_id_members_prepare(self, telegraf_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['telegraf_id', 'add_resource_member_request_body', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('post_telegrafs_id_members', all_params, local_var_params) - # verify the required parameter 'telegraf_id' is set - if ('telegraf_id' not in local_var_params or - local_var_params['telegraf_id'] is None): - raise ValueError("Missing the required parameter `telegraf_id` when calling `post_telegrafs_id_members`") # noqa: E501 - # verify the required parameter 'add_resource_member_request_body' is set - if ('add_resource_member_request_body' not in local_var_params or - local_var_params['add_resource_member_request_body'] is None): - raise ValueError("Missing the required parameter `add_resource_member_request_body` when calling `post_telegrafs_id_members`") # noqa: E501 - - path_params = {} - if 'telegraf_id' in local_var_params: - path_params['telegrafID'] = local_var_params['telegraf_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'add_resource_member_request_body' in local_var_params: - body_params = local_var_params['add_resource_member_request_body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_telegrafs_id_owners(self, telegraf_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - """Add an owner to a Telegraf configuration. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_telegrafs_id_owners(telegraf_id, add_resource_member_request_body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str telegraf_id: The Telegraf configuration ID. (required) - :param AddResourceMemberRequestBody add_resource_member_request_body: User to add as owner (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceOwner - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_telegrafs_id_owners_with_http_info(telegraf_id, add_resource_member_request_body, **kwargs) # noqa: E501 - else: - (data) = self.post_telegrafs_id_owners_with_http_info(telegraf_id, add_resource_member_request_body, **kwargs) # noqa: E501 - return data - - def post_telegrafs_id_owners_with_http_info(self, telegraf_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - """Add an owner to a Telegraf configuration. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_telegrafs_id_owners_with_http_info(telegraf_id, add_resource_member_request_body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str telegraf_id: The Telegraf configuration ID. (required) - :param AddResourceMemberRequestBody add_resource_member_request_body: User to add as owner (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceOwner - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_telegrafs_id_owners_prepare(telegraf_id, add_resource_member_request_body, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/telegrafs/{telegrafID}/owners', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceOwner', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_telegrafs_id_owners_async(self, telegraf_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - """Add an owner to a Telegraf configuration. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str telegraf_id: The Telegraf configuration ID. (required) - :param AddResourceMemberRequestBody add_resource_member_request_body: User to add as owner (required) - :param str zap_trace_span: OpenTracing span context - :return: ResourceOwner - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_telegrafs_id_owners_prepare(telegraf_id, add_resource_member_request_body, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/telegrafs/{telegrafID}/owners', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ResourceOwner', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_telegrafs_id_owners_prepare(self, telegraf_id, add_resource_member_request_body, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['telegraf_id', 'add_resource_member_request_body', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('post_telegrafs_id_owners', all_params, local_var_params) - # verify the required parameter 'telegraf_id' is set - if ('telegraf_id' not in local_var_params or - local_var_params['telegraf_id'] is None): - raise ValueError("Missing the required parameter `telegraf_id` when calling `post_telegrafs_id_owners`") # noqa: E501 - # verify the required parameter 'add_resource_member_request_body' is set - if ('add_resource_member_request_body' not in local_var_params or - local_var_params['add_resource_member_request_body'] is None): - raise ValueError("Missing the required parameter `add_resource_member_request_body` when calling `post_telegrafs_id_owners`") # noqa: E501 - - path_params = {} - if 'telegraf_id' in local_var_params: - path_params['telegrafID'] = local_var_params['telegraf_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'add_resource_member_request_body' in local_var_params: - body_params = local_var_params['add_resource_member_request_body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def put_telegrafs_id(self, telegraf_id, telegraf_plugin_request, **kwargs): # noqa: E501,D401,D403 - """Update a Telegraf configuration. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.put_telegrafs_id(telegraf_id, telegraf_plugin_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str telegraf_id: The Telegraf config ID. (required) - :param TelegrafPluginRequest telegraf_plugin_request: Telegraf configuration update to apply (required) - :param str zap_trace_span: OpenTracing span context - :return: Telegraf - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.put_telegrafs_id_with_http_info(telegraf_id, telegraf_plugin_request, **kwargs) # noqa: E501 - else: - (data) = self.put_telegrafs_id_with_http_info(telegraf_id, telegraf_plugin_request, **kwargs) # noqa: E501 - return data - - def put_telegrafs_id_with_http_info(self, telegraf_id, telegraf_plugin_request, **kwargs): # noqa: E501,D401,D403 - """Update a Telegraf configuration. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.put_telegrafs_id_with_http_info(telegraf_id, telegraf_plugin_request, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str telegraf_id: The Telegraf config ID. (required) - :param TelegrafPluginRequest telegraf_plugin_request: Telegraf configuration update to apply (required) - :param str zap_trace_span: OpenTracing span context - :return: Telegraf - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._put_telegrafs_id_prepare(telegraf_id, telegraf_plugin_request, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/telegrafs/{telegrafID}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Telegraf', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def put_telegrafs_id_async(self, telegraf_id, telegraf_plugin_request, **kwargs): # noqa: E501,D401,D403 - """Update a Telegraf configuration. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str telegraf_id: The Telegraf config ID. (required) - :param TelegrafPluginRequest telegraf_plugin_request: Telegraf configuration update to apply (required) - :param str zap_trace_span: OpenTracing span context - :return: Telegraf - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._put_telegrafs_id_prepare(telegraf_id, telegraf_plugin_request, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/telegrafs/{telegrafID}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Telegraf', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _put_telegrafs_id_prepare(self, telegraf_id, telegraf_plugin_request, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['telegraf_id', 'telegraf_plugin_request', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('put_telegrafs_id', all_params, local_var_params) - # verify the required parameter 'telegraf_id' is set - if ('telegraf_id' not in local_var_params or - local_var_params['telegraf_id'] is None): - raise ValueError("Missing the required parameter `telegraf_id` when calling `put_telegrafs_id`") # noqa: E501 - # verify the required parameter 'telegraf_plugin_request' is set - if ('telegraf_plugin_request' not in local_var_params or - local_var_params['telegraf_plugin_request'] is None): - raise ValueError("Missing the required parameter `telegraf_plugin_request` when calling `put_telegrafs_id`") # noqa: E501 - - path_params = {} - if 'telegraf_id' in local_var_params: - path_params['telegrafID'] = local_var_params['telegraf_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'telegraf_plugin_request' in local_var_params: - body_params = local_var_params['telegraf_plugin_request'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params diff --git a/frogpilot/third_party/influxdb_client/service/templates_service.py b/frogpilot/third_party/influxdb_client/service/templates_service.py deleted file mode 100644 index 92780a0c..00000000 --- a/frogpilot/third_party/influxdb_client/service/templates_service.py +++ /dev/null @@ -1,959 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -from influxdb_client.service._base_service import _BaseService - - -class TemplatesService(_BaseService): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): # noqa: E501,D401,D403 - """TemplatesService - a operation defined in OpenAPI.""" - super().__init__(api_client) - - def apply_template(self, template_apply, **kwargs): # noqa: E501,D401,D403 - """Apply or dry-run a template. - - Applies a template to create or update a [stack](https://docs.influxdata.com/influxdb/latest/influxdb-templates/stacks/) of InfluxDB [resources](https://docs.influxdata.com/influxdb/latest/reference/cli/influx/export/all/#resources). The response contains the diff of changes and the stack ID. Use this endpoint to install an InfluxDB template to an organization. Provide template URLs or template objects in your request. To customize which template resources are installed, use the `actions` parameter. By default, when you apply a template, InfluxDB installs the template to create and update stack resources and then generates a diff of the changes. If you pass `dryRun: true` in the request body, InfluxDB validates the template and generates the resource diff, but doesn’t make any changes to your instance. #### Custom values for templates - Some templates may contain [environment references](https://docs.influxdata.com/influxdb/latest/influxdb-templates/create/#include-user-definable-resource-names) for custom metadata. To provide custom values for environment references, pass the _`envRefs`_ property in the request body. For more information and examples, see how to [define environment references](https://docs.influxdata.com/influxdb/latest/influxdb-templates/use/#define-environment-references). - Some templates may contain queries that use [secrets](https://docs.influxdata.com/influxdb/latest/security/secrets/). To provide custom secret values, pass the _`secrets`_ property in the request body. Don't expose secret values in templates. For more information, see [how to pass secrets when installing a template](https://docs.influxdata.com/influxdb/latest/influxdb-templates/use/#pass-secrets-when-installing-a-template). #### Required permissions - `write` permissions for resource types in the template. #### Rate limits (with InfluxDB Cloud) - Adjustable service quotas apply. For more information, see [limits and adjustable quotas](https://docs.influxdata.com/influxdb/cloud/account-management/limits/). #### Related guides - [Use templates](https://docs.influxdata.com/influxdb/latest/influxdb-templates/use/) - [Stacks](https://docs.influxdata.com/influxdb/latest/influxdb-templates/stacks/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.apply_template(template_apply, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TemplateApply template_apply: Parameters for applying templates. (required) - :return: TemplateSummary - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.apply_template_with_http_info(template_apply, **kwargs) # noqa: E501 - else: - (data) = self.apply_template_with_http_info(template_apply, **kwargs) # noqa: E501 - return data - - def apply_template_with_http_info(self, template_apply, **kwargs): # noqa: E501,D401,D403 - """Apply or dry-run a template. - - Applies a template to create or update a [stack](https://docs.influxdata.com/influxdb/latest/influxdb-templates/stacks/) of InfluxDB [resources](https://docs.influxdata.com/influxdb/latest/reference/cli/influx/export/all/#resources). The response contains the diff of changes and the stack ID. Use this endpoint to install an InfluxDB template to an organization. Provide template URLs or template objects in your request. To customize which template resources are installed, use the `actions` parameter. By default, when you apply a template, InfluxDB installs the template to create and update stack resources and then generates a diff of the changes. If you pass `dryRun: true` in the request body, InfluxDB validates the template and generates the resource diff, but doesn’t make any changes to your instance. #### Custom values for templates - Some templates may contain [environment references](https://docs.influxdata.com/influxdb/latest/influxdb-templates/create/#include-user-definable-resource-names) for custom metadata. To provide custom values for environment references, pass the _`envRefs`_ property in the request body. For more information and examples, see how to [define environment references](https://docs.influxdata.com/influxdb/latest/influxdb-templates/use/#define-environment-references). - Some templates may contain queries that use [secrets](https://docs.influxdata.com/influxdb/latest/security/secrets/). To provide custom secret values, pass the _`secrets`_ property in the request body. Don't expose secret values in templates. For more information, see [how to pass secrets when installing a template](https://docs.influxdata.com/influxdb/latest/influxdb-templates/use/#pass-secrets-when-installing-a-template). #### Required permissions - `write` permissions for resource types in the template. #### Rate limits (with InfluxDB Cloud) - Adjustable service quotas apply. For more information, see [limits and adjustable quotas](https://docs.influxdata.com/influxdb/cloud/account-management/limits/). #### Related guides - [Use templates](https://docs.influxdata.com/influxdb/latest/influxdb-templates/use/) - [Stacks](https://docs.influxdata.com/influxdb/latest/influxdb-templates/stacks/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.apply_template_with_http_info(template_apply, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TemplateApply template_apply: Parameters for applying templates. (required) - :return: TemplateSummary - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._apply_template_prepare(template_apply, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/templates/apply', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='TemplateSummary', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def apply_template_async(self, template_apply, **kwargs): # noqa: E501,D401,D403 - """Apply or dry-run a template. - - Applies a template to create or update a [stack](https://docs.influxdata.com/influxdb/latest/influxdb-templates/stacks/) of InfluxDB [resources](https://docs.influxdata.com/influxdb/latest/reference/cli/influx/export/all/#resources). The response contains the diff of changes and the stack ID. Use this endpoint to install an InfluxDB template to an organization. Provide template URLs or template objects in your request. To customize which template resources are installed, use the `actions` parameter. By default, when you apply a template, InfluxDB installs the template to create and update stack resources and then generates a diff of the changes. If you pass `dryRun: true` in the request body, InfluxDB validates the template and generates the resource diff, but doesn’t make any changes to your instance. #### Custom values for templates - Some templates may contain [environment references](https://docs.influxdata.com/influxdb/latest/influxdb-templates/create/#include-user-definable-resource-names) for custom metadata. To provide custom values for environment references, pass the _`envRefs`_ property in the request body. For more information and examples, see how to [define environment references](https://docs.influxdata.com/influxdb/latest/influxdb-templates/use/#define-environment-references). - Some templates may contain queries that use [secrets](https://docs.influxdata.com/influxdb/latest/security/secrets/). To provide custom secret values, pass the _`secrets`_ property in the request body. Don't expose secret values in templates. For more information, see [how to pass secrets when installing a template](https://docs.influxdata.com/influxdb/latest/influxdb-templates/use/#pass-secrets-when-installing-a-template). #### Required permissions - `write` permissions for resource types in the template. #### Rate limits (with InfluxDB Cloud) - Adjustable service quotas apply. For more information, see [limits and adjustable quotas](https://docs.influxdata.com/influxdb/cloud/account-management/limits/). #### Related guides - [Use templates](https://docs.influxdata.com/influxdb/latest/influxdb-templates/use/) - [Stacks](https://docs.influxdata.com/influxdb/latest/influxdb-templates/stacks/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param TemplateApply template_apply: Parameters for applying templates. (required) - :return: TemplateSummary - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._apply_template_prepare(template_apply, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/templates/apply', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='TemplateSummary', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _apply_template_prepare(self, template_apply, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['template_apply'] # noqa: E501 - self._check_operation_params('apply_template', all_params, local_var_params) - # verify the required parameter 'template_apply' is set - if ('template_apply' not in local_var_params or - local_var_params['template_apply'] is None): - raise ValueError("Missing the required parameter `template_apply` when calling `apply_template`") # noqa: E501 - - path_params = {} - - query_params = [] - - header_params = {} - - body_params = None - if 'template_apply' in local_var_params: - body_params = local_var_params['template_apply'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json', 'application/x-jsonnet', 'text/yml']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def create_stack(self, **kwargs): # noqa: E501,D401,D403 - """Create a stack. - - Creates or initializes a stack. Use this endpoint to _manually_ initialize a new stack with the following optional information: - Stack name - Stack description - URLs for template manifest files To automatically create a stack when applying templates, use the [/api/v2/templates/apply endpoint](#operation/ApplyTemplate). #### Required permissions - `write` permission for the organization #### Related guides - [Initialize an InfluxDB stack](https://docs.influxdata.com/influxdb/latest/influxdb-templates/stacks/init/). - [Use InfluxDB templates](https://docs.influxdata.com/influxdb/latest/influxdb-templates/use/#apply-templates-to-an-influxdb-instance). - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_stack(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param PostStackRequest post_stack_request: - :return: Stack - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_stack_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.create_stack_with_http_info(**kwargs) # noqa: E501 - return data - - def create_stack_with_http_info(self, **kwargs): # noqa: E501,D401,D403 - """Create a stack. - - Creates or initializes a stack. Use this endpoint to _manually_ initialize a new stack with the following optional information: - Stack name - Stack description - URLs for template manifest files To automatically create a stack when applying templates, use the [/api/v2/templates/apply endpoint](#operation/ApplyTemplate). #### Required permissions - `write` permission for the organization #### Related guides - [Initialize an InfluxDB stack](https://docs.influxdata.com/influxdb/latest/influxdb-templates/stacks/init/). - [Use InfluxDB templates](https://docs.influxdata.com/influxdb/latest/influxdb-templates/use/#apply-templates-to-an-influxdb-instance). - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_stack_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param PostStackRequest post_stack_request: - :return: Stack - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._create_stack_prepare(**kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/stacks', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Stack', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def create_stack_async(self, **kwargs): # noqa: E501,D401,D403 - """Create a stack. - - Creates or initializes a stack. Use this endpoint to _manually_ initialize a new stack with the following optional information: - Stack name - Stack description - URLs for template manifest files To automatically create a stack when applying templates, use the [/api/v2/templates/apply endpoint](#operation/ApplyTemplate). #### Required permissions - `write` permission for the organization #### Related guides - [Initialize an InfluxDB stack](https://docs.influxdata.com/influxdb/latest/influxdb-templates/stacks/init/). - [Use InfluxDB templates](https://docs.influxdata.com/influxdb/latest/influxdb-templates/use/#apply-templates-to-an-influxdb-instance). - This method makes an asynchronous HTTP request. - - :param async_req bool - :param PostStackRequest post_stack_request: - :return: Stack - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._create_stack_prepare(**kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/stacks', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Stack', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _create_stack_prepare(self, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['post_stack_request'] # noqa: E501 - self._check_operation_params('create_stack', all_params, local_var_params) - - path_params = {} - - query_params = [] - - header_params = {} - - body_params = None - if 'post_stack_request' in local_var_params: - body_params = local_var_params['post_stack_request'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def delete_stack(self, stack_id, org_id, **kwargs): # noqa: E501,D401,D403 - """Delete a stack and associated resources. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_stack(stack_id, org_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str stack_id: The identifier of the stack. (required) - :param str org_id: The identifier of the organization. (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_stack_with_http_info(stack_id, org_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_stack_with_http_info(stack_id, org_id, **kwargs) # noqa: E501 - return data - - def delete_stack_with_http_info(self, stack_id, org_id, **kwargs): # noqa: E501,D401,D403 - """Delete a stack and associated resources. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_stack_with_http_info(stack_id, org_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str stack_id: The identifier of the stack. (required) - :param str org_id: The identifier of the organization. (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_stack_prepare(stack_id, org_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/stacks/{stack_id}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def delete_stack_async(self, stack_id, org_id, **kwargs): # noqa: E501,D401,D403 - """Delete a stack and associated resources. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str stack_id: The identifier of the stack. (required) - :param str org_id: The identifier of the organization. (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_stack_prepare(stack_id, org_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/stacks/{stack_id}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _delete_stack_prepare(self, stack_id, org_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['stack_id', 'org_id'] # noqa: E501 - self._check_operation_params('delete_stack', all_params, local_var_params) - # verify the required parameter 'stack_id' is set - if ('stack_id' not in local_var_params or - local_var_params['stack_id'] is None): - raise ValueError("Missing the required parameter `stack_id` when calling `delete_stack`") # noqa: E501 - # verify the required parameter 'org_id' is set - if ('org_id' not in local_var_params or - local_var_params['org_id'] is None): - raise ValueError("Missing the required parameter `org_id` when calling `delete_stack`") # noqa: E501 - - path_params = {} - if 'stack_id' in local_var_params: - path_params['stack_id'] = local_var_params['stack_id'] # noqa: E501 - - query_params = [] - if 'org_id' in local_var_params: - query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501 - - header_params = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def export_template(self, **kwargs): # noqa: E501,D401,D403 - """Export a new template. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.export_template(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TemplateExportByID template_export_by_id: Export resources as an InfluxDB template. - :return: list[object] - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.export_template_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.export_template_with_http_info(**kwargs) # noqa: E501 - return data - - def export_template_with_http_info(self, **kwargs): # noqa: E501,D401,D403 - """Export a new template. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.export_template_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TemplateExportByID template_export_by_id: Export resources as an InfluxDB template. - :return: list[object] - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._export_template_prepare(**kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/templates/export', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='list[object]', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def export_template_async(self, **kwargs): # noqa: E501,D401,D403 - """Export a new template. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param TemplateExportByID template_export_by_id: Export resources as an InfluxDB template. - :return: list[object] - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._export_template_prepare(**kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/templates/export', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='list[object]', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _export_template_prepare(self, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['template_export_by_id'] # noqa: E501 - self._check_operation_params('export_template', all_params, local_var_params) - - path_params = {} - - query_params = [] - - header_params = {} - - body_params = None - if 'template_export_by_id' in local_var_params: - body_params = local_var_params['template_export_by_id'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/x-yaml']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def list_stacks(self, org_id, **kwargs): # noqa: E501,D401,D403 - """List installed stacks. - - Lists installed InfluxDB stacks. To limit stacks in the response, pass query parameters in your request. If no query parameters are passed, InfluxDB returns all installed stacks for the organization. #### Related guides - [View InfluxDB stacks](https://docs.influxdata.com/influxdb/latest/influxdb-templates/stacks/). - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_stacks(org_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str org_id: An organization ID. Only returns stacks owned by the specified [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization). #### InfluxDB Cloud - Doesn't require this parameter; InfluxDB only returns resources allowed by the API token. (required) - :param str name: A stack name. Finds stack `events` with this name and returns the stacks. Repeatable. To filter for more than one stack name, repeat this parameter with each name--for example: - `INFLUX_URL/api/v2/stacks?&orgID=INFLUX_ORG_ID&name=project-stack-0&name=project-stack-1` - :param str stack_id: A stack ID. Only returns the specified stack. Repeatable. To filter for more than one stack ID, repeat this parameter with each ID--for example: - `INFLUX_URL/api/v2/stacks?&orgID=INFLUX_ORG_ID&stackID=09bd87cd33be3000&stackID=09bef35081fe3000` - :return: ListStacksResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.list_stacks_with_http_info(org_id, **kwargs) # noqa: E501 - else: - (data) = self.list_stacks_with_http_info(org_id, **kwargs) # noqa: E501 - return data - - def list_stacks_with_http_info(self, org_id, **kwargs): # noqa: E501,D401,D403 - """List installed stacks. - - Lists installed InfluxDB stacks. To limit stacks in the response, pass query parameters in your request. If no query parameters are passed, InfluxDB returns all installed stacks for the organization. #### Related guides - [View InfluxDB stacks](https://docs.influxdata.com/influxdb/latest/influxdb-templates/stacks/). - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_stacks_with_http_info(org_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str org_id: An organization ID. Only returns stacks owned by the specified [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization). #### InfluxDB Cloud - Doesn't require this parameter; InfluxDB only returns resources allowed by the API token. (required) - :param str name: A stack name. Finds stack `events` with this name and returns the stacks. Repeatable. To filter for more than one stack name, repeat this parameter with each name--for example: - `INFLUX_URL/api/v2/stacks?&orgID=INFLUX_ORG_ID&name=project-stack-0&name=project-stack-1` - :param str stack_id: A stack ID. Only returns the specified stack. Repeatable. To filter for more than one stack ID, repeat this parameter with each ID--for example: - `INFLUX_URL/api/v2/stacks?&orgID=INFLUX_ORG_ID&stackID=09bd87cd33be3000&stackID=09bef35081fe3000` - :return: ListStacksResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._list_stacks_prepare(org_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/stacks', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ListStacksResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def list_stacks_async(self, org_id, **kwargs): # noqa: E501,D401,D403 - """List installed stacks. - - Lists installed InfluxDB stacks. To limit stacks in the response, pass query parameters in your request. If no query parameters are passed, InfluxDB returns all installed stacks for the organization. #### Related guides - [View InfluxDB stacks](https://docs.influxdata.com/influxdb/latest/influxdb-templates/stacks/). - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str org_id: An organization ID. Only returns stacks owned by the specified [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization). #### InfluxDB Cloud - Doesn't require this parameter; InfluxDB only returns resources allowed by the API token. (required) - :param str name: A stack name. Finds stack `events` with this name and returns the stacks. Repeatable. To filter for more than one stack name, repeat this parameter with each name--for example: - `INFLUX_URL/api/v2/stacks?&orgID=INFLUX_ORG_ID&name=project-stack-0&name=project-stack-1` - :param str stack_id: A stack ID. Only returns the specified stack. Repeatable. To filter for more than one stack ID, repeat this parameter with each ID--for example: - `INFLUX_URL/api/v2/stacks?&orgID=INFLUX_ORG_ID&stackID=09bd87cd33be3000&stackID=09bef35081fe3000` - :return: ListStacksResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._list_stacks_prepare(org_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/stacks', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='ListStacksResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _list_stacks_prepare(self, org_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['org_id', 'name', 'stack_id'] # noqa: E501 - self._check_operation_params('list_stacks', all_params, local_var_params) - # verify the required parameter 'org_id' is set - if ('org_id' not in local_var_params or - local_var_params['org_id'] is None): - raise ValueError("Missing the required parameter `org_id` when calling `list_stacks`") # noqa: E501 - - path_params = {} - - query_params = [] - if 'org_id' in local_var_params: - query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501 - if 'name' in local_var_params: - query_params.append(('name', local_var_params['name'])) # noqa: E501 - if 'stack_id' in local_var_params: - query_params.append(('stackID', local_var_params['stack_id'])) # noqa: E501 - - header_params = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def read_stack(self, stack_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a stack. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.read_stack(stack_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str stack_id: The identifier of the stack. (required) - :return: Stack - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.read_stack_with_http_info(stack_id, **kwargs) # noqa: E501 - else: - (data) = self.read_stack_with_http_info(stack_id, **kwargs) # noqa: E501 - return data - - def read_stack_with_http_info(self, stack_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a stack. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.read_stack_with_http_info(stack_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str stack_id: The identifier of the stack. (required) - :return: Stack - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._read_stack_prepare(stack_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/stacks/{stack_id}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Stack', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def read_stack_async(self, stack_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a stack. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str stack_id: The identifier of the stack. (required) - :return: Stack - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._read_stack_prepare(stack_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/stacks/{stack_id}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Stack', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _read_stack_prepare(self, stack_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['stack_id'] # noqa: E501 - self._check_operation_params('read_stack', all_params, local_var_params) - # verify the required parameter 'stack_id' is set - if ('stack_id' not in local_var_params or - local_var_params['stack_id'] is None): - raise ValueError("Missing the required parameter `stack_id` when calling `read_stack`") # noqa: E501 - - path_params = {} - if 'stack_id' in local_var_params: - path_params['stack_id'] = local_var_params['stack_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def uninstall_stack(self, stack_id, **kwargs): # noqa: E501,D401,D403 - """Uninstall a stack. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.uninstall_stack(stack_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str stack_id: The identifier of the stack. (required) - :return: Stack - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.uninstall_stack_with_http_info(stack_id, **kwargs) # noqa: E501 - else: - (data) = self.uninstall_stack_with_http_info(stack_id, **kwargs) # noqa: E501 - return data - - def uninstall_stack_with_http_info(self, stack_id, **kwargs): # noqa: E501,D401,D403 - """Uninstall a stack. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.uninstall_stack_with_http_info(stack_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str stack_id: The identifier of the stack. (required) - :return: Stack - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._uninstall_stack_prepare(stack_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/stacks/{stack_id}/uninstall', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Stack', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def uninstall_stack_async(self, stack_id, **kwargs): # noqa: E501,D401,D403 - """Uninstall a stack. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str stack_id: The identifier of the stack. (required) - :return: Stack - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._uninstall_stack_prepare(stack_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/stacks/{stack_id}/uninstall', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Stack', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _uninstall_stack_prepare(self, stack_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['stack_id'] # noqa: E501 - self._check_operation_params('uninstall_stack', all_params, local_var_params) - # verify the required parameter 'stack_id' is set - if ('stack_id' not in local_var_params or - local_var_params['stack_id'] is None): - raise ValueError("Missing the required parameter `stack_id` when calling `uninstall_stack`") # noqa: E501 - - path_params = {} - if 'stack_id' in local_var_params: - path_params['stack_id'] = local_var_params['stack_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def update_stack(self, stack_id, **kwargs): # noqa: E501,D401,D403 - """Update a stack. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_stack(stack_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str stack_id: The identifier of the stack. (required) - :param PatchStackRequest patch_stack_request: - :return: Stack - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.update_stack_with_http_info(stack_id, **kwargs) # noqa: E501 - else: - (data) = self.update_stack_with_http_info(stack_id, **kwargs) # noqa: E501 - return data - - def update_stack_with_http_info(self, stack_id, **kwargs): # noqa: E501,D401,D403 - """Update a stack. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_stack_with_http_info(stack_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str stack_id: The identifier of the stack. (required) - :param PatchStackRequest patch_stack_request: - :return: Stack - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._update_stack_prepare(stack_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/stacks/{stack_id}', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Stack', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def update_stack_async(self, stack_id, **kwargs): # noqa: E501,D401,D403 - """Update a stack. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str stack_id: The identifier of the stack. (required) - :param PatchStackRequest patch_stack_request: - :return: Stack - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._update_stack_prepare(stack_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/stacks/{stack_id}', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Stack', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _update_stack_prepare(self, stack_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['stack_id', 'patch_stack_request'] # noqa: E501 - self._check_operation_params('update_stack', all_params, local_var_params) - # verify the required parameter 'stack_id' is set - if ('stack_id' not in local_var_params or - local_var_params['stack_id'] is None): - raise ValueError("Missing the required parameter `stack_id` when calling `update_stack`") # noqa: E501 - - path_params = {} - if 'stack_id' in local_var_params: - path_params['stack_id'] = local_var_params['stack_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - body_params = None - if 'patch_stack_request' in local_var_params: - body_params = local_var_params['patch_stack_request'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params diff --git a/frogpilot/third_party/influxdb_client/service/users_service.py b/frogpilot/third_party/influxdb_client/service/users_service.py deleted file mode 100644 index b5323244..00000000 --- a/frogpilot/third_party/influxdb_client/service/users_service.py +++ /dev/null @@ -1,1168 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -from influxdb_client.service._base_service import _BaseService - - -class UsersService(_BaseService): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): # noqa: E501,D401,D403 - """UsersService - a operation defined in OpenAPI.""" - super().__init__(api_client) - - def delete_users_id(self, user_id, **kwargs): # noqa: E501,D401,D403 - """Delete a user. - - Deletes a [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user). #### Required permissions | Action | Permission required | |:------------|:-----------------------------------------------| | Delete a user | `write-users` or `write-user USER_ID` | *`USER_ID`* is the ID of the user that you want to delete. #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/organizations/users/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_users_id(user_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_id: A user ID. Specifies the [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user) to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_users_id_with_http_info(user_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_users_id_with_http_info(user_id, **kwargs) # noqa: E501 - return data - - def delete_users_id_with_http_info(self, user_id, **kwargs): # noqa: E501,D401,D403 - """Delete a user. - - Deletes a [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user). #### Required permissions | Action | Permission required | |:------------|:-----------------------------------------------| | Delete a user | `write-users` or `write-user USER_ID` | *`USER_ID`* is the ID of the user that you want to delete. #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/organizations/users/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_users_id_with_http_info(user_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_id: A user ID. Specifies the [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user) to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_users_id_prepare(user_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/users/{userID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def delete_users_id_async(self, user_id, **kwargs): # noqa: E501,D401,D403 - """Delete a user. - - Deletes a [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user). #### Required permissions | Action | Permission required | |:------------|:-----------------------------------------------| | Delete a user | `write-users` or `write-user USER_ID` | *`USER_ID`* is the ID of the user that you want to delete. #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/organizations/users/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str user_id: A user ID. Specifies the [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user) to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_users_id_prepare(user_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/users/{userID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _delete_users_id_prepare(self, user_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['user_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('delete_users_id', all_params, local_var_params) - # verify the required parameter 'user_id' is set - if ('user_id' not in local_var_params or - local_var_params['user_id'] is None): - raise ValueError("Missing the required parameter `user_id` when calling `delete_users_id`") # noqa: E501 - - path_params = {} - if 'user_id' in local_var_params: - path_params['userID'] = local_var_params['user_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_me(self, **kwargs): # noqa: E501,D401,D403 - """Retrieve the currently authenticated user. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_me(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :return: UserResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_me_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_me_with_http_info(**kwargs) # noqa: E501 - return data - - def get_me_with_http_info(self, **kwargs): # noqa: E501,D401,D403 - """Retrieve the currently authenticated user. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_me_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :return: UserResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_me_prepare(**kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/me', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='UserResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_me_async(self, **kwargs): # noqa: E501,D401,D403 - """Retrieve the currently authenticated user. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :return: UserResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_me_prepare(**kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/me', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='UserResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_me_prepare(self, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['zap_trace_span'] # noqa: E501 - self._check_operation_params('get_me', all_params, local_var_params) - - path_params = {} - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_users(self, **kwargs): # noqa: E501,D401,D403 - """List users. - - Lists [users](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user). Default limit is `20`. To limit which users are returned, pass query parameters in your request. #### Required permissions for InfluxDB OSS | Action | Permission required | Restriction | |:-------|:--------------------|:------------| | List all users | _[Operator token](https://docs.influxdata.com/influxdb/latest/security/tokens/#operator-token)_ | | | List a specific user | `read-users` or `read-user USER_ID` | | *`USER_ID`* is the ID of the user that you want to retrieve. #### Related guides - [View users](https://docs.influxdata.com/influxdb/latest/users/view-users/). - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_users(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param int offset: The offset for pagination. The number of records to skip. For more information about pagination parameters, see [Pagination](https://docs.influxdata.com/influxdb/latest/api/#tag/Pagination). - :param int limit: Limits the number of records returned. Default is `20`. - :param str after: A resource ID to seek from. Returns records created after the specified record; results don't include the specified record. Use `after` instead of the `offset` parameter. For more information about pagination parameters, see [Pagination](https://docs.influxdata.com/influxdb/latest/api/#tag/Pagination). - :param str name: A user name. Only lists the specified [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user). - :param str id: A user ID. Only lists the specified [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user). - :return: Users - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_users_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_users_with_http_info(**kwargs) # noqa: E501 - return data - - def get_users_with_http_info(self, **kwargs): # noqa: E501,D401,D403 - """List users. - - Lists [users](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user). Default limit is `20`. To limit which users are returned, pass query parameters in your request. #### Required permissions for InfluxDB OSS | Action | Permission required | Restriction | |:-------|:--------------------|:------------| | List all users | _[Operator token](https://docs.influxdata.com/influxdb/latest/security/tokens/#operator-token)_ | | | List a specific user | `read-users` or `read-user USER_ID` | | *`USER_ID`* is the ID of the user that you want to retrieve. #### Related guides - [View users](https://docs.influxdata.com/influxdb/latest/users/view-users/). - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_users_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param int offset: The offset for pagination. The number of records to skip. For more information about pagination parameters, see [Pagination](https://docs.influxdata.com/influxdb/latest/api/#tag/Pagination). - :param int limit: Limits the number of records returned. Default is `20`. - :param str after: A resource ID to seek from. Returns records created after the specified record; results don't include the specified record. Use `after` instead of the `offset` parameter. For more information about pagination parameters, see [Pagination](https://docs.influxdata.com/influxdb/latest/api/#tag/Pagination). - :param str name: A user name. Only lists the specified [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user). - :param str id: A user ID. Only lists the specified [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user). - :return: Users - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_users_prepare(**kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/users', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Users', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_users_async(self, **kwargs): # noqa: E501,D401,D403 - """List users. - - Lists [users](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user). Default limit is `20`. To limit which users are returned, pass query parameters in your request. #### Required permissions for InfluxDB OSS | Action | Permission required | Restriction | |:-------|:--------------------|:------------| | List all users | _[Operator token](https://docs.influxdata.com/influxdb/latest/security/tokens/#operator-token)_ | | | List a specific user | `read-users` or `read-user USER_ID` | | *`USER_ID`* is the ID of the user that you want to retrieve. #### Related guides - [View users](https://docs.influxdata.com/influxdb/latest/users/view-users/). - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param int offset: The offset for pagination. The number of records to skip. For more information about pagination parameters, see [Pagination](https://docs.influxdata.com/influxdb/latest/api/#tag/Pagination). - :param int limit: Limits the number of records returned. Default is `20`. - :param str after: A resource ID to seek from. Returns records created after the specified record; results don't include the specified record. Use `after` instead of the `offset` parameter. For more information about pagination parameters, see [Pagination](https://docs.influxdata.com/influxdb/latest/api/#tag/Pagination). - :param str name: A user name. Only lists the specified [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user). - :param str id: A user ID. Only lists the specified [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user). - :return: Users - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_users_prepare(**kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/users', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Users', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_users_prepare(self, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['zap_trace_span', 'offset', 'limit', 'after', 'name', 'id'] # noqa: E501 - self._check_operation_params('get_users', all_params, local_var_params) - - if 'offset' in local_var_params and local_var_params['offset'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `offset` when calling `get_users`, must be a value greater than or equal to `0`") # noqa: E501 - if 'limit' in local_var_params and local_var_params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `get_users`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `get_users`, must be a value greater than or equal to `1`") # noqa: E501 - path_params = {} - - query_params = [] - if 'offset' in local_var_params: - query_params.append(('offset', local_var_params['offset'])) # noqa: E501 - if 'limit' in local_var_params: - query_params.append(('limit', local_var_params['limit'])) # noqa: E501 - if 'after' in local_var_params: - query_params.append(('after', local_var_params['after'])) # noqa: E501 - if 'name' in local_var_params: - query_params.append(('name', local_var_params['name'])) # noqa: E501 - if 'id' in local_var_params: - query_params.append(('id', local_var_params['id'])) # noqa: E501 - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_users_id(self, user_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a user. - - Retrieves a [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user). #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/organizations/users/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_users_id(user_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_id: A user ID. Retrieves the specified [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user). (required) - :param str zap_trace_span: OpenTracing span context - :return: UserResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_users_id_with_http_info(user_id, **kwargs) # noqa: E501 - else: - (data) = self.get_users_id_with_http_info(user_id, **kwargs) # noqa: E501 - return data - - def get_users_id_with_http_info(self, user_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a user. - - Retrieves a [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user). #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/organizations/users/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_users_id_with_http_info(user_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_id: A user ID. Retrieves the specified [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user). (required) - :param str zap_trace_span: OpenTracing span context - :return: UserResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_users_id_prepare(user_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/users/{userID}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='UserResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_users_id_async(self, user_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a user. - - Retrieves a [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user). #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/organizations/users/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str user_id: A user ID. Retrieves the specified [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user). (required) - :param str zap_trace_span: OpenTracing span context - :return: UserResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_users_id_prepare(user_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/users/{userID}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='UserResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_users_id_prepare(self, user_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['user_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_users_id', all_params, local_var_params) - # verify the required parameter 'user_id' is set - if ('user_id' not in local_var_params or - local_var_params['user_id'] is None): - raise ValueError("Missing the required parameter `user_id` when calling `get_users_id`") # noqa: E501 - - path_params = {} - if 'user_id' in local_var_params: - path_params['userID'] = local_var_params['user_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def patch_users_id(self, user_id, user, **kwargs): # noqa: E501,D401,D403 - """Update a user. - - Updates a [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user) and returns the user. #### Required permissions | Action | Permission required | |:------------|:-----------------------------------------------| | Update a user | `write-users` or `write-user USER_ID` | *`USER_ID`* is the ID of the user that you want to update. #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/organizations/users/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_users_id(user_id, user, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_id: A user ID. Specifies the [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user) to update. (required) - :param User user: In the request body, provide the user properties to update. (required) - :param str zap_trace_span: OpenTracing span context - :return: UserResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.patch_users_id_with_http_info(user_id, user, **kwargs) # noqa: E501 - else: - (data) = self.patch_users_id_with_http_info(user_id, user, **kwargs) # noqa: E501 - return data - - def patch_users_id_with_http_info(self, user_id, user, **kwargs): # noqa: E501,D401,D403 - """Update a user. - - Updates a [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user) and returns the user. #### Required permissions | Action | Permission required | |:------------|:-----------------------------------------------| | Update a user | `write-users` or `write-user USER_ID` | *`USER_ID`* is the ID of the user that you want to update. #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/organizations/users/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_users_id_with_http_info(user_id, user, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_id: A user ID. Specifies the [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user) to update. (required) - :param User user: In the request body, provide the user properties to update. (required) - :param str zap_trace_span: OpenTracing span context - :return: UserResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_users_id_prepare(user_id, user, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/users/{userID}', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='UserResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def patch_users_id_async(self, user_id, user, **kwargs): # noqa: E501,D401,D403 - """Update a user. - - Updates a [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user) and returns the user. #### Required permissions | Action | Permission required | |:------------|:-----------------------------------------------| | Update a user | `write-users` or `write-user USER_ID` | *`USER_ID`* is the ID of the user that you want to update. #### Related guides - [Manage users](https://docs.influxdata.com/influxdb/latest/organizations/users/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str user_id: A user ID. Specifies the [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user) to update. (required) - :param User user: In the request body, provide the user properties to update. (required) - :param str zap_trace_span: OpenTracing span context - :return: UserResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_users_id_prepare(user_id, user, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/users/{userID}', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='UserResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _patch_users_id_prepare(self, user_id, user, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['user_id', 'user', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('patch_users_id', all_params, local_var_params) - # verify the required parameter 'user_id' is set - if ('user_id' not in local_var_params or - local_var_params['user_id'] is None): - raise ValueError("Missing the required parameter `user_id` when calling `patch_users_id`") # noqa: E501 - # verify the required parameter 'user' is set - if ('user' not in local_var_params or - local_var_params['user'] is None): - raise ValueError("Missing the required parameter `user` when calling `patch_users_id`") # noqa: E501 - - path_params = {} - if 'user_id' in local_var_params: - path_params['userID'] = local_var_params['user_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'user' in local_var_params: - body_params = local_var_params['user'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_users(self, user, **kwargs): # noqa: E501,D401,D403 - """Create a user. - - Creates a [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user) that can access InfluxDB. Returns the user. Use this endpoint to create a user that can sign in to start a user session through one of the following interfaces: - InfluxDB UI - `/api/v2/signin` InfluxDB API endpoint - InfluxDB CLI This endpoint represents the first two steps in a four-step process to allow a user to authenticate with a username and password, and then access data in an organization: 1. Create a user: send a `POST` request to `POST /api/v2/users`. The `name` property is required. 2. Extract the user ID (`id` property) value from the API response for _step 1_. 3. Create an authorization (and API token) for the user: send a `POST` request to [`POST /api/v2/authorizations`](#operation/PostAuthorizations), passing the user ID (`id`) from _step 2_. 4. Create a password for the user: send a `POST` request to [`POST /api/v2/users/USER_ID/password`](#operation/PostUsersIDPassword), passing the user ID from _step 2_. #### Required permissions | Action | Permission required | Restriction | |:-------|:--------------------|:------------| | Create a user | _[Operator token](https://docs.influxdata.com/influxdb/latest/security/tokens/#operator-token)_ | | #### Related guides - [Create a user](https://docs.influxdata.com/influxdb/latest/users/create-user/) - [Create an API token scoped to a user](https://docs.influxdata.com/influxdb/latest/security/tokens/create-token/#create-a-token-scoped-to-a-user) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_users(user, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param User user: The user to create. (required) - :param str zap_trace_span: OpenTracing span context - :return: UserResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_users_with_http_info(user, **kwargs) # noqa: E501 - else: - (data) = self.post_users_with_http_info(user, **kwargs) # noqa: E501 - return data - - def post_users_with_http_info(self, user, **kwargs): # noqa: E501,D401,D403 - """Create a user. - - Creates a [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user) that can access InfluxDB. Returns the user. Use this endpoint to create a user that can sign in to start a user session through one of the following interfaces: - InfluxDB UI - `/api/v2/signin` InfluxDB API endpoint - InfluxDB CLI This endpoint represents the first two steps in a four-step process to allow a user to authenticate with a username and password, and then access data in an organization: 1. Create a user: send a `POST` request to `POST /api/v2/users`. The `name` property is required. 2. Extract the user ID (`id` property) value from the API response for _step 1_. 3. Create an authorization (and API token) for the user: send a `POST` request to [`POST /api/v2/authorizations`](#operation/PostAuthorizations), passing the user ID (`id`) from _step 2_. 4. Create a password for the user: send a `POST` request to [`POST /api/v2/users/USER_ID/password`](#operation/PostUsersIDPassword), passing the user ID from _step 2_. #### Required permissions | Action | Permission required | Restriction | |:-------|:--------------------|:------------| | Create a user | _[Operator token](https://docs.influxdata.com/influxdb/latest/security/tokens/#operator-token)_ | | #### Related guides - [Create a user](https://docs.influxdata.com/influxdb/latest/users/create-user/) - [Create an API token scoped to a user](https://docs.influxdata.com/influxdb/latest/security/tokens/create-token/#create-a-token-scoped-to-a-user) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_users_with_http_info(user, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param User user: The user to create. (required) - :param str zap_trace_span: OpenTracing span context - :return: UserResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_users_prepare(user, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/users', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='UserResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_users_async(self, user, **kwargs): # noqa: E501,D401,D403 - """Create a user. - - Creates a [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user) that can access InfluxDB. Returns the user. Use this endpoint to create a user that can sign in to start a user session through one of the following interfaces: - InfluxDB UI - `/api/v2/signin` InfluxDB API endpoint - InfluxDB CLI This endpoint represents the first two steps in a four-step process to allow a user to authenticate with a username and password, and then access data in an organization: 1. Create a user: send a `POST` request to `POST /api/v2/users`. The `name` property is required. 2. Extract the user ID (`id` property) value from the API response for _step 1_. 3. Create an authorization (and API token) for the user: send a `POST` request to [`POST /api/v2/authorizations`](#operation/PostAuthorizations), passing the user ID (`id`) from _step 2_. 4. Create a password for the user: send a `POST` request to [`POST /api/v2/users/USER_ID/password`](#operation/PostUsersIDPassword), passing the user ID from _step 2_. #### Required permissions | Action | Permission required | Restriction | |:-------|:--------------------|:------------| | Create a user | _[Operator token](https://docs.influxdata.com/influxdb/latest/security/tokens/#operator-token)_ | | #### Related guides - [Create a user](https://docs.influxdata.com/influxdb/latest/users/create-user/) - [Create an API token scoped to a user](https://docs.influxdata.com/influxdb/latest/security/tokens/create-token/#create-a-token-scoped-to-a-user) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param User user: The user to create. (required) - :param str zap_trace_span: OpenTracing span context - :return: UserResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_users_prepare(user, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/users', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='UserResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_users_prepare(self, user, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['user', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('post_users', all_params, local_var_params) - # verify the required parameter 'user' is set - if ('user' not in local_var_params or - local_var_params['user'] is None): - raise ValueError("Missing the required parameter `user` when calling `post_users`") # noqa: E501 - - path_params = {} - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'user' in local_var_params: - body_params = local_var_params['user'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_users_id_password(self, user_id, password_reset_body, **kwargs): # noqa: E501,D401,D403 - """Update a password. - - Updates a user password. #### InfluxDB Cloud - Doesn't allow you to manage user passwords through the API. Use the InfluxDB Cloud user interface (UI) to update a password. #### Related guides - [InfluxDB Cloud - Change your password](https://docs.influxdata.com/influxdb/cloud/account-management/change-password/) - [InfluxDB OSS - Change your password](https://docs.influxdata.com/influxdb/latest/users/change-password/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_users_id_password(user_id, password_reset_body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_id: The ID of the user to set the password for. (required) - :param PasswordResetBody password_reset_body: The new password to set for the user. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_users_id_password_with_http_info(user_id, password_reset_body, **kwargs) # noqa: E501 - else: - (data) = self.post_users_id_password_with_http_info(user_id, password_reset_body, **kwargs) # noqa: E501 - return data - - def post_users_id_password_with_http_info(self, user_id, password_reset_body, **kwargs): # noqa: E501,D401,D403 - """Update a password. - - Updates a user password. #### InfluxDB Cloud - Doesn't allow you to manage user passwords through the API. Use the InfluxDB Cloud user interface (UI) to update a password. #### Related guides - [InfluxDB Cloud - Change your password](https://docs.influxdata.com/influxdb/cloud/account-management/change-password/) - [InfluxDB OSS - Change your password](https://docs.influxdata.com/influxdb/latest/users/change-password/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_users_id_password_with_http_info(user_id, password_reset_body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_id: The ID of the user to set the password for. (required) - :param PasswordResetBody password_reset_body: The new password to set for the user. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_users_id_password_prepare(user_id, password_reset_body, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/users/{userID}/password', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_users_id_password_async(self, user_id, password_reset_body, **kwargs): # noqa: E501,D401,D403 - """Update a password. - - Updates a user password. #### InfluxDB Cloud - Doesn't allow you to manage user passwords through the API. Use the InfluxDB Cloud user interface (UI) to update a password. #### Related guides - [InfluxDB Cloud - Change your password](https://docs.influxdata.com/influxdb/cloud/account-management/change-password/) - [InfluxDB OSS - Change your password](https://docs.influxdata.com/influxdb/latest/users/change-password/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str user_id: The ID of the user to set the password for. (required) - :param PasswordResetBody password_reset_body: The new password to set for the user. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_users_id_password_prepare(user_id, password_reset_body, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/users/{userID}/password', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_users_id_password_prepare(self, user_id, password_reset_body, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['user_id', 'password_reset_body', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('post_users_id_password', all_params, local_var_params) - # verify the required parameter 'user_id' is set - if ('user_id' not in local_var_params or - local_var_params['user_id'] is None): - raise ValueError("Missing the required parameter `user_id` when calling `post_users_id_password`") # noqa: E501 - # verify the required parameter 'password_reset_body' is set - if ('password_reset_body' not in local_var_params or - local_var_params['password_reset_body'] is None): - raise ValueError("Missing the required parameter `password_reset_body` when calling `post_users_id_password`") # noqa: E501 - - path_params = {} - if 'user_id' in local_var_params: - path_params['userID'] = local_var_params['user_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'password_reset_body' in local_var_params: - body_params = local_var_params['password_reset_body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def put_me_password(self, password_reset_body, **kwargs): # noqa: E501,D401,D403 - """Update a password. - - Updates the password for the signed-in [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user). This endpoint represents the third step in the following three-step process to let a user with a user session update their password: 1. Pass the user's [Basic authentication credentials](#section/Authentication/BasicAuthentication) to the `POST /api/v2/signin` endpoint to create a user session and generate a session cookie. 2. From the response in the first step, extract the session cookie (`Set-Cookie`) header. 3. Pass the following in a request to the `PUT /api/v2/me/password` endpoint: - The `Set-Cookie` header from the second step - The `Authorization Basic` header with the user's _Basic authentication_ credentials - `{"password": "NEW_PASSWORD"}` in the request body #### InfluxDB Cloud - Doesn't let you manage user passwords through the API. Use the InfluxDB Cloud user interface (UI) to update your password. #### Related endpoints - [Signin](#tag/Signin) - [Signout](#tag/Signout) - [Users](#tag/Users) #### Related guides - [InfluxDB Cloud - Change your password](https://docs.influxdata.com/influxdb/cloud/account-management/change-password/) - [InfluxDB OSS - Change your password](https://docs.influxdata.com/influxdb/latest/users/change-password/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.put_me_password(password_reset_body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param PasswordResetBody password_reset_body: The new password. (required) - :param str zap_trace_span: OpenTracing span context - :param str authorization: An auth credential for the Basic scheme - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.put_me_password_with_http_info(password_reset_body, **kwargs) # noqa: E501 - else: - (data) = self.put_me_password_with_http_info(password_reset_body, **kwargs) # noqa: E501 - return data - - def put_me_password_with_http_info(self, password_reset_body, **kwargs): # noqa: E501,D401,D403 - """Update a password. - - Updates the password for the signed-in [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user). This endpoint represents the third step in the following three-step process to let a user with a user session update their password: 1. Pass the user's [Basic authentication credentials](#section/Authentication/BasicAuthentication) to the `POST /api/v2/signin` endpoint to create a user session and generate a session cookie. 2. From the response in the first step, extract the session cookie (`Set-Cookie`) header. 3. Pass the following in a request to the `PUT /api/v2/me/password` endpoint: - The `Set-Cookie` header from the second step - The `Authorization Basic` header with the user's _Basic authentication_ credentials - `{"password": "NEW_PASSWORD"}` in the request body #### InfluxDB Cloud - Doesn't let you manage user passwords through the API. Use the InfluxDB Cloud user interface (UI) to update your password. #### Related endpoints - [Signin](#tag/Signin) - [Signout](#tag/Signout) - [Users](#tag/Users) #### Related guides - [InfluxDB Cloud - Change your password](https://docs.influxdata.com/influxdb/cloud/account-management/change-password/) - [InfluxDB OSS - Change your password](https://docs.influxdata.com/influxdb/latest/users/change-password/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.put_me_password_with_http_info(password_reset_body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param PasswordResetBody password_reset_body: The new password. (required) - :param str zap_trace_span: OpenTracing span context - :param str authorization: An auth credential for the Basic scheme - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._put_me_password_prepare(password_reset_body, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/me/password', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=['BasicAuthentication'], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def put_me_password_async(self, password_reset_body, **kwargs): # noqa: E501,D401,D403 - """Update a password. - - Updates the password for the signed-in [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user). This endpoint represents the third step in the following three-step process to let a user with a user session update their password: 1. Pass the user's [Basic authentication credentials](#section/Authentication/BasicAuthentication) to the `POST /api/v2/signin` endpoint to create a user session and generate a session cookie. 2. From the response in the first step, extract the session cookie (`Set-Cookie`) header. 3. Pass the following in a request to the `PUT /api/v2/me/password` endpoint: - The `Set-Cookie` header from the second step - The `Authorization Basic` header with the user's _Basic authentication_ credentials - `{"password": "NEW_PASSWORD"}` in the request body #### InfluxDB Cloud - Doesn't let you manage user passwords through the API. Use the InfluxDB Cloud user interface (UI) to update your password. #### Related endpoints - [Signin](#tag/Signin) - [Signout](#tag/Signout) - [Users](#tag/Users) #### Related guides - [InfluxDB Cloud - Change your password](https://docs.influxdata.com/influxdb/cloud/account-management/change-password/) - [InfluxDB OSS - Change your password](https://docs.influxdata.com/influxdb/latest/users/change-password/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param PasswordResetBody password_reset_body: The new password. (required) - :param str zap_trace_span: OpenTracing span context - :param str authorization: An auth credential for the Basic scheme - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._put_me_password_prepare(password_reset_body, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/me/password', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=['BasicAuthentication'], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _put_me_password_prepare(self, password_reset_body, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['password_reset_body', 'zap_trace_span', 'authorization'] # noqa: E501 - self._check_operation_params('put_me_password', all_params, local_var_params) - # verify the required parameter 'password_reset_body' is set - if ('password_reset_body' not in local_var_params or - local_var_params['password_reset_body'] is None): - raise ValueError("Missing the required parameter `password_reset_body` when calling `put_me_password`") # noqa: E501 - - path_params = {} - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - if 'authorization' in local_var_params: - header_params['Authorization'] = local_var_params['authorization'] # noqa: E501 - - body_params = None - if 'password_reset_body' in local_var_params: - body_params = local_var_params['password_reset_body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def put_users_id_password(self, user_id, password_reset_body, **kwargs): # noqa: E501,D401,D403 - """Update a password. - - Updates a user password. Use this endpoint to let a user authenticate with [Basic authentication credentials](#section/Authentication/BasicAuthentication) and set a new password. #### InfluxDB Cloud - Doesn't allow you to manage user passwords through the API. Use the InfluxDB Cloud user interface (UI) to update a password. #### Related guides - [InfluxDB Cloud - Change your password](https://docs.influxdata.com/influxdb/cloud/account-management/change-password/) - [InfluxDB OSS - Change your password](https://docs.influxdata.com/influxdb/latest/users/change-password/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.put_users_id_password(user_id, password_reset_body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_id: The ID of the user to set the password for. (required) - :param PasswordResetBody password_reset_body: The new password to set for the user. (required) - :param str zap_trace_span: OpenTracing span context - :param str authorization: An auth credential for the Basic scheme - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.put_users_id_password_with_http_info(user_id, password_reset_body, **kwargs) # noqa: E501 - else: - (data) = self.put_users_id_password_with_http_info(user_id, password_reset_body, **kwargs) # noqa: E501 - return data - - def put_users_id_password_with_http_info(self, user_id, password_reset_body, **kwargs): # noqa: E501,D401,D403 - """Update a password. - - Updates a user password. Use this endpoint to let a user authenticate with [Basic authentication credentials](#section/Authentication/BasicAuthentication) and set a new password. #### InfluxDB Cloud - Doesn't allow you to manage user passwords through the API. Use the InfluxDB Cloud user interface (UI) to update a password. #### Related guides - [InfluxDB Cloud - Change your password](https://docs.influxdata.com/influxdb/cloud/account-management/change-password/) - [InfluxDB OSS - Change your password](https://docs.influxdata.com/influxdb/latest/users/change-password/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.put_users_id_password_with_http_info(user_id, password_reset_body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_id: The ID of the user to set the password for. (required) - :param PasswordResetBody password_reset_body: The new password to set for the user. (required) - :param str zap_trace_span: OpenTracing span context - :param str authorization: An auth credential for the Basic scheme - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._put_users_id_password_prepare(user_id, password_reset_body, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/users/{userID}/password', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=['BasicAuthentication'], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def put_users_id_password_async(self, user_id, password_reset_body, **kwargs): # noqa: E501,D401,D403 - """Update a password. - - Updates a user password. Use this endpoint to let a user authenticate with [Basic authentication credentials](#section/Authentication/BasicAuthentication) and set a new password. #### InfluxDB Cloud - Doesn't allow you to manage user passwords through the API. Use the InfluxDB Cloud user interface (UI) to update a password. #### Related guides - [InfluxDB Cloud - Change your password](https://docs.influxdata.com/influxdb/cloud/account-management/change-password/) - [InfluxDB OSS - Change your password](https://docs.influxdata.com/influxdb/latest/users/change-password/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str user_id: The ID of the user to set the password for. (required) - :param PasswordResetBody password_reset_body: The new password to set for the user. (required) - :param str zap_trace_span: OpenTracing span context - :param str authorization: An auth credential for the Basic scheme - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._put_users_id_password_prepare(user_id, password_reset_body, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/users/{userID}/password', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=['BasicAuthentication'], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _put_users_id_password_prepare(self, user_id, password_reset_body, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['user_id', 'password_reset_body', 'zap_trace_span', 'authorization'] # noqa: E501 - self._check_operation_params('put_users_id_password', all_params, local_var_params) - # verify the required parameter 'user_id' is set - if ('user_id' not in local_var_params or - local_var_params['user_id'] is None): - raise ValueError("Missing the required parameter `user_id` when calling `put_users_id_password`") # noqa: E501 - # verify the required parameter 'password_reset_body' is set - if ('password_reset_body' not in local_var_params or - local_var_params['password_reset_body'] is None): - raise ValueError("Missing the required parameter `password_reset_body` when calling `put_users_id_password`") # noqa: E501 - - path_params = {} - if 'user_id' in local_var_params: - path_params['userID'] = local_var_params['user_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - if 'authorization' in local_var_params: - header_params['Authorization'] = local_var_params['authorization'] # noqa: E501 - - body_params = None - if 'password_reset_body' in local_var_params: - body_params = local_var_params['password_reset_body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params diff --git a/frogpilot/third_party/influxdb_client/service/variables_service.py b/frogpilot/third_party/influxdb_client/service/variables_service.py deleted file mode 100644 index 143bd7cc..00000000 --- a/frogpilot/third_party/influxdb_client/service/variables_service.py +++ /dev/null @@ -1,1127 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -from influxdb_client.service._base_service import _BaseService - - -class VariablesService(_BaseService): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): # noqa: E501,D401,D403 - """VariablesService - a operation defined in OpenAPI.""" - super().__init__(api_client) - - def delete_variables_id(self, variable_id, **kwargs): # noqa: E501,D401,D403 - """Delete a variable. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_variables_id(variable_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str variable_id: The variable ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_variables_id_with_http_info(variable_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_variables_id_with_http_info(variable_id, **kwargs) # noqa: E501 - return data - - def delete_variables_id_with_http_info(self, variable_id, **kwargs): # noqa: E501,D401,D403 - """Delete a variable. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_variables_id_with_http_info(variable_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str variable_id: The variable ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_variables_id_prepare(variable_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/variables/{variableID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def delete_variables_id_async(self, variable_id, **kwargs): # noqa: E501,D401,D403 - """Delete a variable. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str variable_id: The variable ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_variables_id_prepare(variable_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/variables/{variableID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _delete_variables_id_prepare(self, variable_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['variable_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('delete_variables_id', all_params, local_var_params) - # verify the required parameter 'variable_id' is set - if ('variable_id' not in local_var_params or - local_var_params['variable_id'] is None): - raise ValueError("Missing the required parameter `variable_id` when calling `delete_variables_id`") # noqa: E501 - - path_params = {} - if 'variable_id' in local_var_params: - path_params['variableID'] = local_var_params['variable_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def delete_variables_id_labels_id(self, variable_id, label_id, **kwargs): # noqa: E501,D401,D403 - """Delete a label from a variable. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_variables_id_labels_id(variable_id, label_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str variable_id: The variable ID. (required) - :param str label_id: The label ID to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_variables_id_labels_id_with_http_info(variable_id, label_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_variables_id_labels_id_with_http_info(variable_id, label_id, **kwargs) # noqa: E501 - return data - - def delete_variables_id_labels_id_with_http_info(self, variable_id, label_id, **kwargs): # noqa: E501,D401,D403 - """Delete a label from a variable. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_variables_id_labels_id_with_http_info(variable_id, label_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str variable_id: The variable ID. (required) - :param str label_id: The label ID to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_variables_id_labels_id_prepare(variable_id, label_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/variables/{variableID}/labels/{labelID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def delete_variables_id_labels_id_async(self, variable_id, label_id, **kwargs): # noqa: E501,D401,D403 - """Delete a label from a variable. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str variable_id: The variable ID. (required) - :param str label_id: The label ID to delete. (required) - :param str zap_trace_span: OpenTracing span context - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._delete_variables_id_labels_id_prepare(variable_id, label_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/variables/{variableID}/labels/{labelID}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _delete_variables_id_labels_id_prepare(self, variable_id, label_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['variable_id', 'label_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('delete_variables_id_labels_id', all_params, local_var_params) - # verify the required parameter 'variable_id' is set - if ('variable_id' not in local_var_params or - local_var_params['variable_id'] is None): - raise ValueError("Missing the required parameter `variable_id` when calling `delete_variables_id_labels_id`") # noqa: E501 - # verify the required parameter 'label_id' is set - if ('label_id' not in local_var_params or - local_var_params['label_id'] is None): - raise ValueError("Missing the required parameter `label_id` when calling `delete_variables_id_labels_id`") # noqa: E501 - - path_params = {} - if 'variable_id' in local_var_params: - path_params['variableID'] = local_var_params['variable_id'] # noqa: E501 - if 'label_id' in local_var_params: - path_params['labelID'] = local_var_params['label_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_variables(self, **kwargs): # noqa: E501,D401,D403 - """List all variables. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_variables(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param str org: The name of the organization. - :param str org_id: The organization ID. - :return: Variables - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_variables_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_variables_with_http_info(**kwargs) # noqa: E501 - return data - - def get_variables_with_http_info(self, **kwargs): # noqa: E501,D401,D403 - """List all variables. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_variables_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param str org: The name of the organization. - :param str org_id: The organization ID. - :return: Variables - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_variables_prepare(**kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/variables', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Variables', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_variables_async(self, **kwargs): # noqa: E501,D401,D403 - """List all variables. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str zap_trace_span: OpenTracing span context - :param str org: The name of the organization. - :param str org_id: The organization ID. - :return: Variables - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_variables_prepare(**kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/variables', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Variables', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_variables_prepare(self, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['zap_trace_span', 'org', 'org_id'] # noqa: E501 - self._check_operation_params('get_variables', all_params, local_var_params) - - path_params = {} - - query_params = [] - if 'org' in local_var_params: - query_params.append(('org', local_var_params['org'])) # noqa: E501 - if 'org_id' in local_var_params: - query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501 - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_variables_id(self, variable_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a variable. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_variables_id(variable_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str variable_id: The variable ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: Variable - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_variables_id_with_http_info(variable_id, **kwargs) # noqa: E501 - else: - (data) = self.get_variables_id_with_http_info(variable_id, **kwargs) # noqa: E501 - return data - - def get_variables_id_with_http_info(self, variable_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a variable. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_variables_id_with_http_info(variable_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str variable_id: The variable ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: Variable - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_variables_id_prepare(variable_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/variables/{variableID}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Variable', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_variables_id_async(self, variable_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve a variable. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str variable_id: The variable ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: Variable - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_variables_id_prepare(variable_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/variables/{variableID}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Variable', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_variables_id_prepare(self, variable_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['variable_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_variables_id', all_params, local_var_params) - # verify the required parameter 'variable_id' is set - if ('variable_id' not in local_var_params or - local_var_params['variable_id'] is None): - raise ValueError("Missing the required parameter `variable_id` when calling `get_variables_id`") # noqa: E501 - - path_params = {} - if 'variable_id' in local_var_params: - path_params['variableID'] = local_var_params['variable_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def get_variables_id_labels(self, variable_id, **kwargs): # noqa: E501,D401,D403 - """List all labels for a variable. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_variables_id_labels(variable_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str variable_id: The variable ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelsResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_variables_id_labels_with_http_info(variable_id, **kwargs) # noqa: E501 - else: - (data) = self.get_variables_id_labels_with_http_info(variable_id, **kwargs) # noqa: E501 - return data - - def get_variables_id_labels_with_http_info(self, variable_id, **kwargs): # noqa: E501,D401,D403 - """List all labels for a variable. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_variables_id_labels_with_http_info(variable_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str variable_id: The variable ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelsResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_variables_id_labels_prepare(variable_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/variables/{variableID}/labels', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='LabelsResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_variables_id_labels_async(self, variable_id, **kwargs): # noqa: E501,D401,D403 - """List all labels for a variable. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str variable_id: The variable ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelsResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_variables_id_labels_prepare(variable_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/variables/{variableID}/labels', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='LabelsResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_variables_id_labels_prepare(self, variable_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['variable_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_variables_id_labels', all_params, local_var_params) - # verify the required parameter 'variable_id' is set - if ('variable_id' not in local_var_params or - local_var_params['variable_id'] is None): - raise ValueError("Missing the required parameter `variable_id` when calling `get_variables_id_labels`") # noqa: E501 - - path_params = {} - if 'variable_id' in local_var_params: - path_params['variableID'] = local_var_params['variable_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def patch_variables_id(self, variable_id, variable, **kwargs): # noqa: E501,D401,D403 - """Update a variable. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_variables_id(variable_id, variable, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str variable_id: The variable ID. (required) - :param Variable variable: Variable update to apply (required) - :param str zap_trace_span: OpenTracing span context - :return: Variable - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.patch_variables_id_with_http_info(variable_id, variable, **kwargs) # noqa: E501 - else: - (data) = self.patch_variables_id_with_http_info(variable_id, variable, **kwargs) # noqa: E501 - return data - - def patch_variables_id_with_http_info(self, variable_id, variable, **kwargs): # noqa: E501,D401,D403 - """Update a variable. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_variables_id_with_http_info(variable_id, variable, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str variable_id: The variable ID. (required) - :param Variable variable: Variable update to apply (required) - :param str zap_trace_span: OpenTracing span context - :return: Variable - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_variables_id_prepare(variable_id, variable, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/variables/{variableID}', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Variable', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def patch_variables_id_async(self, variable_id, variable, **kwargs): # noqa: E501,D401,D403 - """Update a variable. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str variable_id: The variable ID. (required) - :param Variable variable: Variable update to apply (required) - :param str zap_trace_span: OpenTracing span context - :return: Variable - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_variables_id_prepare(variable_id, variable, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/variables/{variableID}', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Variable', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _patch_variables_id_prepare(self, variable_id, variable, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['variable_id', 'variable', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('patch_variables_id', all_params, local_var_params) - # verify the required parameter 'variable_id' is set - if ('variable_id' not in local_var_params or - local_var_params['variable_id'] is None): - raise ValueError("Missing the required parameter `variable_id` when calling `patch_variables_id`") # noqa: E501 - # verify the required parameter 'variable' is set - if ('variable' not in local_var_params or - local_var_params['variable'] is None): - raise ValueError("Missing the required parameter `variable` when calling `patch_variables_id`") # noqa: E501 - - path_params = {} - if 'variable_id' in local_var_params: - path_params['variableID'] = local_var_params['variable_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'variable' in local_var_params: - body_params = local_var_params['variable'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_variables(self, variable, **kwargs): # noqa: E501,D401,D403 - """Create a variable. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_variables(variable, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param Variable variable: Variable to create (required) - :param str zap_trace_span: OpenTracing span context - :return: Variable - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_variables_with_http_info(variable, **kwargs) # noqa: E501 - else: - (data) = self.post_variables_with_http_info(variable, **kwargs) # noqa: E501 - return data - - def post_variables_with_http_info(self, variable, **kwargs): # noqa: E501,D401,D403 - """Create a variable. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_variables_with_http_info(variable, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param Variable variable: Variable to create (required) - :param str zap_trace_span: OpenTracing span context - :return: Variable - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_variables_prepare(variable, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/variables', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Variable', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_variables_async(self, variable, **kwargs): # noqa: E501,D401,D403 - """Create a variable. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param Variable variable: Variable to create (required) - :param str zap_trace_span: OpenTracing span context - :return: Variable - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_variables_prepare(variable, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/variables', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Variable', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_variables_prepare(self, variable, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['variable', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('post_variables', all_params, local_var_params) - # verify the required parameter 'variable' is set - if ('variable' not in local_var_params or - local_var_params['variable'] is None): - raise ValueError("Missing the required parameter `variable` when calling `post_variables`") # noqa: E501 - - path_params = {} - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'variable' in local_var_params: - body_params = local_var_params['variable'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def post_variables_id_labels(self, variable_id, label_mapping, **kwargs): # noqa: E501,D401,D403 - """Add a label to a variable. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_variables_id_labels(variable_id, label_mapping, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str variable_id: The variable ID. (required) - :param LabelMapping label_mapping: Label to add (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_variables_id_labels_with_http_info(variable_id, label_mapping, **kwargs) # noqa: E501 - else: - (data) = self.post_variables_id_labels_with_http_info(variable_id, label_mapping, **kwargs) # noqa: E501 - return data - - def post_variables_id_labels_with_http_info(self, variable_id, label_mapping, **kwargs): # noqa: E501,D401,D403 - """Add a label to a variable. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_variables_id_labels_with_http_info(variable_id, label_mapping, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str variable_id: The variable ID. (required) - :param LabelMapping label_mapping: Label to add (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_variables_id_labels_prepare(variable_id, label_mapping, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/variables/{variableID}/labels', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='LabelResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_variables_id_labels_async(self, variable_id, label_mapping, **kwargs): # noqa: E501,D401,D403 - """Add a label to a variable. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str variable_id: The variable ID. (required) - :param LabelMapping label_mapping: Label to add (required) - :param str zap_trace_span: OpenTracing span context - :return: LabelResponse - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_variables_id_labels_prepare(variable_id, label_mapping, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/variables/{variableID}/labels', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='LabelResponse', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_variables_id_labels_prepare(self, variable_id, label_mapping, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['variable_id', 'label_mapping', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('post_variables_id_labels', all_params, local_var_params) - # verify the required parameter 'variable_id' is set - if ('variable_id' not in local_var_params or - local_var_params['variable_id'] is None): - raise ValueError("Missing the required parameter `variable_id` when calling `post_variables_id_labels`") # noqa: E501 - # verify the required parameter 'label_mapping' is set - if ('label_mapping' not in local_var_params or - local_var_params['label_mapping'] is None): - raise ValueError("Missing the required parameter `label_mapping` when calling `post_variables_id_labels`") # noqa: E501 - - path_params = {} - if 'variable_id' in local_var_params: - path_params['variableID'] = local_var_params['variable_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'label_mapping' in local_var_params: - body_params = local_var_params['label_mapping'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def put_variables_id(self, variable_id, variable, **kwargs): # noqa: E501,D401,D403 - """Replace a variable. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.put_variables_id(variable_id, variable, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str variable_id: The variable ID. (required) - :param Variable variable: Variable to replace (required) - :param str zap_trace_span: OpenTracing span context - :return: Variable - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.put_variables_id_with_http_info(variable_id, variable, **kwargs) # noqa: E501 - else: - (data) = self.put_variables_id_with_http_info(variable_id, variable, **kwargs) # noqa: E501 - return data - - def put_variables_id_with_http_info(self, variable_id, variable, **kwargs): # noqa: E501,D401,D403 - """Replace a variable. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.put_variables_id_with_http_info(variable_id, variable, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str variable_id: The variable ID. (required) - :param Variable variable: Variable to replace (required) - :param str zap_trace_span: OpenTracing span context - :return: Variable - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._put_variables_id_prepare(variable_id, variable, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/variables/{variableID}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Variable', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def put_variables_id_async(self, variable_id, variable, **kwargs): # noqa: E501,D401,D403 - """Replace a variable. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str variable_id: The variable ID. (required) - :param Variable variable: Variable to replace (required) - :param str zap_trace_span: OpenTracing span context - :return: Variable - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._put_variables_id_prepare(variable_id, variable, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/variables/{variableID}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='Variable', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _put_variables_id_prepare(self, variable_id, variable, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['variable_id', 'variable', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('put_variables_id', all_params, local_var_params) - # verify the required parameter 'variable_id' is set - if ('variable_id' not in local_var_params or - local_var_params['variable_id'] is None): - raise ValueError("Missing the required parameter `variable_id` when calling `put_variables_id`") # noqa: E501 - # verify the required parameter 'variable' is set - if ('variable' not in local_var_params or - local_var_params['variable'] is None): - raise ValueError("Missing the required parameter `variable` when calling `put_variables_id`") # noqa: E501 - - path_params = {} - if 'variable_id' in local_var_params: - path_params['variableID'] = local_var_params['variable_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'variable' in local_var_params: - body_params = local_var_params['variable'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params diff --git a/frogpilot/third_party/influxdb_client/service/views_service.py b/frogpilot/third_party/influxdb_client/service/views_service.py deleted file mode 100644 index 203f6c64..00000000 --- a/frogpilot/third_party/influxdb_client/service/views_service.py +++ /dev/null @@ -1,293 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -from influxdb_client.service._base_service import _BaseService - - -class ViewsService(_BaseService): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): # noqa: E501,D401,D403 - """ViewsService - a operation defined in OpenAPI.""" - super().__init__(api_client) - - def get_dashboards_id_cells_id_view(self, dashboard_id, cell_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve the view for a cell. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_dashboards_id_cells_id_view(dashboard_id, cell_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The dashboard ID. (required) - :param str cell_id: The cell ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: View - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_dashboards_id_cells_id_view_with_http_info(dashboard_id, cell_id, **kwargs) # noqa: E501 - else: - (data) = self.get_dashboards_id_cells_id_view_with_http_info(dashboard_id, cell_id, **kwargs) # noqa: E501 - return data - - def get_dashboards_id_cells_id_view_with_http_info(self, dashboard_id, cell_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve the view for a cell. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_dashboards_id_cells_id_view_with_http_info(dashboard_id, cell_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The dashboard ID. (required) - :param str cell_id: The cell ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: View - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_dashboards_id_cells_id_view_prepare(dashboard_id, cell_id, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}/cells/{cellID}/view', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='View', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def get_dashboards_id_cells_id_view_async(self, dashboard_id, cell_id, **kwargs): # noqa: E501,D401,D403 - """Retrieve the view for a cell. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str dashboard_id: The dashboard ID. (required) - :param str cell_id: The cell ID. (required) - :param str zap_trace_span: OpenTracing span context - :return: View - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._get_dashboards_id_cells_id_view_prepare(dashboard_id, cell_id, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}/cells/{cellID}/view', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='View', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _get_dashboards_id_cells_id_view_prepare(self, dashboard_id, cell_id, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['dashboard_id', 'cell_id', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('get_dashboards_id_cells_id_view', all_params, local_var_params) - # verify the required parameter 'dashboard_id' is set - if ('dashboard_id' not in local_var_params or - local_var_params['dashboard_id'] is None): - raise ValueError("Missing the required parameter `dashboard_id` when calling `get_dashboards_id_cells_id_view`") # noqa: E501 - # verify the required parameter 'cell_id' is set - if ('cell_id' not in local_var_params or - local_var_params['cell_id'] is None): - raise ValueError("Missing the required parameter `cell_id` when calling `get_dashboards_id_cells_id_view`") # noqa: E501 - - path_params = {} - if 'dashboard_id' in local_var_params: - path_params['dashboardID'] = local_var_params['dashboard_id'] # noqa: E501 - if 'cell_id' in local_var_params: - path_params['cellID'] = local_var_params['cell_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params - - def patch_dashboards_id_cells_id_view(self, dashboard_id, cell_id, view, **kwargs): # noqa: E501,D401,D403 - """Update the view for a cell. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_dashboards_id_cells_id_view(dashboard_id, cell_id, view, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The ID of the dashboard to update. (required) - :param str cell_id: The ID of the cell to update. (required) - :param View view: (required) - :param str zap_trace_span: OpenTracing span context - :return: View - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.patch_dashboards_id_cells_id_view_with_http_info(dashboard_id, cell_id, view, **kwargs) # noqa: E501 - else: - (data) = self.patch_dashboards_id_cells_id_view_with_http_info(dashboard_id, cell_id, view, **kwargs) # noqa: E501 - return data - - def patch_dashboards_id_cells_id_view_with_http_info(self, dashboard_id, cell_id, view, **kwargs): # noqa: E501,D401,D403 - """Update the view for a cell. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.patch_dashboards_id_cells_id_view_with_http_info(dashboard_id, cell_id, view, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str dashboard_id: The ID of the dashboard to update. (required) - :param str cell_id: The ID of the cell to update. (required) - :param View view: (required) - :param str zap_trace_span: OpenTracing span context - :return: View - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_dashboards_id_cells_id_view_prepare(dashboard_id, cell_id, view, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}/cells/{cellID}/view', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='View', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def patch_dashboards_id_cells_id_view_async(self, dashboard_id, cell_id, view, **kwargs): # noqa: E501,D401,D403 - """Update the view for a cell. - - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str dashboard_id: The ID of the dashboard to update. (required) - :param str cell_id: The ID of the cell to update. (required) - :param View view: (required) - :param str zap_trace_span: OpenTracing span context - :return: View - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._patch_dashboards_id_cells_id_view_prepare(dashboard_id, cell_id, view, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/dashboards/{dashboardID}/cells/{cellID}/view', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type='View', # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _patch_dashboards_id_cells_id_view_prepare(self, dashboard_id, cell_id, view, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['dashboard_id', 'cell_id', 'view', 'zap_trace_span'] # noqa: E501 - self._check_operation_params('patch_dashboards_id_cells_id_view', all_params, local_var_params) - # verify the required parameter 'dashboard_id' is set - if ('dashboard_id' not in local_var_params or - local_var_params['dashboard_id'] is None): - raise ValueError("Missing the required parameter `dashboard_id` when calling `patch_dashboards_id_cells_id_view`") # noqa: E501 - # verify the required parameter 'cell_id' is set - if ('cell_id' not in local_var_params or - local_var_params['cell_id'] is None): - raise ValueError("Missing the required parameter `cell_id` when calling `patch_dashboards_id_cells_id_view`") # noqa: E501 - # verify the required parameter 'view' is set - if ('view' not in local_var_params or - local_var_params['view'] is None): - raise ValueError("Missing the required parameter `view` when calling `patch_dashboards_id_cells_id_view`") # noqa: E501 - - path_params = {} - if 'dashboard_id' in local_var_params: - path_params['dashboardID'] = local_var_params['dashboard_id'] # noqa: E501 - if 'cell_id' in local_var_params: - path_params['cellID'] = local_var_params['cell_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - - body_params = None - if 'view' in local_var_params: - body_params = local_var_params['view'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params diff --git a/frogpilot/third_party/influxdb_client/service/write_service.py b/frogpilot/third_party/influxdb_client/service/write_service.py deleted file mode 100644 index bcd970db..00000000 --- a/frogpilot/third_party/influxdb_client/service/write_service.py +++ /dev/null @@ -1,201 +0,0 @@ -# coding: utf-8 - -""" -InfluxDB OSS API Service. - -The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501 - -OpenAPI spec version: 2.0.0 -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -from influxdb_client.service._base_service import _BaseService - - -class WriteService(_BaseService): - """NOTE: This class is auto generated by OpenAPI Generator. - - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): # noqa: E501,D401,D403 - """WriteService - a operation defined in OpenAPI.""" - super().__init__(api_client) - - def post_write(self, org, bucket, body, **kwargs): # noqa: E501,D401,D403 - """Write data. - - Writes data to a bucket. Use this endpoint to send data in [line protocol](https://docs.influxdata.com/influxdb/latest/reference/syntax/line-protocol/) format to InfluxDB. #### InfluxDB Cloud - Does the following when you send a write request: 1. Validates the request and queues the write. 2. If queued, responds with _success_ (HTTP `2xx` status code); _error_ otherwise. 3. Handles the delete asynchronously and reaches eventual consistency. To ensure that InfluxDB Cloud handles writes and deletes in the order you request them, wait for a success response (HTTP `2xx` status code) before you send the next request. Because writes and deletes are asynchronous, your change might not yet be readable when you receive the response. #### InfluxDB OSS - Validates the request and handles the write synchronously. - If all points were written successfully, responds with HTTP `2xx` status code; otherwise, returns the first line that failed. #### Required permissions - `write-buckets` or `write-bucket BUCKET_ID`. *`BUCKET_ID`* is the ID of the destination bucket. #### Rate limits (with InfluxDB Cloud) `write` rate limits apply. For more information, see [limits and adjustable quotas](https://docs.influxdata.com/influxdb/cloud/account-management/limits/). #### Related guides - [Write data with the InfluxDB API](https://docs.influxdata.com/influxdb/latest/write-data/developer-tools/api) - [Optimize writes to InfluxDB](https://docs.influxdata.com/influxdb/latest/write-data/best-practices/optimize-writes/) - [Troubleshoot issues writing data](https://docs.influxdata.com/influxdb/latest/write-data/troubleshoot/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_write(org, bucket, body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str org: An organization name or ID. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Writes data to the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either the `org` parameter or the `orgID` parameter. - If you pass both `orgID` and `org`, they must both be valid. - Writes data to the bucket in the specified organization. (required) - :param str bucket: A bucket name or ID. InfluxDB writes all points in the batch to the specified bucket. (required) - :param str body: In the request body, provide data in [line protocol format](https://docs.influxdata.com/influxdb/latest/reference/syntax/line-protocol/). To send compressed data, do the following: 1. Use [GZIP](https://www.gzip.org/) to compress the line protocol data. 2. In your request, send the compressed data and the `Content-Encoding: gzip` header. #### Related guides - [Best practices for optimizing writes](https://docs.influxdata.com/influxdb/latest/write-data/best-practices/optimize-writes/) (required) - :param str zap_trace_span: OpenTracing span context - :param str content_encoding: The compression applied to the line protocol in the request payload. To send a GZIP payload, pass `Content-Encoding: gzip` header. - :param str content_type: The format of the data in the request body. To send a line protocol payload, pass `Content-Type: text/plain; charset=utf-8`. - :param int content_length: The size of the entity-body, in bytes, sent to InfluxDB. If the length is greater than the `max body` configuration option, the server responds with status code `413`. - :param str accept: The content type that the client can understand. Writes only return a response body if they fail--for example, due to a formatting problem or quota limit. #### InfluxDB Cloud - Returns only `application/json` for format and limit errors. - Returns only `text/html` for some quota limit errors. #### InfluxDB OSS - Returns only `application/json` for format and limit errors. #### Related guides - [Troubleshoot issues writing data](https://docs.influxdata.com/influxdb/latest/write-data/troubleshoot/) - :param str org_id: An organization ID. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Writes data to the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either the `org` parameter or the `orgID` parameter. - If you pass both `orgID` and `org`, they must both be valid. - Writes data to the bucket in the specified organization. - :param WritePrecision precision: The precision for unix timestamps in the line protocol batch. - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.post_write_with_http_info(org, bucket, body, **kwargs) # noqa: E501 - else: - (data) = self.post_write_with_http_info(org, bucket, body, **kwargs) # noqa: E501 - return data - - def post_write_with_http_info(self, org, bucket, body, **kwargs): # noqa: E501,D401,D403 - """Write data. - - Writes data to a bucket. Use this endpoint to send data in [line protocol](https://docs.influxdata.com/influxdb/latest/reference/syntax/line-protocol/) format to InfluxDB. #### InfluxDB Cloud - Does the following when you send a write request: 1. Validates the request and queues the write. 2. If queued, responds with _success_ (HTTP `2xx` status code); _error_ otherwise. 3. Handles the delete asynchronously and reaches eventual consistency. To ensure that InfluxDB Cloud handles writes and deletes in the order you request them, wait for a success response (HTTP `2xx` status code) before you send the next request. Because writes and deletes are asynchronous, your change might not yet be readable when you receive the response. #### InfluxDB OSS - Validates the request and handles the write synchronously. - If all points were written successfully, responds with HTTP `2xx` status code; otherwise, returns the first line that failed. #### Required permissions - `write-buckets` or `write-bucket BUCKET_ID`. *`BUCKET_ID`* is the ID of the destination bucket. #### Rate limits (with InfluxDB Cloud) `write` rate limits apply. For more information, see [limits and adjustable quotas](https://docs.influxdata.com/influxdb/cloud/account-management/limits/). #### Related guides - [Write data with the InfluxDB API](https://docs.influxdata.com/influxdb/latest/write-data/developer-tools/api) - [Optimize writes to InfluxDB](https://docs.influxdata.com/influxdb/latest/write-data/best-practices/optimize-writes/) - [Troubleshoot issues writing data](https://docs.influxdata.com/influxdb/latest/write-data/troubleshoot/) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_write_with_http_info(org, bucket, body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str org: An organization name or ID. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Writes data to the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either the `org` parameter or the `orgID` parameter. - If you pass both `orgID` and `org`, they must both be valid. - Writes data to the bucket in the specified organization. (required) - :param str bucket: A bucket name or ID. InfluxDB writes all points in the batch to the specified bucket. (required) - :param str body: In the request body, provide data in [line protocol format](https://docs.influxdata.com/influxdb/latest/reference/syntax/line-protocol/). To send compressed data, do the following: 1. Use [GZIP](https://www.gzip.org/) to compress the line protocol data. 2. In your request, send the compressed data and the `Content-Encoding: gzip` header. #### Related guides - [Best practices for optimizing writes](https://docs.influxdata.com/influxdb/latest/write-data/best-practices/optimize-writes/) (required) - :param str zap_trace_span: OpenTracing span context - :param str content_encoding: The compression applied to the line protocol in the request payload. To send a GZIP payload, pass `Content-Encoding: gzip` header. - :param str content_type: The format of the data in the request body. To send a line protocol payload, pass `Content-Type: text/plain; charset=utf-8`. - :param int content_length: The size of the entity-body, in bytes, sent to InfluxDB. If the length is greater than the `max body` configuration option, the server responds with status code `413`. - :param str accept: The content type that the client can understand. Writes only return a response body if they fail--for example, due to a formatting problem or quota limit. #### InfluxDB Cloud - Returns only `application/json` for format and limit errors. - Returns only `text/html` for some quota limit errors. #### InfluxDB OSS - Returns only `application/json` for format and limit errors. #### Related guides - [Troubleshoot issues writing data](https://docs.influxdata.com/influxdb/latest/write-data/troubleshoot/) - :param str org_id: An organization ID. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Writes data to the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either the `org` parameter or the `orgID` parameter. - If you pass both `orgID` and `org`, they must both be valid. - Writes data to the bucket in the specified organization. - :param WritePrecision precision: The precision for unix timestamps in the line protocol batch. - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_write_prepare(org, bucket, body, **kwargs) # noqa: E501 - - return self.api_client.call_api( - '/api/v2/write', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - async def post_write_async(self, org, bucket, body, **kwargs): # noqa: E501,D401,D403 - """Write data. - - Writes data to a bucket. Use this endpoint to send data in [line protocol](https://docs.influxdata.com/influxdb/latest/reference/syntax/line-protocol/) format to InfluxDB. #### InfluxDB Cloud - Does the following when you send a write request: 1. Validates the request and queues the write. 2. If queued, responds with _success_ (HTTP `2xx` status code); _error_ otherwise. 3. Handles the delete asynchronously and reaches eventual consistency. To ensure that InfluxDB Cloud handles writes and deletes in the order you request them, wait for a success response (HTTP `2xx` status code) before you send the next request. Because writes and deletes are asynchronous, your change might not yet be readable when you receive the response. #### InfluxDB OSS - Validates the request and handles the write synchronously. - If all points were written successfully, responds with HTTP `2xx` status code; otherwise, returns the first line that failed. #### Required permissions - `write-buckets` or `write-bucket BUCKET_ID`. *`BUCKET_ID`* is the ID of the destination bucket. #### Rate limits (with InfluxDB Cloud) `write` rate limits apply. For more information, see [limits and adjustable quotas](https://docs.influxdata.com/influxdb/cloud/account-management/limits/). #### Related guides - [Write data with the InfluxDB API](https://docs.influxdata.com/influxdb/latest/write-data/developer-tools/api) - [Optimize writes to InfluxDB](https://docs.influxdata.com/influxdb/latest/write-data/best-practices/optimize-writes/) - [Troubleshoot issues writing data](https://docs.influxdata.com/influxdb/latest/write-data/troubleshoot/) - This method makes an asynchronous HTTP request. - - :param async_req bool - :param str org: An organization name or ID. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Writes data to the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either the `org` parameter or the `orgID` parameter. - If you pass both `orgID` and `org`, they must both be valid. - Writes data to the bucket in the specified organization. (required) - :param str bucket: A bucket name or ID. InfluxDB writes all points in the batch to the specified bucket. (required) - :param str body: In the request body, provide data in [line protocol format](https://docs.influxdata.com/influxdb/latest/reference/syntax/line-protocol/). To send compressed data, do the following: 1. Use [GZIP](https://www.gzip.org/) to compress the line protocol data. 2. In your request, send the compressed data and the `Content-Encoding: gzip` header. #### Related guides - [Best practices for optimizing writes](https://docs.influxdata.com/influxdb/latest/write-data/best-practices/optimize-writes/) (required) - :param str zap_trace_span: OpenTracing span context - :param str content_encoding: The compression applied to the line protocol in the request payload. To send a GZIP payload, pass `Content-Encoding: gzip` header. - :param str content_type: The format of the data in the request body. To send a line protocol payload, pass `Content-Type: text/plain; charset=utf-8`. - :param int content_length: The size of the entity-body, in bytes, sent to InfluxDB. If the length is greater than the `max body` configuration option, the server responds with status code `413`. - :param str accept: The content type that the client can understand. Writes only return a response body if they fail--for example, due to a formatting problem or quota limit. #### InfluxDB Cloud - Returns only `application/json` for format and limit errors. - Returns only `text/html` for some quota limit errors. #### InfluxDB OSS - Returns only `application/json` for format and limit errors. #### Related guides - [Troubleshoot issues writing data](https://docs.influxdata.com/influxdb/latest/write-data/troubleshoot/) - :param str org_id: An organization ID. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Writes data to the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either the `org` parameter or the `orgID` parameter. - If you pass both `orgID` and `org`, they must both be valid. - Writes data to the bucket in the specified organization. - :param WritePrecision precision: The precision for unix timestamps in the line protocol batch. - :return: None - If the method is called asynchronously, - returns the request thread. - """ # noqa: E501 - local_var_params, path_params, query_params, header_params, body_params = \ - self._post_write_prepare(org, bucket, body, **kwargs) # noqa: E501 - - return await self.api_client.call_api( - '/api/v2/write', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=[], - files={}, - response_type=None, # noqa: E501 - auth_settings=[], - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats={}, - urlopen_kw=kwargs.get('urlopen_kw', None)) - - def _post_write_prepare(self, org, bucket, body, **kwargs): # noqa: E501,D401,D403 - local_var_params = locals() - - all_params = ['org', 'bucket', 'body', 'zap_trace_span', 'content_encoding', 'content_type', 'content_length', 'accept', 'org_id', 'precision'] # noqa: E501 - self._check_operation_params('post_write', all_params, local_var_params) - # verify the required parameter 'org' is set - if ('org' not in local_var_params or - local_var_params['org'] is None): - raise ValueError("Missing the required parameter `org` when calling `post_write`") # noqa: E501 - # verify the required parameter 'bucket' is set - if ('bucket' not in local_var_params or - local_var_params['bucket'] is None): - raise ValueError("Missing the required parameter `bucket` when calling `post_write`") # noqa: E501 - # verify the required parameter 'body' is set - if ('body' not in local_var_params or - local_var_params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `post_write`") # noqa: E501 - - path_params = {} - - query_params = [] - if 'org' in local_var_params: - query_params.append(('org', local_var_params['org'])) # noqa: E501 - if 'org_id' in local_var_params: - query_params.append(('orgID', local_var_params['org_id'])) # noqa: E501 - if 'bucket' in local_var_params: - query_params.append(('bucket', local_var_params['bucket'])) # noqa: E501 - if 'precision' in local_var_params: - query_params.append(('precision', local_var_params['precision'])) # noqa: E501 - - header_params = {} - if 'zap_trace_span' in local_var_params: - header_params['Zap-Trace-Span'] = local_var_params['zap_trace_span'] # noqa: E501 - if 'content_encoding' in local_var_params: - header_params['Content-Encoding'] = local_var_params['content_encoding'] # noqa: E501 - if 'content_type' in local_var_params: - header_params['Content-Type'] = local_var_params['content_type'] # noqa: E501 - if 'content_length' in local_var_params: - header_params['Content-Length'] = local_var_params['content_length'] # noqa: E501 - if 'accept' in local_var_params: - header_params['Accept'] = local_var_params['accept'] # noqa: E501 - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'text/html', ]) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['text/plain']) # noqa: E501 - - return local_var_params, path_params, query_params, header_params, body_params diff --git a/frogpilot/third_party/influxdb_client/version.py b/frogpilot/third_party/influxdb_client/version.py deleted file mode 100644 index 9c626c0c..00000000 --- a/frogpilot/third_party/influxdb_client/version.py +++ /dev/null @@ -1,3 +0,0 @@ -"""Version of the Client that is used in User-Agent header.""" - -VERSION = '1.49.0' diff --git a/frogpilot/third_party/kaitaistruct-0.11.dist-info/INSTALLER b/frogpilot/third_party/kaitaistruct-0.11.dist-info/INSTALLER deleted file mode 100644 index a1b589e3..00000000 --- a/frogpilot/third_party/kaitaistruct-0.11.dist-info/INSTALLER +++ /dev/null @@ -1 +0,0 @@ -pip diff --git a/frogpilot/third_party/kaitaistruct-0.11.dist-info/METADATA b/frogpilot/third_party/kaitaistruct-0.11.dist-info/METADATA deleted file mode 100644 index ef94d1b0..00000000 --- a/frogpilot/third_party/kaitaistruct-0.11.dist-info/METADATA +++ /dev/null @@ -1,58 +0,0 @@ -Metadata-Version: 2.4 -Name: kaitaistruct -Version: 0.11 -Summary: Kaitai Struct declarative parser generator for binary data: runtime library for Python -Home-page: https://kaitai.io -Author: Kaitai Project -Author-email: greycat@kaitai.io -License: MIT -Project-URL: Documentation, https://doc.kaitai.io/ -Project-URL: Code, https://github.com/kaitai-io/kaitai_struct_python_runtime -Project-URL: Issues, https://github.com/kaitai-io/kaitai_struct_python_runtime/issues -Project-URL: Gitter, https://gitter.im/kaitai_struct/Lobby -Keywords: kaitai,struct,construct,ksy,declarative,data structure,data format,file format,packet format,binary,parser,parsing,unpack,development -Classifier: Development Status :: 4 - Beta -Classifier: Intended Audience :: Developers -Classifier: Topic :: Software Development :: Build Tools -Classifier: Programming Language :: Python :: 2 -Classifier: Programming Language :: Python :: 2.7 -Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.4 -Classifier: Programming Language :: Python :: 3.5 -Classifier: Programming Language :: Python :: 3.6 -Classifier: Programming Language :: Python :: 3.7 -Classifier: Programming Language :: Python :: 3.8 -Classifier: Programming Language :: Python :: 3.9 -Classifier: Programming Language :: Python :: 3.10 -Classifier: Programming Language :: Python :: 3.11 -Classifier: Programming Language :: Python :: 3.12 -Classifier: Programming Language :: Python :: 3.13 -Classifier: Programming Language :: Python :: Implementation :: CPython -Classifier: Programming Language :: Python :: Implementation :: PyPy -Requires-Python: !=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7 -Description-Content-Type: text/markdown -License-File: LICENSE -Requires-Dist: enum34; python_version < "3.4" -Dynamic: license-file - -# Kaitai Struct: runtime library for Python - -[![PyPI](https://img.shields.io/pypi/v/kaitaistruct)](https://pypi.org/project/kaitaistruct/) -[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/kaitaistruct)](https://pypi.org/project/kaitaistruct/#:~:text=Programming%20Language) - -This library implements Kaitai Struct API for Python. - -[Kaitai Struct](https://kaitai.io/) is a declarative language used for -describe various binary data structures, laid out in files or in memory: -i.e. binary file formats, network stream packet formats, etc. - -It is similar to [Python's Construct 2.10](https://construct.readthedocs.io/en/latest/) -but it is language-agnostic. The format description is done in YAML-based .ksy -format, which then can be compiled into a wide range of target languages. - -Further reading: - -* [About Kaitai Struct](https://kaitai.io/) -* [About API implemented in this library](https://doc.kaitai.io/stream_api.html) -* [Python-specific notes](https://doc.kaitai.io/lang_python.html) in KS - documentation discuss installation and usage of this runtime diff --git a/frogpilot/third_party/kaitaistruct-0.11.dist-info/RECORD b/frogpilot/third_party/kaitaistruct-0.11.dist-info/RECORD deleted file mode 100644 index 9e15154a..00000000 --- a/frogpilot/third_party/kaitaistruct-0.11.dist-info/RECORD +++ /dev/null @@ -1,10 +0,0 @@ -__pycache__/kaitaistruct.cpython-312.pyc,, -kaitaistruct-0.11.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 -kaitaistruct-0.11.dist-info/METADATA,sha256=d-OZJbtKz6uIQQDFkv46CV88wMufyJ5MC141P4YWNcA,2859 -kaitaistruct-0.11.dist-info/RECORD,, -kaitaistruct-0.11.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 -kaitaistruct-0.11.dist-info/WHEEL,sha256=JNWh1Fm1UdwIQV075glCn4MVuCRs0sotJIq-J6rbxCU,109 -kaitaistruct-0.11.dist-info/licenses/LICENSE,sha256=PBj7qLjhxoRuT6GAgq3BtGZolQuynxw-rF3gQiNMO4E,1076 -kaitaistruct-0.11.dist-info/top_level.txt,sha256=qdyEoUwMYARmrbnrV-SRnz3b0yjs0xR_P-r5FrNW_QY,13 -kaitaistruct-0.11.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1 -kaitaistruct.py,sha256=J3FQcdxJ3JFe_u0fYf1hIzvsWmrSr8agZ6pgewxpGjA,34260 diff --git a/frogpilot/third_party/kaitaistruct-0.11.dist-info/REQUESTED b/frogpilot/third_party/kaitaistruct-0.11.dist-info/REQUESTED deleted file mode 100644 index e69de29b..00000000 diff --git a/frogpilot/third_party/kaitaistruct-0.11.dist-info/WHEEL b/frogpilot/third_party/kaitaistruct-0.11.dist-info/WHEEL deleted file mode 100644 index 5f133dbb..00000000 --- a/frogpilot/third_party/kaitaistruct-0.11.dist-info/WHEEL +++ /dev/null @@ -1,6 +0,0 @@ -Wheel-Version: 1.0 -Generator: setuptools (80.9.0) -Root-Is-Purelib: true -Tag: py2-none-any -Tag: py3-none-any - diff --git a/frogpilot/third_party/kaitaistruct-0.11.dist-info/licenses/LICENSE b/frogpilot/third_party/kaitaistruct-0.11.dist-info/licenses/LICENSE deleted file mode 100644 index 416b1e68..00000000 --- a/frogpilot/third_party/kaitaistruct-0.11.dist-info/licenses/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2015-2025 Kaitai Project - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/frogpilot/third_party/kaitaistruct-0.11.dist-info/top_level.txt b/frogpilot/third_party/kaitaistruct-0.11.dist-info/top_level.txt deleted file mode 100644 index 96410c1d..00000000 --- a/frogpilot/third_party/kaitaistruct-0.11.dist-info/top_level.txt +++ /dev/null @@ -1 +0,0 @@ -kaitaistruct diff --git a/frogpilot/third_party/kaitaistruct-0.11.dist-info/zip-safe b/frogpilot/third_party/kaitaistruct-0.11.dist-info/zip-safe deleted file mode 100644 index 8b137891..00000000 --- a/frogpilot/third_party/kaitaistruct-0.11.dist-info/zip-safe +++ /dev/null @@ -1 +0,0 @@ - diff --git a/frogpilot/third_party/reactivex/__init__.py b/frogpilot/third_party/reactivex/__init__.py deleted file mode 100644 index 5f3ff651..00000000 --- a/frogpilot/third_party/reactivex/__init__.py +++ /dev/null @@ -1,1334 +0,0 @@ -# pylint: disable=too-many-lines,redefined-outer-name,redefined-builtin - -from asyncio import Future -from typing import ( - Any, - Callable, - Iterable, - Mapping, - Optional, - Tuple, - TypeVar, - Union, - overload, -) - -from . import abc, typing -from ._version import __version__ -from .internal.utils import alias -from .notification import Notification -from .observable import ConnectableObservable, GroupedObservable, Observable -from .observer import Observer -from .pipe import compose, pipe -from .subject import Subject - -_T = TypeVar("_T") -_T1 = TypeVar("_T1") -_T2 = TypeVar("_T2") -_TKey = TypeVar("_TKey") -_TState = TypeVar("_TState") - -_A = TypeVar("_A") -_B = TypeVar("_B") -_C = TypeVar("_C") -_D = TypeVar("_D") -_E = TypeVar("_E") -_F = TypeVar("_F") -_G = TypeVar("_G") - - -def amb(*sources: Observable[_T]) -> Observable[_T]: - """Propagates the observable sequence that emits first. - - .. marble:: - :alt: amb - - ---8--6--9-----------| - --1--2--3---5--------| - ----------10-20-30---| - [ amb() ] - --1--2--3---5--------| - - Example: - >>> winner = reactivex.amb(xs, ys, zs) - - Args: - sources: Sequence of observables to monitor for first emission. - - Returns: - An observable sequence that surfaces any of the given sequences, - whichever emitted the first element. - """ - - from .observable.amb import amb_ as amb_ - - return amb_(*sources) - - -def case( - mapper: Callable[[], _TKey], - sources: Mapping[_TKey, Observable[_T]], - default_source: Optional[Union[Observable[_T], "Future[_T]"]] = None, -) -> Observable[_T]: - """Uses mapper to determine which source in sources to use. - - .. marble:: - :alt: case - - --1---------------| - a--1--2--3--4--| - b--10-20-30---| - [case(mapper, { 1: a, 2: b })] - ---1--2--3--4--| - - Examples: - >>> res = reactivex.case(mapper, { '1': obs1, '2': obs2 }) - >>> res = reactivex.case(mapper, { '1': obs1, '2': obs2 }, obs0) - - Args: - mapper: The function which extracts the value for to test in a - case statement. - sources: An object which has keys which correspond to the case - statement labels. - default_source: [Optional] The observable sequence or Future that will - be run if the sources are not matched. If this is not provided, - it defaults to :func:`empty`. - - Returns: - An observable sequence which is determined by a case statement. - """ - - from .observable.case import case_ - - return case_(mapper, sources, default_source) - - -def catch(*sources: Observable[_T]) -> Observable[_T]: - """Continues observable sequences which are terminated with an - exception by switching over to the next observable sequence. - - .. marble:: - :alt: catch - - ---1---2---3-* - a-7-8-| - [ catch(a) ] - ---1---2---3---7-8-| - - Examples: - >>> res = reactivex.catch(xs, ys, zs) - - Args: - sources: Sequence of observables. - - Returns: - An observable sequence containing elements from consecutive observables - from the sequence of sources until one of them terminates successfully. - """ - - from .observable.catch import catch_with_iterable_ - - return catch_with_iterable_(sources) - - -def catch_with_iterable(sources: Iterable[Observable[_T]]) -> Observable[_T]: - """Continues observable sequences that are terminated with an - exception by switching over to the next observable sequence. - - .. marble:: - :alt: catch - - ---1---2---3-* - a-7-8-| - [ catch(a) ] - ---1---2---3---7-8-| - - Examples: - >>> res = reactivex.catch([xs, ys, zs]) - >>> res = reactivex.catch(src for src in [xs, ys, zs]) - - Args: - sources: An Iterable of observables; thus, a generator can also - be used here. - - Returns: - An observable sequence containing elements from consecutive observables - from the sequence of sources until one of them terminates successfully. - """ - - from .observable.catch import catch_with_iterable_ - - return catch_with_iterable_(sources) - - -def create(subscribe: typing.Subscription[_T]) -> Observable[_T]: - """Creates an observable sequence object from the specified - subscription function. - - .. marble:: - :alt: create - - [ create(a) ] - ---1---2---3---4---| - - Args: - subscribe: Subscription function. - - Returns: - An observable sequence that can be subscribed to via the given - subscription function. - """ - - return Observable(subscribe) - - -@overload -def combine_latest( - __a: Observable[_A], __b: Observable[_B] -) -> Observable[Tuple[_A, _B]]: ... - - -@overload -def combine_latest( - __a: Observable[_A], __b: Observable[_B], __c: Observable[_C] -) -> Observable[Tuple[_A, _B, _C]]: ... - - -@overload -def combine_latest( - __a: Observable[_A], __b: Observable[_B], __c: Observable[_C], __d: Observable[_D] -) -> Observable[Tuple[_A, _B, _C, _D]]: ... - - -def combine_latest(*__sources: Observable[Any]) -> Observable[Any]: - """Merges the specified observable sequences into one observable - sequence by creating a tuple whenever any of the observable - sequences emits an element. - - .. marble:: - :alt: combine_latest - - ---a-----b--c------| - --1---2--------3---| - [ combine_latest() ] - ---a1-a2-b2-c2-c3--| - - Examples: - >>> obs = rx.combine_latest(obs1, obs2, obs3) - - Args: - sources: Sequence of observables. - - Returns: - An observable sequence containing the result of combining elements from - each source in given sequence. - """ - - from .observable.combinelatest import combine_latest_ - - return combine_latest_(*__sources) - - -def concat(*sources: Observable[_T]) -> Observable[_T]: - """Concatenates all of the specified observable sequences. - - .. marble:: - :alt: concat - - ---1--2--3--| - --6--8--| - [ concat() ] - ---1--2--3----6--8-| - - Examples: - >>> res = reactivex.concat(xs, ys, zs) - - Args: - sources: Sequence of observables. - - Returns: - An observable sequence that contains the elements of each source in - the given sequence, in sequential order. - """ - - from .observable.concat import concat_with_iterable_ - - return concat_with_iterable_(sources) - - -def concat_with_iterable(sources: Iterable[Observable[_T]]) -> Observable[_T]: - """Concatenates all of the specified observable sequences. - - .. marble:: - :alt: concat - - ---1--2--3--| - --6--8--| - [ concat() ] - ---1--2--3----6--8-| - - Examples: - >>> res = reactivex.concat_with_iterable([xs, ys, zs]) - >>> res = reactivex.concat_with_iterable(for src in [xs, ys, zs]) - - Args: - sources: An Iterable of observables; thus, a generator can also - be used here. - - Returns: - An observable sequence that contains the elements of each given - sequence, in sequential order. - """ - - from .observable.concat import concat_with_iterable_ - - return concat_with_iterable_(sources) - - -def defer( - factory: Callable[[abc.SchedulerBase], Union[Observable[_T], "Future[_T]"]], -) -> Observable[_T]: - """Returns an observable sequence that invokes the specified - factory function whenever a new observer subscribes. - - .. marble:: - :alt: defer - - [ defer(1,2,3) ] - ---1--2--3--| - ---1--2--3--| - - Example: - >>> res = reactivex.defer(lambda scheduler: of(1, 2, 3)) - - Args: - factory: Observable factory function to invoke for each observer - which invokes :func:`subscribe() - ` on the resulting sequence. - The factory takes a single argument, the scheduler used. - - Returns: - An observable sequence whose observers trigger an invocation - of the given factory function. - """ - - from .observable.defer import defer_ - - return defer_(factory) - - -def empty(scheduler: Optional[abc.SchedulerBase] = None) -> Observable[Any]: - """Returns an empty observable sequence. - - .. marble:: - :alt: empty - - [ empty() ] - --| - - Example: - >>> obs = reactivex.empty() - - Args: - scheduler: [Optional] Scheduler instance to send the termination call - on. By default, this will use an instance of - :class:`ImmediateScheduler `. - - Returns: - An observable sequence with no elements. - """ - - from .observable.empty import empty_ - - return empty_(scheduler) - - -def for_in( - values: Iterable[_T1], mapper: typing.Mapper[_T1, Observable[_T2]] -) -> Observable[_T2]: - """Concatenates the observable sequences obtained by running the - specified result mapper for each element in the specified values. - - .. marble:: - :alt: for_in - - a--1--2-| - b--10--20-| - [for_in((a, b), lambda i: i+1)] - ---2--3--11--21-| - - - Note: - This is just a wrapper for - :func:`reactivex.concat(map(mapper, values)) ` - - Args: - values: An Iterable of values to turn into an observable - source. - mapper: A function to apply to each item in the values list to turn - it into an observable sequence; this should return instances of - :class:`reactivex.Observable`. - - Returns: - An observable sequence from the concatenated observable - sequences. - """ - - mapped: Iterable[Observable[_T2]] = map(mapper, values) - return concat_with_iterable(mapped) - - -@overload -def fork_join( - __a: Observable[_A], __b: Observable[_B] -) -> Observable[Tuple[_A, _B]]: ... - - -@overload -def fork_join( - __a: Observable[_A], __b: Observable[_B], __c: Observable[_C] -) -> Observable[Tuple[_A, _B, _C]]: ... - - -@overload -def fork_join( - __a: Observable[_A], __b: Observable[_B], __c: Observable[_C], __d: Observable[_D] -) -> Observable[Tuple[_A, _B, _C, _D]]: ... - - -@overload -def fork_join( - __a: Observable[_A], - __b: Observable[_B], - __c: Observable[_C], - __d: Observable[_D], - __e: Observable[_E], -) -> Observable[Tuple[_A, _B, _C, _D, _E]]: ... - - -def fork_join(*sources: Observable[Any]) -> Observable[Any]: - """Wait for observables to complete and then combine last values - they emitted into a tuple. Whenever any of that observables completes - without emitting any value, result sequence will complete at that moment as well. - - .. marble:: - :alt: fork_join - - ---a-----b--c---d-| - --1---2------3-4---| - -a---------b---| - [ fork_join() ] - --------------------d4b| - - Examples: - >>> obs = reactivex.fork_join(obs1, obs2, obs3) - - Args: - sources: Sequence of observables. - - Returns: - An observable sequence containing the result of combining last element from - each source in given sequence. - """ - - from .observable.forkjoin import fork_join_ - - return fork_join_(*sources) - - -def from_callable( - supplier: Callable[[], _T], scheduler: Optional[abc.SchedulerBase] = None -) -> Observable[_T]: - """Returns an observable sequence that contains a single element generated - by the given supplier, using the specified scheduler to send out observer - messages. - - .. marble:: - :alt: from_callable - - [ from_callable() ] - --1--| - - Examples: - >>> res = reactivex.from_callable(lambda: calculate_value()) - >>> res = reactivex.from_callable(lambda: 1 / 0) # emits an error - - Args: - supplier: Function which is invoked to obtain the single element. - scheduler: [Optional] Scheduler instance to schedule the values on. - If not specified, the default is to use an instance of - :class:`CurrentThreadScheduler - `. - - Returns: - An observable sequence containing the single element obtained by - invoking the given supplier function. - """ - - from .observable.returnvalue import from_callable_ - - return from_callable_(supplier, scheduler) - - -def from_callback( - func: Callable[..., Callable[..., None]], - mapper: Optional[typing.Mapper[Any, Any]] = None, -) -> Callable[[], Observable[Any]]: - """Converts a callback function to an observable sequence. - - Args: - func: Function with a callback as the last argument to - convert to an Observable sequence. - mapper: [Optional] A mapper which takes the arguments - from the callback to produce a single item to yield on - next. - - Returns: - A function, when executed with the required arguments minus - the callback, produces an Observable sequence with a single - value of the arguments to the callback as a list. - """ - from .observable.fromcallback import from_callback_ - - return from_callback_(func, mapper) - - -def from_future(future: "Future[_T]") -> Observable[_T]: - """Converts a Future to an Observable sequence - - .. marble:: - :alt: from_future - - [ from_future() ] - ------1| - - Args: - future: A Python 3 compatible future. - https://docs.python.org/3/library/asyncio-task.html#future - - Returns: - An observable sequence which wraps the existing future success - and failure. - """ - from .observable.fromfuture import from_future_ - - return from_future_(future) - - -def from_iterable( - iterable: Iterable[_T], scheduler: Optional[abc.SchedulerBase] = None -) -> Observable[_T]: - """Converts an iterable to an observable sequence. - - .. marble:: - :alt: from_iterable - - [ from_iterable(1,2,3) ] - ---1--2--3--| - - - Example: - >>> reactivex.from_iterable([1,2,3]) - - Args: - iterable: An Iterable to change into an observable sequence. - scheduler: [Optional] Scheduler instance to schedule the values on. - If not specified, the default is to use an instance of - :class:`CurrentThreadScheduler - `. - - Returns: - The observable sequence whose elements are pulled from the - given iterable sequence. - """ - from .observable.fromiterable import from_iterable_ as from_iterable_ - - return from_iterable_(iterable, scheduler) - - -from_ = alias("from_", "Alias for :func:`reactivex.from_iterable`.", from_iterable) -from_list = alias( - "from_list", "Alias for :func:`reactivex.from_iterable`.", from_iterable -) - - -def from_marbles( - string: str, - timespan: typing.RelativeTime = 0.1, - scheduler: Optional[abc.SchedulerBase] = None, - lookup: Optional[Mapping[Union[str, float], Any]] = None, - error: Optional[Exception] = None, -) -> Observable[Any]: - """Convert a marble diagram string to a cold observable sequence, using - an optional scheduler to enumerate the events. - - .. marble:: - :alt: from_marbles - - [ from_marbles(-1-2-3-) ] - -1-2-3-| - - Each character in the string will advance time by timespan - (except for space). Characters that are not special (see the table below) - will be interpreted as a value to be emitted. Numbers will be cast - to int or float. - - Special characters: - +------------+--------------------------------------------------------+ - | :code:`-` | advance time by timespan | - +------------+--------------------------------------------------------+ - | :code:`#` | on_error() | - +------------+--------------------------------------------------------+ - | :code:`|` | on_completed() | - +------------+--------------------------------------------------------+ - | :code:`(` | open a group of marbles sharing the same timestamp | - +------------+--------------------------------------------------------+ - | :code:`)` | close a group of marbles | - +------------+--------------------------------------------------------+ - | :code:`,` | separate elements in a group | - +------------+--------------------------------------------------------+ - | | used to align multiple diagrams, does not advance time | - +------------+--------------------------------------------------------+ - - In a group of elements, the position of the initial :code:`(` determines the - timestamp at which grouped elements will be emitted. - E.g. :code:`--(12,3,4)--` will emit 12, 3, 4 at 2 * timespan and then - advance virtual time by 8 * timespan. - - Examples: - >>> from_marbles('--1--(2,3)-4--|') - >>> from_marbles('a--b--c-', lookup={'a': 1, 'b': 2, 'c': 3}) - >>> from_marbles('a--b---#', error=ValueError('foo')) - - Args: - string: String with marble diagram - timespan: [Optional] Duration of each character in seconds. - If not specified, defaults to :code:`0.1`. - scheduler: [Optional] Scheduler to run the the input sequence - on. If not specified, defaults to the subscribe scheduler - if defined, else to an instance of - :class:`NewThreadScheduler Observable[_TState]: - """Generates an observable sequence by iterating a state from an - initial state until the condition fails. - - .. marble:: - :alt: generate_with_relative_time - - [generate_with_relative_time()] - -1-2-3-4-| - - Example: - >>> res = reactivex.generate_with_relative_time( - 0, lambda x: True, lambda x: x + 1, lambda x: 0.5 - ) - - Args: - initial_state: Initial state. - condition: Condition to terminate generation (upon returning - :code:`False`). - iterate: Iteration step function. - time_mapper: Time mapper function to control the speed of - values being produced each iteration, returning relative times, i.e. - either a :class:`float` denoting seconds, or an instance of - :class:`timedelta`. - - Returns: - The generated sequence. - """ - from .observable.generatewithrelativetime import generate_with_relative_time_ - - return generate_with_relative_time_(initial_state, condition, iterate, time_mapper) - - -def generate( - initial_state: _TState, - condition: typing.Predicate[_TState], - iterate: typing.Mapper[_TState, _TState], -) -> Observable[_TState]: - """Generates an observable sequence by running a state-driven loop - producing the sequence's elements. - - .. marble:: - :alt: generate - - [ generate() ] - -1-2-3-4-| - - Example: - >>> res = reactivex.generate(0, lambda x: x < 10, lambda x: x + 1) - - Args: - initial_state: Initial state. - condition: Condition to terminate generation (upon returning - :code:`False`). - iterate: Iteration step function. - - Returns: - The generated sequence. - """ - from .observable.generate import generate_ - - return generate_(initial_state, condition, iterate) - - -def hot( - string: str, - timespan: typing.RelativeTime = 0.1, - duetime: typing.AbsoluteOrRelativeTime = 0.0, - scheduler: Optional[abc.SchedulerBase] = None, - lookup: Optional[Mapping[Union[str, float], Any]] = None, - error: Optional[Exception] = None, -) -> Observable[Any]: - """Convert a marble diagram string to a hot observable sequence, using - an optional scheduler to enumerate the events. - - .. marble:: - :alt: hot - - [ from_marbles(-1-2-3-) ] - -1-2-3-| - -2-3-| - - Each character in the string will advance time by timespan - (except for space). Characters that are not special (see the table below) - will be interpreted as a value to be emitted. Numbers will be cast - to int or float. - - Special characters: - +------------+--------------------------------------------------------+ - | :code:`-` | advance time by timespan | - +------------+--------------------------------------------------------+ - | :code:`#` | on_error() | - +------------+--------------------------------------------------------+ - | :code:`|` | on_completed() | - +------------+--------------------------------------------------------+ - | :code:`(` | open a group of elements sharing the same timestamp | - +------------+--------------------------------------------------------+ - | :code:`)` | close a group of elements | - +------------+--------------------------------------------------------+ - | :code:`,` | separate elements in a group | - +------------+--------------------------------------------------------+ - | | used to align multiple diagrams, does not advance time | - +------------+--------------------------------------------------------+ - - In a group of elements, the position of the initial :code:`(` determines the - timestamp at which grouped elements will be emitted. - E.g. :code:`--(12,3,4)--` will emit 12, 3, 4 at 2 * timespan and then - advance virtual time by 8 * timespan. - - Examples: - >>> hot("--1--(2,3)-4--|") - >>> hot("a--b--c-", lookup={'a': 1, 'b': 2, 'c': 3}) - >>> hot("a--b---#", error=ValueError("foo")) - - Args: - string: String with marble diagram - timespan: [Optional] Duration of each character in seconds. - If not specified, defaults to :code:`0.1`. - duetime: [Optional] Absolute datetime or timedelta from now that - determines when to start the emission of elements. - scheduler: [Optional] Scheduler to run the the input sequence - on. If not specified, defaults to an instance of - :class:`NewThreadScheduler `. - lookup: [Optional] A dict used to convert an element into a specified - value. If not specified, defaults to :code:`{}`. - error: [Optional] Exception that will be use in place of the :code:`#` - symbol. If not specified, defaults to :code:`Exception('error')`. - - Returns: - The observable sequence whose elements are pulled from the - given marble diagram string. - """ - - from .observable.marbles import hot as _hot - - return _hot( - string, timespan, duetime, lookup=lookup, error=error, scheduler=scheduler - ) - - -def if_then( - condition: Callable[[], bool], - then_source: Union[Observable[_T], "Future[_T]"], - else_source: Union[None, Observable[_T], "Future[_T]"] = None, -) -> Observable[_T]: - """Determines whether an observable collection contains values. - - .. marble:: - :alt: if_then - - ---1--2--3--| - --6--8--| - [ if_then() ] - ---1--2--3--| - - - Examples: - >>> res = reactivex.if_then(condition, obs1) - >>> res = reactivex.if_then(condition, obs1, obs2) - - Args: - condition: The condition which determines if the then_source or - else_source will be run. - then_source: The observable sequence or :class:`Future` that - will be run if the condition function returns :code:`True`. - else_source: [Optional] The observable sequence or :class:`Future` - that will be run if the condition function returns :code:`False`. - If this is not provided, it defaults to :func:`empty() `. - - Returns: - An observable sequence which is either the then_source or - else_source. - """ - from .observable.ifthen import if_then_ - - return if_then_(condition, then_source, else_source) - - -def interval( - period: typing.RelativeTime, scheduler: Optional[abc.SchedulerBase] = None -) -> Observable[int]: - """Returns an observable sequence that produces a value after each period. - - .. marble:: - :alt: interval - - [ interval() ] - ---1---2---3---4---> - - Example: - >>> res = reactivex.interval(1.0) - - Args: - period: Period for producing the values in the resulting sequence - (specified as a :class:`float` denoting seconds or an instance of - :class:`timedelta`). - scheduler: Scheduler to run the interval on. If not specified, an - instance of :class:`TimeoutScheduler ` - is used. - - Returns: - An observable sequence that produces a value after each period. - """ - from .observable.interval import interval_ - - return interval_(period, scheduler) - - -def merge(*sources: Observable[Any]) -> Observable[Any]: - """Merges all the observable sequences into a single observable sequence. - - .. marble:: - :alt: merge - - ---1---2---3---4-| - -a---b---c---d--| - [ merge() ] - -a-1-b-2-c-3-d-4-| - - Example: - >>> res = reactivex.merge(obs1, obs2, obs3) - - Args: - sources: Sequence of observables. - - Returns: - The observable sequence that merges the elements of the - observable sequences. - """ - from .observable.merge import merge_ - - return merge_(*sources) - - -def never() -> Observable[Any]: - """Returns a non-terminating observable sequence, which can be used - to denote an infinite duration (e.g. when using reactive joins). - - .. marble:: - :alt: never - - [ never() ] - --> - - Returns: - An observable sequence whose observers will never get called. - """ - from .observable.never import never_ - - return never_() - - -def of(*args: _T) -> Observable[_T]: - """This method creates a new observable sequence whose elements are taken - from the arguments. - - .. marble:: - :alt: of - - [ of(1,2,3) ] - ---1--2--3--| - - Note: - This is just a wrapper for - :func:`reactivex.from_iterable(args) ` - - Example: - >>> res = reactivex.of(1,2,3) - - Args: - args: The variable number elements to emit from the observable. - - Returns: - The observable sequence whose elements are pulled from the - given arguments - """ - return from_iterable(args) - - -def on_error_resume_next( - *sources: Union[ - Observable[_T], "Future[_T]", Callable[[Optional[Exception]], Observable[_T]] - ], -) -> Observable[_T]: - """Continues an observable sequence that is terminated normally or - by an exception with the next observable sequence. - - .. marble:: - :alt: on_error_resume_next - - --1--2--* - a--3--4--* - b--6-| - [on_error_resume_next(a,b)] - --1--2----3--4----6-| - - Examples: - >>> res = reactivex.on_error_resume_next(xs, ys, zs) - - Args: - sources: Sequence of sources, each of which is expected to be an - instance of either :class:`Observable` or :class:`Future`. - - Returns: - An observable sequence that concatenates the source sequences, - even if a sequence terminates with an exception. - """ - from .observable.onerrorresumenext import on_error_resume_next_ - - return on_error_resume_next_(*sources) - - -def range( - start: int, - stop: Optional[int] = None, - step: Optional[int] = None, - scheduler: Optional[abc.SchedulerBase] = None, -) -> Observable[int]: - """Generates an observable sequence of integral numbers within a - specified range, using the specified scheduler to send out observer - messages. - - .. marble:: - :alt: range - - [ range(4) ] - --0--1--2--3--| - - Examples: - >>> res = reactivex.range(10) - >>> res = reactivex.range(0, 10) - >>> res = reactivex.range(0, 10, 1) - - Args: - start: The value of the first integer in the sequence. - stop: [Optional] Generate number up to (exclusive) the stop - value. Default is `sys.maxsize`. - step: [Optional] The step to be used (default is 1). - scheduler: [Optional] The scheduler to schedule the values on. - If not specified, the default is to use an instance of - :class:`CurrentThreadScheduler - `. - - Returns: - An observable sequence that contains a range of sequential - integral numbers. - """ - from .observable.range import range_ - - return range_(start, stop, step, scheduler) - - -def return_value( - value: _T, scheduler: Optional[abc.SchedulerBase] = None -) -> Observable[_T]: - """Returns an observable sequence that contains a single element, - using the specified scheduler to send out observer messages. - There is an alias called 'just'. - - .. marble:: - :alt: return_value - - [ return_value(4) ] - -4-| - - Examples: - >>> res = reactivex.return_value(42) - >>> res = reactivex.return_value(42, timeout_scheduler) - - Args: - value: Single element in the resulting observable sequence. - - Returns: - An observable sequence containing the single specified element. - """ - from .observable.returnvalue import return_value_ - - return return_value_(value, scheduler) - - -just = alias("just", "Alias for :func:`reactivex.return_value`.", return_value) - - -def repeat_value(value: _T, repeat_count: Optional[int] = None) -> Observable[_T]: - """Generates an observable sequence that repeats the given element - the specified number of times. - - .. marble:: - :alt: repeat_value - - [ repeat_value(4) ] - -4-4-4-4-> - - Examples: - >>> res = reactivex.repeat_value(42) - >>> res = reactivex.repeat_value(42, 4) - - Args: - value: Element to repeat. - repeat_count: [Optional] Number of times to repeat the element. - If not specified, repeats indefinitely. - - Returns: - An observable sequence that repeats the given element the - specified number of times. - """ - from .observable.repeat import repeat_value_ - - return repeat_value_(value, repeat_count) - - -def start( - func: Callable[[], _T], scheduler: Optional[abc.SchedulerBase] = None -) -> Observable[_T]: - """Invokes the specified function asynchronously on the specified - scheduler, surfacing the result through an observable sequence. - - .. marble:: - :alt: start - - [ start(lambda i: return 4) ] - -4-| - -4-| - - Note: - The function is called immediately, not during the subscription - of the resulting sequence. Multiple subscriptions to the - resulting sequence can observe the function's result. - - Example: - >>> res = reactivex.start(lambda: pprint('hello')) - >>> res = reactivex.start(lambda: pprint('hello'), rx.Scheduler.timeout) - - Args: - func: Function to run asynchronously. - scheduler: [Optional] Scheduler to run the function on. If - not specified, defaults to an instance of - :class:`TimeoutScheduler `. - - Returns: - An observable sequence exposing the function's result value, - or an exception. - """ - from .observable.start import start_ - - return start_(func, scheduler) - - -def start_async(function_async: Callable[[], "Future[_T]"]) -> Observable[_T]: - """Invokes the asynchronous function, surfacing the result through - an observable sequence. - - .. marble:: - :alt: start_async - - [ start_async() ] - ------1| - - Args: - function_async: Asynchronous function which returns a :class:`Future` - to run. - - Returns: - An observable sequence exposing the function's result value, - or an exception. - """ - from .observable.startasync import start_async_ - - return start_async_(function_async) - - -def throw( - exception: Union[str, Exception], scheduler: Optional[abc.SchedulerBase] = None -) -> Observable[Any]: - """Returns an observable sequence that terminates with an exception, - using the specified scheduler to send out the single OnError message. - - .. marble:: - :alt: throw - - [ throw() ] - -* - - Example: - >>> res = reactivex.throw(Exception('Error')) - - Args: - exception: An object used for the sequence's termination. - scheduler: [Optional] Scheduler to schedule the error notification on. - If not specified, the default is to use an instance of - :class:`ImmediateScheduler `. - - Returns: - The observable sequence that terminates exceptionally with the - specified exception object. - """ - from .observable.throw import throw_ - - return throw_(exception, scheduler) - - -def timer( - duetime: typing.AbsoluteOrRelativeTime, - period: Optional[typing.RelativeTime] = None, - scheduler: Optional[abc.SchedulerBase] = None, -) -> Observable[int]: - """Returns an observable sequence that produces a value after - duetime has elapsed and then after each period. - - .. marble:: - :alt: timer - - [ timer(2) ] - --0-| - - Examples: - >>> res = reactivex.timer(datetime(...)) - >>> res = reactivex.timer(datetime(...), 0.1) - >>> res = reactivex.timer(5.0) - >>> res = reactivex.timer(5.0, 1.0) - - Args: - duetime: Absolute (specified as a datetime object) or relative time - (specified as a float denoting seconds or an instance of timedelta) - at which to produce the first value. - period: [Optional] Period to produce subsequent values (specified as a - float denoting seconds or an instance of timedelta). - If not specified, the resulting timer is not recurring. - scheduler: [Optional] Scheduler to run the timer on. If not specified, - the default is to use an instance of - :class:`TimeoutScheduler `. - - Returns: - An observable sequence that produces a value after due time has - elapsed and then each period. - """ - from .observable.timer import timer_ - - return timer_(duetime, period, scheduler) - - -def to_async( - func: Callable[..., _T], scheduler: Optional[abc.SchedulerBase] = None -) -> Callable[..., Observable[_T]]: - """Converts the function into an asynchronous function. Each - invocation of the resulting asynchronous function causes an - invocation of the original synchronous function on the specified - scheduler. - - .. marble:: - :alt: to_async - - [ to_async()() ] - ------1| - - Examples: - >>> res = reactivex.to_async(lambda x, y: x + y)(4, 3) - >>> res = reactivex.to_async(lambda x, y: x + y, Scheduler.timeout)(4, 3) - >>> res = reactivex.to_async(lambda x: log.debug(x), Scheduler.timeout)('hello') - - Args: - func: Function to convert to an asynchronous function. - scheduler: [Optional] Scheduler to run the function on. If not - specified, defaults to an instance of - :class:`TimeoutScheduler `. - - Returns: - Asynchronous function. - """ - from .observable.toasync import to_async_ - - return to_async_(func, scheduler) - - -def using( - resource_factory: Callable[[], Optional[abc.DisposableBase]], - observable_factory: Callable[[Optional[abc.DisposableBase]], Observable[_T]], -) -> Observable[_T]: - """Constructs an observable sequence that depends on a resource - object, whose lifetime is tied to the resulting observable - sequence's lifetime. - - Example: - >>> res = reactivex.using(lambda: AsyncSubject(), lambda: s: s) - - Args: - resource_factory: Factory function to obtain a resource object. - observable_factory: Factory function to obtain an observable - sequence that depends on the obtained resource. - - Returns: - An observable sequence whose lifetime controls the lifetime - of the dependent resource object. - """ - from .observable.using import using_ - - return using_(resource_factory, observable_factory) - - -def with_latest_from(*sources: Observable[Any]) -> Observable[Tuple[Any, ...]]: - """Merges the specified observable sequences into one observable - sequence by creating a :class:`tuple` only when the first - observable sequence produces an element. - - .. marble:: - :alt: with_latest_from - - ---1---2---3----4-| - --a-----b----c-d----| - [with_latest_from() ] - ---1,a-2,a-3,b--4,d-| - - Examples: - >>> obs = rx.with_latest_from(obs1) - >>> obs = rx.with_latest_from([obs1, obs2, obs3]) - - Args: - sources: Sequence of observables. - - Returns: - An observable sequence containing the result of combining - elements of the sources into a :class:`tuple`. - """ - from .observable.withlatestfrom import with_latest_from_ - - return with_latest_from_(*sources) - - -def zip(*args: Observable[Any]) -> Observable[Tuple[Any, ...]]: - """Merges the specified observable sequences into one observable - sequence by creating a :class:`tuple` whenever all of the - observable sequences have produced an element at a corresponding - index. - - .. marble:: - :alt: zip - - --1--2---3-----4---| - -a----b----c-d------| - [ zip() ] - --1,a-2,b--3,c-4,d-| - - Example: - >>> res = rx.zip(obs1, obs2) - - Args: - args: Observable sources to zip. - - Returns: - An observable sequence containing the result of combining - elements of the sources as a :class:`tuple`. - """ - from .observable.zip import zip_ - - return zip_(*args) - - -__all__ = [ - "abc", - "amb", - "case", - "catch", - "catch_with_iterable", - "create", - "combine_latest", - "compose", - "concat", - "concat_with_iterable", - "ConnectableObservable", - "defer", - "empty", - "fork_join", - "from_callable", - "from_callback", - "from_future", - "from_iterable", - "GroupedObservable", - "never", - "Notification", - "on_error_resume_next", - "of", - "Observable", - "Observer", - "return_value", - "pipe", - "range", - "repeat_value", - "Subject", - "start", - "start_async", - "throw", - "timer", - "typing", - "to_async", - "using", - "with_latest_from", - "zip", - "__version__", -] diff --git a/frogpilot/third_party/reactivex/_version.py b/frogpilot/third_party/reactivex/_version.py deleted file mode 100644 index 70397087..00000000 --- a/frogpilot/third_party/reactivex/_version.py +++ /dev/null @@ -1 +0,0 @@ -__version__ = "4.1.0" diff --git a/frogpilot/third_party/reactivex/abc/__init__.py b/frogpilot/third_party/reactivex/abc/__init__.py deleted file mode 100644 index 954d5d76..00000000 --- a/frogpilot/third_party/reactivex/abc/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ -from .disposable import DisposableBase -from .observable import ObservableBase, Subscription -from .observer import ObserverBase, OnCompleted, OnError, OnNext -from .periodicscheduler import PeriodicSchedulerBase -from .scheduler import ScheduledAction, SchedulerBase -from .startable import StartableBase -from .subject import SubjectBase - -__all__ = [ - "DisposableBase", - "ObserverBase", - "ObservableBase", - "OnCompleted", - "OnError", - "OnNext", - "SchedulerBase", - "PeriodicSchedulerBase", - "SubjectBase", - "Subscription", - "ScheduledAction", - "StartableBase", -] diff --git a/frogpilot/third_party/reactivex/abc/disposable.py b/frogpilot/third_party/reactivex/abc/disposable.py deleted file mode 100644 index 56ffa84a..00000000 --- a/frogpilot/third_party/reactivex/abc/disposable.py +++ /dev/null @@ -1,34 +0,0 @@ -from __future__ import annotations - -from abc import ABC, abstractmethod -from types import TracebackType -from typing import Optional, Type - - -class DisposableBase(ABC): - """Disposable abstract base class.""" - - __slots__ = () - - @abstractmethod - def dispose(self) -> None: - """Dispose the object: stop whatever we're doing and release all of the - resources we might be using. - """ - raise NotImplementedError - - def __enter__(self) -> DisposableBase: - """Context management protocol.""" - return self - - def __exit__( - self, - exctype: Optional[Type[BaseException]], - excinst: Optional[BaseException], - exctb: Optional[TracebackType], - ) -> None: - """Context management protocol.""" - self.dispose() - - -__all__ = ["DisposableBase"] diff --git a/frogpilot/third_party/reactivex/abc/observable.py b/frogpilot/third_party/reactivex/abc/observable.py deleted file mode 100644 index e1565795..00000000 --- a/frogpilot/third_party/reactivex/abc/observable.py +++ /dev/null @@ -1,45 +0,0 @@ -from abc import ABC, abstractmethod -from typing import Callable, Generic, Optional, TypeVar, Union - -from .disposable import DisposableBase -from .observer import ObserverBase, OnCompleted, OnError, OnNext -from .scheduler import SchedulerBase - -_T_out = TypeVar("_T_out", covariant=True) - - -class ObservableBase(Generic[_T_out], ABC): - """Observable abstract base class. - - Represents a push-style collection.""" - - __slots__ = () - - @abstractmethod - def subscribe( - self, - on_next: Optional[Union[OnNext[_T_out], ObserverBase[_T_out]]] = None, - on_error: Optional[OnError] = None, - on_completed: Optional[OnCompleted] = None, - *, - scheduler: Optional[SchedulerBase] = None, - ) -> DisposableBase: - """Subscribe an observer to the observable sequence. - - Args: - observer: [Optional] The object that is to receive - notifications. - scheduler: [Optional] The default scheduler to use for this - subscription. - - Returns: - Disposable object representing an observer's subscription - to the observable sequence. - """ - - raise NotImplementedError - - -Subscription = Callable[[ObserverBase[_T_out], Optional[SchedulerBase]], DisposableBase] - -__all__ = ["ObservableBase", "Subscription"] diff --git a/frogpilot/third_party/reactivex/abc/observer.py b/frogpilot/third_party/reactivex/abc/observer.py deleted file mode 100644 index 31e48407..00000000 --- a/frogpilot/third_party/reactivex/abc/observer.py +++ /dev/null @@ -1,48 +0,0 @@ -from abc import ABC, abstractmethod -from typing import Callable, Generic, TypeVar - -_T = TypeVar("_T") -_T_in = TypeVar("_T_in", contravariant=True) - -OnNext = Callable[[_T], None] -OnError = Callable[[Exception], None] -OnCompleted = Callable[[], None] - - -class ObserverBase(Generic[_T_in], ABC): - """Observer abstract base class - - An Observer is the entity that receives all emissions of a - subscribed Observable. - """ - - __slots__ = () - - @abstractmethod - def on_next(self, value: _T_in) -> None: - """Notifies the observer of a new element in the sequence. - - Args: - value: The received element. - """ - - raise NotImplementedError - - @abstractmethod - def on_error(self, error: Exception) -> None: - """Notifies the observer that an exception has occurred. - - Args: - error: The error that has occurred. - """ - - raise NotImplementedError - - @abstractmethod - def on_completed(self) -> None: - """Notifies the observer of the end of the sequence.""" - - raise NotImplementedError - - -__all__ = ["ObserverBase", "OnNext", "OnError", "OnCompleted"] diff --git a/frogpilot/third_party/reactivex/abc/periodicscheduler.py b/frogpilot/third_party/reactivex/abc/periodicscheduler.py deleted file mode 100644 index 5d19bc7d..00000000 --- a/frogpilot/third_party/reactivex/abc/periodicscheduler.py +++ /dev/null @@ -1,49 +0,0 @@ -from abc import ABC, abstractmethod -from typing import Callable, Optional, TypeVar, Union - -from .disposable import DisposableBase -from .scheduler import RelativeTime, ScheduledAction - -_TState = TypeVar("_TState") # Can be anything - -ScheduledPeriodicAction = Callable[[Optional[_TState]], Optional[_TState]] -ScheduledSingleOrPeriodicAction = Union[ - ScheduledAction[_TState], ScheduledPeriodicAction[_TState] -] - - -class PeriodicSchedulerBase(ABC): - """PeriodicScheduler abstract base class.""" - - __slots__ = () - - @abstractmethod - def schedule_periodic( - self, - period: RelativeTime, - action: ScheduledPeriodicAction[_TState], - state: Optional[_TState] = None, - ) -> DisposableBase: - """Schedules a periodic piece of work. - - Args: - period: Period in seconds or timedelta for running the - work periodically. - action: Action to be executed. - state: [Optional] Initial state passed to the action upon - the first iteration. - - Returns: - The disposable object used to cancel the scheduled - recurring action (best effort). - """ - - return NotImplemented - - -__all__ = [ - "PeriodicSchedulerBase", - "ScheduledPeriodicAction", - "ScheduledSingleOrPeriodicAction", - "RelativeTime", -] diff --git a/frogpilot/third_party/reactivex/abc/scheduler.py b/frogpilot/third_party/reactivex/abc/scheduler.py deleted file mode 100644 index 14f2ef90..00000000 --- a/frogpilot/third_party/reactivex/abc/scheduler.py +++ /dev/null @@ -1,152 +0,0 @@ -from abc import ABC, abstractmethod -from datetime import datetime, timedelta -from typing import Callable, Optional, TypeVar, Union - -from .disposable import DisposableBase - -_TState = TypeVar("_TState") # Can be anything - -AbsoluteTime = Union[datetime, float] -RelativeTime = Union[timedelta, float] -AbsoluteOrRelativeTime = Union[datetime, timedelta, float] -ScheduledAction = Callable[ - ["SchedulerBase", Optional[_TState]], - Optional[DisposableBase], -] - - -class SchedulerBase(ABC): - """Scheduler abstract base class.""" - - __slots__ = () - - @property - @abstractmethod - def now(self) -> datetime: - """Represents a notion of time for this scheduler. Tasks being - scheduled on a scheduler will adhere to the time denoted by this - property. - - Returns: - The scheduler's current time, as a datetime instance. - """ - - return NotImplemented - - @abstractmethod - def schedule( - self, action: ScheduledAction[_TState], state: Optional[_TState] = None - ) -> DisposableBase: - """Schedules an action to be executed. - - Args: - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - return NotImplemented - - @abstractmethod - def schedule_relative( - self, - duetime: RelativeTime, - action: ScheduledAction[_TState], - state: Optional[_TState] = None, - ) -> DisposableBase: - """Schedules an action to be executed after duetime. - - Args: - duetime: Relative time after which to execute the action. - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - return NotImplemented - - @abstractmethod - def schedule_absolute( - self, - duetime: AbsoluteTime, - action: ScheduledAction[_TState], - state: Optional[_TState] = None, - ) -> DisposableBase: - """Schedules an action to be executed at duetime. - - Args: - duetime: Absolute time at which to execute the action. - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - return NotImplemented - - @classmethod - @abstractmethod - def to_seconds(cls, value: AbsoluteOrRelativeTime) -> float: - """Converts time value to seconds. This method handles both absolute - (datetime) and relative (timedelta) values. If the argument is already - a float, it is simply returned unchanged. - - Args: - value: the time value to convert to seconds. - - Returns: - The value converted to seconds. - """ - - return NotImplemented - - @classmethod - @abstractmethod - def to_datetime(cls, value: AbsoluteOrRelativeTime) -> datetime: - """Converts time value to datetime. This method handles both absolute - (float) and relative (timedelta) values. If the argument is already - a datetime, it is simply returned unchanged. - - Args: - value: the time value to convert to datetime. - - Returns: - The value converted to datetime. - """ - - return NotImplemented - - @classmethod - @abstractmethod - def to_timedelta(cls, value: AbsoluteOrRelativeTime) -> timedelta: - """Converts time value to timedelta. This method handles both absolute - (datetime) and relative (float) values. If the argument is already - a timedelta, it is simply returned unchanged. If the argument is an - absolute time, the result value will be the timedelta since the epoch, - January 1st, 1970, 00:00:00. - - Args: - value: the time value to convert to timedelta. - - Returns: - The value converted to timedelta. - """ - - return NotImplemented - - -__all__ = [ - "SchedulerBase", - "AbsoluteTime", - "RelativeTime", - "AbsoluteOrRelativeTime", - "ScheduledAction", -] diff --git a/frogpilot/third_party/reactivex/abc/startable.py b/frogpilot/third_party/reactivex/abc/startable.py deleted file mode 100644 index 031bbf1a..00000000 --- a/frogpilot/third_party/reactivex/abc/startable.py +++ /dev/null @@ -1,14 +0,0 @@ -from abc import ABC, abstractmethod - - -class StartableBase(ABC): - """Abstract base class for Thread- and Process-like objects.""" - - __slots__ = () - - @abstractmethod - def start(self) -> None: - raise NotImplementedError - - -__all__ = ["StartableBase"] diff --git a/frogpilot/third_party/reactivex/abc/subject.py b/frogpilot/third_party/reactivex/abc/subject.py deleted file mode 100644 index 9ffef35e..00000000 --- a/frogpilot/third_party/reactivex/abc/subject.py +++ /dev/null @@ -1,72 +0,0 @@ -from abc import abstractmethod -from typing import Optional, TypeVar, Union - -from .disposable import DisposableBase -from .observable import ObservableBase -from .observer import ObserverBase, OnCompleted, OnError, OnNext -from .scheduler import SchedulerBase - -_T = TypeVar("_T") - - -class SubjectBase(ObserverBase[_T], ObservableBase[_T]): - """Subject abstract base class. - - Represents an object that is both an observable sequence as well - as an observer. - """ - - __slots__ = () - - @abstractmethod - def subscribe( - self, - on_next: Optional[Union[OnNext[_T], ObserverBase[_T]]] = None, - on_error: Optional[OnError] = None, - on_completed: Optional[OnCompleted] = None, - *, - scheduler: Optional[SchedulerBase] = None, - ) -> DisposableBase: - """Subscribe an observer to the observable sequence. - - Args: - observer: [Optional] The object that is to receive - notifications. - scheduler: [Optional] The default scheduler to use for this - subscription. - - Returns: - Disposable object representing an observer's subscription - to the observable sequence. - """ - - raise NotImplementedError - - @abstractmethod - def on_next(self, value: _T) -> None: - """Notifies the observer of a new element in the sequence. - - Args: - value: The received element. - """ - - raise NotImplementedError - - @abstractmethod - def on_error(self, error: Exception) -> None: - """Notifies the observer that an exception has occurred. - - Args: - error: The error that has occurred. - """ - - raise NotImplementedError - - @abstractmethod - def on_completed(self) -> None: - """Notifies the observer of the end of the sequence.""" - - raise NotImplementedError - - -__all__ = ["SubjectBase"] diff --git a/frogpilot/third_party/reactivex/disposable/__init__.py b/frogpilot/third_party/reactivex/disposable/__init__.py deleted file mode 100644 index a1cbfc75..00000000 --- a/frogpilot/third_party/reactivex/disposable/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -from .booleandisposable import BooleanDisposable -from .compositedisposable import CompositeDisposable -from .disposable import Disposable -from .multipleassignmentdisposable import MultipleAssignmentDisposable -from .refcountdisposable import RefCountDisposable -from .scheduleddisposable import ScheduledDisposable -from .serialdisposable import SerialDisposable -from .singleassignmentdisposable import SingleAssignmentDisposable - -__all__ = [ - "BooleanDisposable", - "CompositeDisposable", - "Disposable", - "MultipleAssignmentDisposable", - "RefCountDisposable", - "ScheduledDisposable", - "SerialDisposable", - "SingleAssignmentDisposable", -] diff --git a/frogpilot/third_party/reactivex/disposable/booleandisposable.py b/frogpilot/third_party/reactivex/disposable/booleandisposable.py deleted file mode 100644 index 578da2e9..00000000 --- a/frogpilot/third_party/reactivex/disposable/booleandisposable.py +++ /dev/null @@ -1,20 +0,0 @@ -from threading import RLock - -from reactivex.abc import DisposableBase - - -class BooleanDisposable(DisposableBase): - """Represents a Disposable that can be checked for status.""" - - def __init__(self) -> None: - """Initializes a new instance of the BooleanDisposable class.""" - - self.is_disposed = False - self.lock = RLock() - - super().__init__() - - def dispose(self) -> None: - """Sets the status to disposed""" - - self.is_disposed = True diff --git a/frogpilot/third_party/reactivex/disposable/compositedisposable.py b/frogpilot/third_party/reactivex/disposable/compositedisposable.py deleted file mode 100644 index 38d8ac5f..00000000 --- a/frogpilot/third_party/reactivex/disposable/compositedisposable.py +++ /dev/null @@ -1,103 +0,0 @@ -from threading import RLock -from typing import Any, List - -from reactivex import abc - - -class CompositeDisposable(abc.DisposableBase): - """Represents a group of disposable resources that are disposed - together""" - - def __init__(self, *args: Any): - if args and isinstance(args[0], list): - self.disposable: List[abc.DisposableBase] = args[0] - else: - self.disposable = list(args) - - self.is_disposed = False - self.lock = RLock() - super(CompositeDisposable, self).__init__() - - def add(self, item: abc.DisposableBase) -> None: - """Adds a disposable to the CompositeDisposable or disposes the - disposable if the CompositeDisposable is disposed - - Args: - item: Disposable to add.""" - - should_dispose = False - with self.lock: - if self.is_disposed: - should_dispose = True - else: - self.disposable.append(item) - - if should_dispose: - item.dispose() - - def remove(self, item: abc.DisposableBase) -> bool: - """Removes and disposes the first occurrence of a disposable - from the CompositeDisposable.""" - - if self.is_disposed: - return False - - should_dispose = False - with self.lock: - if item in self.disposable: - self.disposable.remove(item) - should_dispose = True - - if should_dispose: - item.dispose() - - return should_dispose - - def dispose(self) -> None: - """Disposes all disposable in the group and removes them from - the group.""" - - if self.is_disposed: - return - - with self.lock: - self.is_disposed = True - current_disposable = self.disposable - self.disposable = [] - - for disp in current_disposable: - disp.dispose() - - def clear(self) -> None: - """Removes and disposes all disposable from the - CompositeDisposable, but does not dispose the - CompositeDisposable.""" - - with self.lock: - current_disposable = self.disposable - self.disposable = [] - - for disposable in current_disposable: - disposable.dispose() - - def contains(self, item: abc.DisposableBase) -> bool: - """Determines whether the CompositeDisposable contains a specific - disposable. - - Args: - item: Disposable to search for - - Returns: - True if the disposable was found; otherwise, False""" - - return item in self.disposable - - def to_list(self) -> List[abc.DisposableBase]: - return self.disposable[:] - - def __len__(self) -> int: - return len(self.disposable) - - @property - def length(self) -> int: - return len(self.disposable) diff --git a/frogpilot/third_party/reactivex/disposable/disposable.py b/frogpilot/third_party/reactivex/disposable/disposable.py deleted file mode 100644 index 625e2ee0..00000000 --- a/frogpilot/third_party/reactivex/disposable/disposable.py +++ /dev/null @@ -1,43 +0,0 @@ -from threading import RLock -from typing import Optional - -from reactivex import typing -from reactivex.abc import DisposableBase -from reactivex.internal import noop -from reactivex.typing import Action - - -class Disposable(DisposableBase): - """Main disposable class""" - - def __init__(self, action: Optional[typing.Action] = None) -> None: - """Creates a disposable object that invokes the specified - action when disposed. - - Args: - action: Action to run during the first call to dispose. - The action is guaranteed to be run at most once. - - Returns: - The disposable object that runs the given action upon - disposal. - """ - - self.is_disposed = False - self.action: Action = action or noop - - self.lock = RLock() - - super().__init__() - - def dispose(self) -> None: - """Performs the task of cleaning up resources.""" - - dispose = False - with self.lock: - if not self.is_disposed: - dispose = True - self.is_disposed = True - - if dispose: - self.action() diff --git a/frogpilot/third_party/reactivex/disposable/multipleassignmentdisposable.py b/frogpilot/third_party/reactivex/disposable/multipleassignmentdisposable.py deleted file mode 100644 index dc06c9c7..00000000 --- a/frogpilot/third_party/reactivex/disposable/multipleassignmentdisposable.py +++ /dev/null @@ -1,49 +0,0 @@ -from threading import RLock -from typing import Optional - -from reactivex.abc import DisposableBase - - -class MultipleAssignmentDisposable(DisposableBase): - """Represents a disposable resource whose underlying disposable - resource can be replaced by another disposable resource.""" - - def __init__(self) -> None: - self.current: Optional[DisposableBase] = None - self.is_disposed = False - self.lock = RLock() - - super().__init__() - - def get_disposable(self) -> Optional[DisposableBase]: - return self.current - - def set_disposable(self, value: DisposableBase) -> None: - """If the MultipleAssignmentDisposable has already been - disposed, assignment to this property causes immediate disposal - of the given disposable object.""" - - with self.lock: - should_dispose = self.is_disposed - if not should_dispose: - self.current = value - - if should_dispose: - value.dispose() - - disposable = property(get_disposable, set_disposable) - - def dispose(self) -> None: - """Disposes the underlying disposable as well as all future - replacements.""" - - old = None - - with self.lock: - if not self.is_disposed: - self.is_disposed = True - old = self.current - self.current = None - - if old is not None: - old.dispose() diff --git a/frogpilot/third_party/reactivex/disposable/refcountdisposable.py b/frogpilot/third_party/reactivex/disposable/refcountdisposable.py deleted file mode 100644 index d86dede9..00000000 --- a/frogpilot/third_party/reactivex/disposable/refcountdisposable.py +++ /dev/null @@ -1,82 +0,0 @@ -from threading import RLock -from typing import Optional - -from reactivex.abc import DisposableBase - -from .disposable import Disposable - - -class RefCountDisposable(DisposableBase): - """Represents a disposable resource that only disposes its underlying - disposable resource when all dependent disposable objects have been - disposed.""" - - class InnerDisposable(DisposableBase): - def __init__(self, parent: "RefCountDisposable") -> None: - self.parent: Optional[RefCountDisposable] = parent - self.is_disposed = False - self.lock = RLock() - - def dispose(self) -> None: - with self.lock: - parent = self.parent - self.parent = None - - if parent is not None: - parent.release() - - def __init__(self, disposable: DisposableBase) -> None: - """Initializes a new instance of the RefCountDisposable class with the - specified disposable.""" - - self.underlying_disposable = disposable - self.is_primary_disposed = False - self.is_disposed = False - self.lock = RLock() - self.count = 0 - - super().__init__() - - def dispose(self) -> None: - """Disposes the underlying disposable only when all dependent - disposable have been disposed.""" - - if self.is_disposed: - return - - underlying_disposable = None - with self.lock: - if not self.is_primary_disposed: - self.is_primary_disposed = True - if not self.count: - self.is_disposed = True - underlying_disposable = self.underlying_disposable - - if underlying_disposable is not None: - underlying_disposable.dispose() - - def release(self) -> None: - if self.is_disposed: - return - - should_dispose = False - with self.lock: - self.count -= 1 - if not self.count and self.is_primary_disposed: - self.is_disposed = True - should_dispose = True - - if should_dispose: - self.underlying_disposable.dispose() - - @property - def disposable(self) -> DisposableBase: - """Returns a dependent disposable that when disposed decreases the - refcount on the underlying disposable.""" - - with self.lock: - if self.is_disposed: - return Disposable() - - self.count += 1 - return self.InnerDisposable(self) diff --git a/frogpilot/third_party/reactivex/disposable/scheduleddisposable.py b/frogpilot/third_party/reactivex/disposable/scheduleddisposable.py deleted file mode 100644 index 067d8667..00000000 --- a/frogpilot/third_party/reactivex/disposable/scheduleddisposable.py +++ /dev/null @@ -1,38 +0,0 @@ -from threading import RLock -from typing import Any - -from reactivex import abc - -from .singleassignmentdisposable import SingleAssignmentDisposable - - -class ScheduledDisposable(abc.DisposableBase): - """Represents a disposable resource whose disposal invocation will - be scheduled on the specified Scheduler""" - - def __init__( - self, scheduler: abc.SchedulerBase, disposable: abc.DisposableBase - ) -> None: - """Initializes a new instance of the ScheduledDisposable class - that uses a Scheduler on which to dispose the disposable.""" - - self.scheduler = scheduler - self.disposable = SingleAssignmentDisposable() - self.disposable.disposable = disposable - self.lock = RLock() - - super().__init__() - - @property - def is_disposed(self) -> bool: - return self.disposable.is_disposed - - def dispose(self) -> None: - """Disposes the wrapped disposable on the provided scheduler.""" - - def action(scheduler: abc.SchedulerBase, state: Any) -> None: - """Scheduled dispose action""" - - self.disposable.dispose() - - self.scheduler.schedule(action) diff --git a/frogpilot/third_party/reactivex/disposable/serialdisposable.py b/frogpilot/third_party/reactivex/disposable/serialdisposable.py deleted file mode 100644 index 315efe79..00000000 --- a/frogpilot/third_party/reactivex/disposable/serialdisposable.py +++ /dev/null @@ -1,58 +0,0 @@ -from threading import RLock -from typing import Optional - -from reactivex import abc - - -class SerialDisposable(abc.DisposableBase): - """Represents a disposable resource whose underlying disposable - resource can be replaced by another disposable resource, causing - automatic disposal of the previous underlying disposable resource. - """ - - def __init__(self) -> None: - self.current: Optional[abc.DisposableBase] = None - self.is_disposed = False - self.lock = RLock() - - super().__init__() - - def get_disposable(self) -> Optional[abc.DisposableBase]: - return self.current - - def set_disposable(self, value: abc.DisposableBase) -> None: - """If the SerialDisposable has already been disposed, assignment - to this property causes immediate disposal of the given - disposable object. Assigning this property disposes the previous - disposable object.""" - - old: Optional[abc.DisposableBase] = None - - with self.lock: - should_dispose = self.is_disposed - if not should_dispose: - old = self.current - self.current = value - - if old is not None: - old.dispose() - - if should_dispose: - value.dispose() - - disposable = property(get_disposable, set_disposable) - - def dispose(self) -> None: - """Disposes the underlying disposable as well as all future - replacements.""" - - old: Optional[abc.DisposableBase] = None - - with self.lock: - if not self.is_disposed: - self.is_disposed = True - old = self.current - self.current = None - - if old is not None: - old.dispose() diff --git a/frogpilot/third_party/reactivex/disposable/singleassignmentdisposable.py b/frogpilot/third_party/reactivex/disposable/singleassignmentdisposable.py deleted file mode 100644 index a1c84039..00000000 --- a/frogpilot/third_party/reactivex/disposable/singleassignmentdisposable.py +++ /dev/null @@ -1,53 +0,0 @@ -from threading import RLock -from typing import Optional - -from reactivex.abc import DisposableBase - - -class SingleAssignmentDisposable(DisposableBase): - """Single assignment disposable. - - Represents a disposable resource which only allows a single - assignment of its underlying disposable resource. If an underlying - disposable resource has already been set, future attempts to set the - underlying disposable resource will throw an Error.""" - - def __init__(self) -> None: - """Initializes a new instance of the SingleAssignmentDisposable - class. - """ - self.is_disposed: bool = False - self.current: Optional[DisposableBase] = None - self.lock = RLock() - - super().__init__() - - def get_disposable(self) -> Optional[DisposableBase]: - return self.current - - def set_disposable(self, value: DisposableBase) -> None: - if self.current: - raise Exception("Disposable has already been assigned") - - with self.lock: - should_dispose = self.is_disposed - if not should_dispose: - self.current = value - - if self.is_disposed and value: - value.dispose() - - disposable = property(get_disposable, set_disposable) - - def dispose(self) -> None: - """Sets the status to disposed""" - old: Optional[DisposableBase] = None - - with self.lock: - if not self.is_disposed: - self.is_disposed = True - old = self.current - self.current = None - - if old is not None: - old.dispose() diff --git a/frogpilot/third_party/reactivex/internal/__init__.py b/frogpilot/third_party/reactivex/internal/__init__.py deleted file mode 100644 index 02986429..00000000 --- a/frogpilot/third_party/reactivex/internal/__init__.py +++ /dev/null @@ -1,29 +0,0 @@ -from .basic import default_comparer, default_error, noop -from .concurrency import default_thread_factory, synchronized -from .constants import DELTA_ZERO, UTC_ZERO -from .exceptions import ( - ArgumentOutOfRangeException, - DisposedException, - SequenceContainsNoElementsError, -) -from .priorityqueue import PriorityQueue -from .utils import NotSet, add_ref, alias, infinite - -__all__ = [ - "add_ref", - "alias", - "ArgumentOutOfRangeException", - "DisposedException", - "default_comparer", - "default_error", - "infinite", - "noop", - "NotSet", - "SequenceContainsNoElementsError", - "concurrency", - "DELTA_ZERO", - "UTC_ZERO", - "synchronized", - "default_thread_factory", - "PriorityQueue", -] diff --git a/frogpilot/third_party/reactivex/internal/basic.py b/frogpilot/third_party/reactivex/internal/basic.py deleted file mode 100644 index d7f043c1..00000000 --- a/frogpilot/third_party/reactivex/internal/basic.py +++ /dev/null @@ -1,36 +0,0 @@ -from datetime import datetime, timezone -from typing import Any, NoReturn, TypeVar, Union - -_T = TypeVar("_T") - - -def noop(*args: Any, **kw: Any) -> None: - """No operation. Returns nothing""" - - -def identity(x: _T) -> _T: - """Returns argument x""" - return x - - -def default_now() -> datetime: - return datetime.now(timezone.utc) - - -def default_comparer(x: _T, y: _T) -> bool: - return x == y - - -def default_sub_comparer(x: Any, y: Any) -> Any: - return x - y - - -def default_key_serializer(x: Any) -> str: - return str(x) - - -def default_error(err: Union[Exception, str]) -> NoReturn: - if isinstance(err, BaseException): - raise err - - raise Exception(err) diff --git a/frogpilot/third_party/reactivex/internal/concurrency.py b/frogpilot/third_party/reactivex/internal/concurrency.py deleted file mode 100644 index 12db952f..00000000 --- a/frogpilot/third_party/reactivex/internal/concurrency.py +++ /dev/null @@ -1,26 +0,0 @@ -from threading import RLock, Thread -from typing import Any, Callable, TypeVar - -from typing_extensions import ParamSpec - -from reactivex.typing import StartableTarget - -_T = TypeVar("_T") -_P = ParamSpec("_P") - - -def default_thread_factory(target: StartableTarget) -> Thread: - return Thread(target=target, daemon=True) - - -def synchronized(lock: RLock) -> Callable[[Callable[_P, _T]], Callable[_P, _T]]: - """A decorator for synchronizing access to a given function.""" - - def wrapper(fn: Callable[_P, _T]) -> Callable[_P, _T]: - def inner(*args: _P.args, **kw: _P.kwargs) -> Any: - with lock: - return fn(*args, **kw) - - return inner - - return wrapper diff --git a/frogpilot/third_party/reactivex/internal/constants.py b/frogpilot/third_party/reactivex/internal/constants.py deleted file mode 100644 index b2e186eb..00000000 --- a/frogpilot/third_party/reactivex/internal/constants.py +++ /dev/null @@ -1,4 +0,0 @@ -from datetime import datetime, timedelta, timezone - -DELTA_ZERO = timedelta(0) -UTC_ZERO = datetime.fromtimestamp(0, tz=timezone.utc) diff --git a/frogpilot/third_party/reactivex/internal/exceptions.py b/frogpilot/third_party/reactivex/internal/exceptions.py deleted file mode 100644 index 53b18a85..00000000 --- a/frogpilot/third_party/reactivex/internal/exceptions.py +++ /dev/null @@ -1,36 +0,0 @@ -# Rx Exceptions - - -from typing import Optional - - -class SequenceContainsNoElementsError(Exception): - def __init__(self, msg: Optional[str] = None): - super().__init__(msg or "Sequence contains no elements") - - -class ArgumentOutOfRangeException(ValueError): - def __init__(self, msg: Optional[str] = None): - super(ArgumentOutOfRangeException, self).__init__( - msg or "Argument out of range" - ) - - -class DisposedException(Exception): - def __init__(self, msg: Optional[str] = None): - super().__init__(msg or "Object has been disposed") - - -class ReEntracyException(Exception): - def __init__(self, msg: Optional[str] = None): - super().__init__(msg or "Re-entrancy detected") - - -class CompletedException(Exception): - def __init__(self, msg: Optional[str] = None): - super().__init__(msg or "Observer completed") - - -class WouldBlockException(Exception): - def __init__(self, msg: Optional[str] = None): - super().__init__(msg or "Would block") diff --git a/frogpilot/third_party/reactivex/internal/priorityqueue.py b/frogpilot/third_party/reactivex/internal/priorityqueue.py deleted file mode 100644 index 83a4c8ac..00000000 --- a/frogpilot/third_party/reactivex/internal/priorityqueue.py +++ /dev/null @@ -1,54 +0,0 @@ -import heapq -from sys import maxsize -from typing import Generic, List, Tuple, TypeVar - -_T1 = TypeVar("_T1") - - -class PriorityQueue(Generic[_T1]): - """Priority queue for scheduling. Note that methods aren't thread-safe.""" - - MIN_COUNT = ~maxsize - - def __init__(self) -> None: - self.items: List[Tuple[_T1, int]] = [] - self.count = PriorityQueue.MIN_COUNT # Monotonic increasing for sort stability - - def __len__(self) -> int: - """Returns length of queue""" - - return len(self.items) - - def peek(self) -> _T1: - """Returns first item in queue without removing it""" - return self.items[0][0] - - def dequeue(self) -> _T1: - """Returns and removes item with lowest priority from queue""" - - item: _T1 = heapq.heappop(self.items)[0] - if not self.items: - self.count = PriorityQueue.MIN_COUNT - return item - - def enqueue(self, item: _T1) -> None: - """Adds item to queue""" - - heapq.heappush(self.items, (item, self.count)) - self.count += 1 - - def remove(self, item: _T1) -> bool: - """Remove given item from queue""" - - for index, _item in enumerate(self.items): - if _item[0] == item: - self.items.pop(index) - heapq.heapify(self.items) - return True - - return False - - def clear(self) -> None: - """Remove all items from the queue.""" - self.items = [] - self.count = PriorityQueue.MIN_COUNT diff --git a/frogpilot/third_party/reactivex/internal/utils.py b/frogpilot/third_party/reactivex/internal/utils.py deleted file mode 100644 index 1f517c6f..00000000 --- a/frogpilot/third_party/reactivex/internal/utils.py +++ /dev/null @@ -1,61 +0,0 @@ -from functools import update_wrapper -from types import FunctionType -from typing import TYPE_CHECKING, Any, Callable, Iterable, Optional, TypeVar, cast - -from typing_extensions import ParamSpec - -from reactivex import abc -from reactivex.disposable import CompositeDisposable -from reactivex.disposable.refcountdisposable import RefCountDisposable - -if TYPE_CHECKING: - from reactivex import Observable - -_T = TypeVar("_T") -_P = ParamSpec("_P") - - -def add_ref(xs: "Observable[_T]", r: RefCountDisposable) -> "Observable[_T]": - from reactivex import Observable - - def subscribe( - observer: abc.ObserverBase[Any], scheduler: Optional[abc.SchedulerBase] = None - ) -> abc.DisposableBase: - return CompositeDisposable(r.disposable, xs.subscribe(observer)) - - return Observable(subscribe) - - -def infinite() -> Iterable[int]: - n = 0 - while True: - yield n - n += 1 - - -def alias(name: str, doc: str, fun: Callable[_P, _T]) -> Callable[_P, _T]: - # Adapted from - # https://stackoverflow.com/questions/13503079/how-to-create-a-copy-of-a-python-function# - # See also help(type(lambda: 0)) - _fun = cast(FunctionType, fun) - args = (_fun.__code__, _fun.__globals__) - kwargs = {"name": name, "argdefs": _fun.__defaults__, "closure": _fun.__closure__} - alias_ = FunctionType(*args, **kwargs) # type: ignore - alias_ = update_wrapper(alias_, _fun) # type: ignore - alias_.__kwdefaults__ = _fun.__kwdefaults__ # type: ignore - alias_.__doc__ = doc - alias_.__annotations__ = _fun.__annotations__ - return cast(Callable[_P, _T], alias_) - - -class NotSet: - """Sentinel value.""" - - def __eq__(self, other: Any) -> bool: - return self is other - - def __repr__(self) -> str: - return "NotSet" - - -__all__ = ["add_ref", "infinite", "alias", "NotSet"] diff --git a/frogpilot/third_party/reactivex/notification.py b/frogpilot/third_party/reactivex/notification.py deleted file mode 100644 index b442d33f..00000000 --- a/frogpilot/third_party/reactivex/notification.py +++ /dev/null @@ -1,205 +0,0 @@ -from abc import abstractmethod -from typing import Any, Callable, Generic, Optional, TypeVar, Union - -from reactivex import abc, typing -from reactivex.scheduler import ImmediateScheduler - -from .observable import Observable -from .observer import Observer - -_T = TypeVar("_T") - - -class Notification(Generic[_T]): - """Represents a notification to an observer.""" - - def __init__(self) -> None: - """Default constructor used by derived types.""" - self.has_value = False - self.value: _T - self.kind: str = "" - - def accept( - self, - on_next: Union[typing.OnNext[_T], abc.ObserverBase[_T]], - on_error: Optional[typing.OnError] = None, - on_completed: Optional[typing.OnCompleted] = None, - ) -> None: - """Invokes the delegate corresponding to the notification or an - observer and returns the produced result. - - Examples: - >>> notification.accept(observer) - >>> notification.accept(on_next, on_error, on_completed) - - Args: - on_next: Delegate to invoke for an OnNext notification. - on_error: [Optional] Delegate to invoke for an OnError - notification. - on_completed: [Optional] Delegate to invoke for an - OnCompleted notification. - - Returns: - Result produced by the observation.""" - - if isinstance(on_next, abc.ObserverBase): - return self._accept_observer(on_next) - - return self._accept(on_next, on_error, on_completed) - - @abstractmethod - def _accept( - self, - on_next: typing.OnNext[_T], - on_error: Optional[typing.OnError], - on_completed: Optional[typing.OnCompleted], - ) -> None: - raise NotImplementedError - - @abstractmethod - def _accept_observer(self, observer: abc.ObserverBase[_T]) -> None: - raise NotImplementedError - - def to_observable( - self, scheduler: Optional[abc.SchedulerBase] = None - ) -> abc.ObservableBase[_T]: - """Returns an observable sequence with a single notification, - using the specified scheduler, else the immediate scheduler. - - Args: - scheduler: [Optional] Scheduler to send out the - notification calls on. - - Returns: - An observable sequence that surfaces the behavior of the - notification upon subscription. - """ - - _scheduler = scheduler or ImmediateScheduler.singleton() - - def subscribe( - observer: abc.ObserverBase[_T], - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - def action(scheduler: abc.SchedulerBase, state: Any) -> None: - self._accept_observer(observer) - if self.kind == "N": - observer.on_completed() - - __scheduler = scheduler or _scheduler - return __scheduler.schedule(action) - - return Observable(subscribe) - - def equals(self, other: "Notification[_T]") -> bool: - """Indicates whether this instance and a specified object are - equal.""" - - other_string = "" if not other else str(other) - return str(self) == other_string - - def __eq__(self, other: Any) -> bool: - return self.equals(other) - - -class OnNext(Notification[_T]): - """Represents an OnNext notification to an observer.""" - - def __init__(self, value: _T) -> None: - """Constructs a notification of a new value.""" - - super(OnNext, self).__init__() - self.value: _T = value - self.has_value: bool = True - self.kind: str = "N" - - def _accept( - self, - on_next: typing.OnNext[_T], - on_error: Optional[typing.OnError] = None, - on_completed: Optional[typing.OnCompleted] = None, - ) -> None: - return on_next(self.value) - - def _accept_observer(self, observer: abc.ObserverBase[_T]) -> None: - return observer.on_next(self.value) - - def __str__(self) -> str: - val: Any = self.value - if isinstance(val, int): - val = float(val) - return "OnNext(%s)" % str(val) - - -class OnError(Notification[_T]): - """Represents an OnError notification to an observer.""" - - def __init__(self, error: Union[Exception, str]) -> None: - """Constructs a notification of an exception.""" - - super(OnError, self).__init__() - self.exception: Exception = ( - error if isinstance(error, Exception) else Exception(error) - ) - self.kind = "E" - - def _accept( - self, - on_next: typing.OnNext[_T], - on_error: Optional[typing.OnError], - on_completed: Optional[typing.OnCompleted], - ) -> None: - return on_error(self.exception) if on_error else None - - def _accept_observer(self, observer: abc.ObserverBase[_T]) -> None: - return observer.on_error(self.exception) - - def __str__(self) -> str: - return "OnError(%s)" % str(self.exception) - - -class OnCompleted(Notification[_T]): - """Represents an OnCompleted notification to an observer.""" - - def __init__(self) -> None: - """Constructs a notification of the end of a sequence.""" - - super(OnCompleted, self).__init__() - self.kind = "C" - - def _accept( - self, - on_next: typing.OnNext[_T], - on_error: Optional[typing.OnError], - on_completed: Optional[typing.OnCompleted], - ) -> None: - return on_completed() if on_completed else None - - def _accept_observer(self, observer: abc.ObserverBase[_T]) -> None: - return observer.on_completed() - - def __str__(self) -> str: - return "OnCompleted()" - - -def from_notifier(handler: Callable[[Notification[_T]], None]) -> Observer[_T]: - """Creates an observer from a notification callback. - - Args: - handler: Action that handles a notification. - - Returns: - The observer object that invokes the specified handler using - a notification corresponding to each message it receives. - """ - - def _on_next(value: _T) -> None: - return handler(OnNext(value)) - - def _on_error(error: Exception) -> None: - return handler(OnError(error)) - - def _on_completed() -> None: - return handler(OnCompleted()) - - return Observer(_on_next, _on_error, _on_completed) diff --git a/frogpilot/third_party/reactivex/observable/__init__.py b/frogpilot/third_party/reactivex/observable/__init__.py deleted file mode 100644 index a4872573..00000000 --- a/frogpilot/third_party/reactivex/observable/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -from .connectableobservable import ConnectableObservable -from .groupedobservable import GroupedObservable -from .observable import Observable - -__all__ = ["Observable", "ConnectableObservable", "GroupedObservable"] diff --git a/frogpilot/third_party/reactivex/observable/amb.py b/frogpilot/third_party/reactivex/observable/amb.py deleted file mode 100644 index cc9de245..00000000 --- a/frogpilot/third_party/reactivex/observable/amb.py +++ /dev/null @@ -1,31 +0,0 @@ -from typing import TypeVar - -from reactivex import Observable, never -from reactivex import operators as _ - -_T = TypeVar("_T") - - -def amb_(*sources: Observable[_T]) -> Observable[_T]: - """Propagates the observable sequence that reacts first. - - Example: - >>> winner = amb(xs, ys, zs) - - Returns: - An observable sequence that surfaces any of the given sequences, - whichever reacted first. - """ - - acc: Observable[_T] = never() - - def func(previous: Observable[_T], current: Observable[_T]) -> Observable[_T]: - return _.amb(previous)(current) - - for source in sources: - acc = func(acc, source) - - return acc - - -__all__ = ["amb_"] diff --git a/frogpilot/third_party/reactivex/observable/case.py b/frogpilot/third_party/reactivex/observable/case.py deleted file mode 100644 index c50adde0..00000000 --- a/frogpilot/third_party/reactivex/observable/case.py +++ /dev/null @@ -1,35 +0,0 @@ -from asyncio import Future -from typing import Callable, Mapping, Optional, TypeVar, Union - -from reactivex import Observable, abc, defer, empty, from_future - -_Key = TypeVar("_Key") -_T = TypeVar("_T") - - -def case_( - mapper: Callable[[], _Key], - sources: Mapping[_Key, Observable[_T]], - default_source: Optional[Union[Observable[_T], "Future[_T]"]] = None, -) -> Observable[_T]: - - default_source_: Union[Observable[_T], "Future[_T]"] = default_source or empty() - - def factory(_: abc.SchedulerBase) -> Observable[_T]: - try: - result: Union[Observable[_T], "Future[_T]"] = sources[mapper()] - except KeyError: - result = default_source_ - - if isinstance(result, Future): - - result_: Observable[_T] = from_future(result) - else: - result_ = result - - return result_ - - return defer(factory) - - -__all__ = ["case_"] diff --git a/frogpilot/third_party/reactivex/observable/catch.py b/frogpilot/third_party/reactivex/observable/catch.py deleted file mode 100644 index cd4e05ab..00000000 --- a/frogpilot/third_party/reactivex/observable/catch.py +++ /dev/null @@ -1,83 +0,0 @@ -from typing import Any, Iterable, Optional, TypeVar - -from reactivex import Observable, abc -from reactivex.disposable import ( - CompositeDisposable, - Disposable, - SerialDisposable, - SingleAssignmentDisposable, -) -from reactivex.scheduler import CurrentThreadScheduler - -_T = TypeVar("_T") - - -def catch_with_iterable_(sources: Iterable[Observable[_T]]) -> Observable[_T]: - """Continues an observable sequence that is terminated by an - exception with the next observable sequence. - - Examples: - >>> res = catch([xs, ys, zs]) - >>> res = reactivex.catch(src for src in [xs, ys, zs]) - - Args: - sources: an Iterable of observables. Thus a generator is accepted. - - Returns: - An observable sequence containing elements from consecutive - source sequences until a source sequence terminates - successfully. - """ - - sources_ = iter(sources) - - def subscribe( - observer: abc.ObserverBase[_T], scheduler_: Optional[abc.SchedulerBase] = None - ) -> abc.DisposableBase: - _scheduler = scheduler_ or CurrentThreadScheduler.singleton() - - subscription = SerialDisposable() - cancelable = SerialDisposable() - last_exception = None - is_disposed = False - - def action(scheduler: abc.SchedulerBase, state: Any = None) -> None: - def on_error(exn: Exception) -> None: - nonlocal last_exception - last_exception = exn - cancelable.disposable = _scheduler.schedule(action) - - if is_disposed: - return - - try: - current = next(sources_) - except StopIteration: - if last_exception: - observer.on_error(last_exception) - else: - observer.on_completed() - except Exception as ex: # pylint: disable=broad-except - observer.on_error(ex) - else: - d = SingleAssignmentDisposable() - subscription.disposable = d - d.disposable = current.subscribe( - observer.on_next, - on_error, - observer.on_completed, - scheduler=scheduler_, - ) - - cancelable.disposable = _scheduler.schedule(action) - - def dispose() -> None: - nonlocal is_disposed - is_disposed = True - - return CompositeDisposable(subscription, cancelable, Disposable(dispose)) - - return Observable(subscribe) - - -__all__ = ["catch_with_iterable_"] diff --git a/frogpilot/third_party/reactivex/observable/combinelatest.py b/frogpilot/third_party/reactivex/observable/combinelatest.py deleted file mode 100644 index ff3c5c0b..00000000 --- a/frogpilot/third_party/reactivex/observable/combinelatest.py +++ /dev/null @@ -1,76 +0,0 @@ -from typing import Any, List, Optional, Tuple - -from reactivex import Observable, abc -from reactivex.disposable import CompositeDisposable, SingleAssignmentDisposable - - -def combine_latest_(*sources: Observable[Any]) -> Observable[Tuple[Any, ...]]: - """Merges the specified observable sequences into one observable - sequence by creating a tuple whenever any of the - observable sequences produces an element. - - Examples: - >>> obs = combine_latest(obs1, obs2, obs3) - - Returns: - An observable sequence containing the result of combining - elements of the sources into a tuple. - """ - - parent = sources[0] - - def subscribe( - observer: abc.ObserverBase[Any], scheduler: Optional[abc.SchedulerBase] = None - ) -> CompositeDisposable: - - n = len(sources) - has_value = [False] * n - has_value_all = [False] - is_done = [False] * n - values = [None] * n - - def _next(i: Any) -> None: - has_value[i] = True - - if has_value_all[0] or all(has_value): - res = tuple(values) - observer.on_next(res) - - elif all([x for j, x in enumerate(is_done) if j != i]): - observer.on_completed() - - has_value_all[0] = all(has_value) - - def done(i: Any) -> None: - is_done[i] = True - if all(is_done): - observer.on_completed() - - subscriptions: List[Optional[SingleAssignmentDisposable]] = [None] * n - - def func(i: int) -> None: - subscriptions[i] = SingleAssignmentDisposable() - - def on_next(x: Any) -> None: - with parent.lock: - values[i] = x - _next(i) - - def on_completed() -> None: - with parent.lock: - done(i) - - subscription = subscriptions[i] - assert subscription - subscription.disposable = sources[i].subscribe( - on_next, observer.on_error, on_completed, scheduler=scheduler - ) - - for idx in range(n): - func(idx) - return CompositeDisposable(subscriptions) - - return Observable(subscribe) - - -__all__ = ["combine_latest_"] diff --git a/frogpilot/third_party/reactivex/observable/concat.py b/frogpilot/third_party/reactivex/observable/concat.py deleted file mode 100644 index 7e2773ee..00000000 --- a/frogpilot/third_party/reactivex/observable/concat.py +++ /dev/null @@ -1,62 +0,0 @@ -from typing import Any, Iterable, Optional, TypeVar - -from reactivex import Observable, abc -from reactivex.disposable import ( - CompositeDisposable, - Disposable, - SerialDisposable, - SingleAssignmentDisposable, -) -from reactivex.scheduler import CurrentThreadScheduler - -_T = TypeVar("_T") - - -def concat_with_iterable_(sources: Iterable[Observable[_T]]) -> Observable[_T]: - def subscribe( - observer: abc.ObserverBase[_T], scheduler_: Optional[abc.SchedulerBase] = None - ) -> abc.DisposableBase: - _scheduler = scheduler_ or CurrentThreadScheduler.singleton() - - sources_ = iter(sources) - - subscription = SerialDisposable() - cancelable = SerialDisposable() - is_disposed = False - - def action(scheduler: abc.SchedulerBase, state: Any = None) -> None: - nonlocal is_disposed - if is_disposed: - return - - def on_completed() -> None: - cancelable.disposable = _scheduler.schedule(action) - - try: - current = next(sources_) - except StopIteration: - observer.on_completed() - except Exception as ex: # pylint: disable=broad-except - observer.on_error(ex) - else: - d = SingleAssignmentDisposable() - subscription.disposable = d - d.disposable = current.subscribe( - observer.on_next, - observer.on_error, - on_completed, - scheduler=scheduler_, - ) - - cancelable.disposable = _scheduler.schedule(action) - - def dispose() -> None: - nonlocal is_disposed - is_disposed = True - - return CompositeDisposable(subscription, cancelable, Disposable(dispose)) - - return Observable(subscribe) - - -__all__ = ["concat_with_iterable_"] diff --git a/frogpilot/third_party/reactivex/observable/connectableobservable.py b/frogpilot/third_party/reactivex/observable/connectableobservable.py deleted file mode 100644 index 806b0dfb..00000000 --- a/frogpilot/third_party/reactivex/observable/connectableobservable.py +++ /dev/null @@ -1,82 +0,0 @@ -from typing import List, Optional, TypeVar - -from reactivex import abc -from reactivex.disposable import CompositeDisposable, Disposable - -from .observable import Observable - -_T = TypeVar("_T") - - -class ConnectableObservable(Observable[_T]): - """Represents an observable that can be connected and - disconnected.""" - - def __init__(self, source: abc.ObservableBase[_T], subject: abc.SubjectBase[_T]): - self.subject = subject - self.has_subscription = False - self.subscription: Optional[abc.DisposableBase] = None - self.source = source - - super().__init__() - - def _subscribe_core( - self, - observer: abc.ObserverBase[_T], - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - return self.subject.subscribe(observer, scheduler=scheduler) - - def connect( - self, scheduler: Optional[abc.SchedulerBase] = None - ) -> Optional[abc.DisposableBase]: - """Connects the observable.""" - - if not self.has_subscription: - self.has_subscription = True - - def dispose() -> None: - self.has_subscription = False - - subscription = self.source.subscribe(self.subject, scheduler=scheduler) - self.subscription = CompositeDisposable(subscription, Disposable(dispose)) - - return self.subscription - - def auto_connect(self, subscriber_count: int = 1) -> Observable[_T]: - """Returns an observable sequence that stays connected to the - source indefinitely to the observable sequence. - Providing a subscriber_count will cause it to connect() after - that many subscriptions occur. A subscriber_count of 0 will - result in emissions firing immediately without waiting for - subscribers. - """ - - connectable_subscription: List[Optional[abc.DisposableBase]] = [None] - count = [0] - source = self - is_connected = [False] - - if subscriber_count == 0: - connectable_subscription[0] = source.connect() - is_connected[0] = True - - def subscribe( - observer: abc.ObserverBase[_T], - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - count[0] += 1 - should_connect = count[0] == subscriber_count and not is_connected[0] - subscription = source.subscribe(observer) - if should_connect: - connectable_subscription[0] = source.connect(scheduler) - is_connected[0] = True - - def dispose() -> None: - subscription.dispose() - count[0] -= 1 - is_connected[0] = False - - return Disposable(dispose) - - return Observable(subscribe) diff --git a/frogpilot/third_party/reactivex/observable/defer.py b/frogpilot/third_party/reactivex/observable/defer.py deleted file mode 100644 index 0a3407aa..00000000 --- a/frogpilot/third_party/reactivex/observable/defer.py +++ /dev/null @@ -1,43 +0,0 @@ -from asyncio import Future -from typing import Callable, Optional, TypeVar, Union - -from reactivex import Observable, abc, from_future, throw -from reactivex.scheduler import ImmediateScheduler - -_T = TypeVar("_T") - - -def defer_( - factory: Callable[[abc.SchedulerBase], Union[Observable[_T], "Future[_T]"]] -) -> Observable[_T]: - """Returns an observable sequence that invokes the specified factory - function whenever a new observer subscribes. - - Example: - >>> res = defer(lambda scheduler: of(1, 2, 3)) - - Args: - observable_factory: Observable factory function to invoke for - each observer that subscribes to the resulting sequence. The - factory takes a single argument, the scheduler used. - - Returns: - An observable sequence whose observers trigger an invocation - of the given observable factory function. - """ - - def subscribe( - observer: abc.ObserverBase[_T], scheduler: Optional[abc.SchedulerBase] = None - ) -> abc.DisposableBase: - try: - result = factory(scheduler or ImmediateScheduler.singleton()) - except Exception as ex: # By design. pylint: disable=W0703 - return throw(ex).subscribe(observer) - - result = from_future(result) if isinstance(result, Future) else result - return result.subscribe(observer, scheduler=scheduler) - - return Observable(subscribe) - - -__all__ = ["defer_"] diff --git a/frogpilot/third_party/reactivex/observable/empty.py b/frogpilot/third_party/reactivex/observable/empty.py deleted file mode 100644 index bdbdb3c0..00000000 --- a/frogpilot/third_party/reactivex/observable/empty.py +++ /dev/null @@ -1,22 +0,0 @@ -from typing import Any, Optional - -from reactivex import Observable, abc -from reactivex.scheduler import ImmediateScheduler - - -def empty_(scheduler: Optional[abc.SchedulerBase] = None) -> Observable[Any]: - def subscribe( - observer: abc.ObserverBase[Any], scheduler_: Optional[abc.SchedulerBase] = None - ) -> abc.DisposableBase: - - _scheduler = scheduler or scheduler_ or ImmediateScheduler.singleton() - - def action(_: abc.SchedulerBase, __: Any) -> None: - observer.on_completed() - - return _scheduler.schedule(action) - - return Observable(subscribe) - - -__all__ = ["empty_"] diff --git a/frogpilot/third_party/reactivex/observable/forkjoin.py b/frogpilot/third_party/reactivex/observable/forkjoin.py deleted file mode 100644 index 33a74388..00000000 --- a/frogpilot/third_party/reactivex/observable/forkjoin.py +++ /dev/null @@ -1,72 +0,0 @@ -from typing import Any, List, Optional, Tuple, cast - -from reactivex import Observable, abc -from reactivex.disposable import CompositeDisposable, SingleAssignmentDisposable - - -def fork_join_(*sources: Observable[Any]) -> Observable[Tuple[Any, ...]]: - """Wait for observables to complete and then combine last values - they emitted into a tuple. Whenever any of that observables completes - without emitting any value, result sequence will complete at that moment as well. - - Examples: - >>> obs = reactivex.fork_join(obs1, obs2, obs3) - - Returns: - An observable sequence containing the result of combining last element from - each source in given sequence. - """ - - parent = sources[0] - - def subscribe( - observer: abc.ObserverBase[Tuple[Any, ...]], - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - n = len(sources) - values = [None] * n - is_done = [False] * n - has_value = [False] * n - - def done(i: int) -> None: - is_done[i] = True - - if not has_value[i]: - observer.on_completed() - return - - if all(is_done): - if all(has_value): - observer.on_next(tuple(values)) - observer.on_completed() - else: - observer.on_completed() - - subscriptions: List[SingleAssignmentDisposable] = [ - cast(SingleAssignmentDisposable, None) - ] * n - - def _subscribe(i: int) -> None: - subscriptions[i] = SingleAssignmentDisposable() - - def on_next(value: Any) -> None: - with parent.lock: - values[i] = value - has_value[i] = True - - def on_completed() -> None: - with parent.lock: - done(i) - - subscriptions[i].disposable = sources[i].subscribe( - on_next, observer.on_error, on_completed, scheduler=scheduler - ) - - for i in range(n): - _subscribe(i) - return CompositeDisposable(subscriptions) - - return Observable(subscribe) - - -__all__ = ["fork_join_"] diff --git a/frogpilot/third_party/reactivex/observable/fromcallback.py b/frogpilot/third_party/reactivex/observable/fromcallback.py deleted file mode 100644 index f7229abe..00000000 --- a/frogpilot/third_party/reactivex/observable/fromcallback.py +++ /dev/null @@ -1,59 +0,0 @@ -from typing import Any, Callable, Optional - -from reactivex import Observable, abc, typing -from reactivex.disposable import Disposable - - -def from_callback_( - func: Callable[..., Callable[..., None]], - mapper: Optional[typing.Mapper[Any, Any]] = None, -) -> Callable[[], Observable[Any]]: - """Converts a callback function to an observable sequence. - - Args: - func: Function with a callback as the last argument to - convert to an Observable sequence. - mapper: [Optional] A mapper which takes the arguments - from the callback to produce a single item to yield on next. - - Returns: - A function, when executed with the required arguments minus - the callback, produces an Observable sequence with a single value of - the arguments to the callback as a list. - """ - - def function(*args: Any) -> Observable[Any]: - arguments = list(args) - - def subscribe( - observer: abc.ObserverBase[Any], - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - def handler(*args: Any) -> None: - results = list(args) - if mapper: - try: - results = mapper(args) - except Exception as err: # pylint: disable=broad-except - observer.on_error(err) - return - - observer.on_next(results) - else: - if len(results) <= 1: - observer.on_next(*results) - else: - observer.on_next(results) - - observer.on_completed() - - arguments.append(handler) - func(*arguments) - return Disposable() - - return Observable(subscribe) - - return function - - -__all__ = ["from_callback_"] diff --git a/frogpilot/third_party/reactivex/observable/fromfuture.py b/frogpilot/third_party/reactivex/observable/fromfuture.py deleted file mode 100644 index caabebf5..00000000 --- a/frogpilot/third_party/reactivex/observable/fromfuture.py +++ /dev/null @@ -1,49 +0,0 @@ -import asyncio -from asyncio import Future -from typing import Any, Optional, TypeVar, cast - -from reactivex import Observable, abc -from reactivex.disposable import Disposable - -_T = TypeVar("_T") - - -def from_future_(future: "Future[_T]") -> Observable[_T]: - """Converts a Future to an Observable sequence - - Args: - future -- A Python 3 compatible future. - https://docs.python.org/3/library/asyncio-task.html#future - - Returns: - An Observable sequence which wraps the existing future success - and failure. - """ - - def subscribe( - observer: abc.ObserverBase[Any], scheduler: Optional[abc.SchedulerBase] = None - ) -> abc.DisposableBase: - def done(future: "Future[_T]") -> None: - try: - value: Any = future.result() - except Exception as ex: - observer.on_error(ex) - except asyncio.CancelledError as ex: # pylint: disable=broad-except - # asyncio.CancelledError is a BaseException, so need to cast - observer.on_error(cast(Exception, ex)) - else: - observer.on_next(value) - observer.on_completed() - - future.add_done_callback(done) - - def dispose() -> None: - if future: - future.cancel() - - return Disposable(dispose) - - return Observable(subscribe) - - -__all__ = ["from_future_"] diff --git a/frogpilot/third_party/reactivex/observable/fromiterable.py b/frogpilot/third_party/reactivex/observable/fromiterable.py deleted file mode 100644 index 4166bd85..00000000 --- a/frogpilot/third_party/reactivex/observable/fromiterable.py +++ /dev/null @@ -1,56 +0,0 @@ -from typing import Any, Iterable, Optional, TypeVar - -from reactivex import Observable, abc -from reactivex.disposable import CompositeDisposable, Disposable -from reactivex.scheduler import CurrentThreadScheduler - -_T = TypeVar("_T") - - -def from_iterable_( - iterable: Iterable[_T], scheduler: Optional[abc.SchedulerBase] = None -) -> Observable[_T]: - """Converts an iterable to an observable sequence. - - Example: - >>> from_iterable([1,2,3]) - - Args: - iterable: A Python iterable - scheduler: An optional scheduler to schedule the values on. - - Returns: - The observable sequence whose elements are pulled from the - given iterable sequence. - """ - - def subscribe( - observer: abc.ObserverBase[_T], scheduler_: Optional[abc.SchedulerBase] = None - ) -> abc.DisposableBase: - _scheduler = scheduler or scheduler_ or CurrentThreadScheduler.singleton() - iterator = iter(iterable) - disposed = False - - def action(_: abc.SchedulerBase, __: Any = None) -> None: - nonlocal disposed - - try: - while not disposed: - value = next(iterator) - observer.on_next(value) - except StopIteration: - observer.on_completed() - except Exception as error: # pylint: disable=broad-except - observer.on_error(error) - - def dispose() -> None: - nonlocal disposed - disposed = True - - disp = Disposable(dispose) - return CompositeDisposable(_scheduler.schedule(action), disp) - - return Observable(subscribe) - - -__all__ = ["from_iterable_"] diff --git a/frogpilot/third_party/reactivex/observable/generate.py b/frogpilot/third_party/reactivex/observable/generate.py deleted file mode 100644 index 04fb8c3e..00000000 --- a/frogpilot/third_party/reactivex/observable/generate.py +++ /dev/null @@ -1,57 +0,0 @@ -from typing import Any, Optional, TypeVar, cast - -from reactivex import Observable, abc, typing -from reactivex.disposable import MultipleAssignmentDisposable -from reactivex.scheduler import CurrentThreadScheduler - -_TState = TypeVar("_TState") - - -def generate_( - initial_state: _TState, - condition: typing.Predicate[_TState], - iterate: typing.Mapper[_TState, _TState], -) -> Observable[_TState]: - def subscribe( - observer: abc.ObserverBase[_TState], - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - scheduler = scheduler or CurrentThreadScheduler.singleton() - first = True - state = initial_state - mad = MultipleAssignmentDisposable() - - def action(scheduler: abc.SchedulerBase, state1: Any = None) -> None: - nonlocal first - nonlocal state - - has_result = False - result: _TState = cast(_TState, None) - - try: - if first: - first = False - else: - state = iterate(state) - - has_result = condition(state) - if has_result: - result = state - - except Exception as exception: # pylint: disable=broad-except - observer.on_error(exception) - return - - if has_result: - observer.on_next(result) - mad.disposable = scheduler.schedule(action) - else: - observer.on_completed() - - mad.disposable = scheduler.schedule(action) - return mad - - return Observable(subscribe) - - -__all__ = ["generate_"] diff --git a/frogpilot/third_party/reactivex/observable/generatewithrelativetime.py b/frogpilot/third_party/reactivex/observable/generatewithrelativetime.py deleted file mode 100644 index 2180c76b..00000000 --- a/frogpilot/third_party/reactivex/observable/generatewithrelativetime.py +++ /dev/null @@ -1,89 +0,0 @@ -from typing import Any, Callable, Optional, TypeVar, cast - -from reactivex import Observable, abc -from reactivex.disposable import MultipleAssignmentDisposable -from reactivex.scheduler import TimeoutScheduler -from reactivex.typing import Mapper, Predicate, RelativeTime - -_TState = TypeVar("_TState") - - -def generate_with_relative_time_( - initial_state: _TState, - condition: Predicate[_TState], - iterate: Mapper[_TState, _TState], - time_mapper: Callable[[_TState], RelativeTime], -) -> Observable[_TState]: - """Generates an observable sequence by iterating a state from an - initial state until the condition fails. - - Example: - res = source.generate_with_relative_time( - 0, lambda x: True, lambda x: x + 1, lambda x: 0.5 - ) - - Args: - initial_state: Initial state. - condition: Condition to terminate generation (upon returning - false). - iterate: Iteration step function. - time_mapper: Time mapper function to control the speed of - values being produced each iteration, returning relative - times, i.e. either floats denoting seconds or instances of - timedelta. - - Returns: - The generated sequence. - """ - - def subscribe( - observer: abc.ObserverBase[_TState], - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - scheduler = scheduler or TimeoutScheduler.singleton() - mad = MultipleAssignmentDisposable() - state = initial_state - has_result = False - result: _TState = cast(_TState, None) - first = True - time: Optional[RelativeTime] = None - - def action(scheduler: abc.SchedulerBase, _: Any) -> None: - nonlocal state - nonlocal has_result - nonlocal result - nonlocal first - nonlocal time - - if has_result: - observer.on_next(result) - - try: - if first: - first = False - else: - state = iterate(state) - - has_result = condition(state) - - if has_result: - result = state - time = time_mapper(state) - - except Exception as e: # pylint: disable=broad-except - observer.on_error(e) - return - - if has_result: - assert time - mad.disposable = scheduler.schedule_relative(time, action) - else: - observer.on_completed() - - mad.disposable = scheduler.schedule_relative(0, action) - return mad - - return Observable(subscribe) - - -__all__ = ["generate_with_relative_time_"] diff --git a/frogpilot/third_party/reactivex/observable/groupedobservable.py b/frogpilot/third_party/reactivex/observable/groupedobservable.py deleted file mode 100644 index 1f7eaba4..00000000 --- a/frogpilot/third_party/reactivex/observable/groupedobservable.py +++ /dev/null @@ -1,40 +0,0 @@ -from typing import Generic, Optional, TypeVar - -from reactivex import abc -from reactivex.disposable import CompositeDisposable, Disposable, RefCountDisposable - -from .observable import Observable - -_T = TypeVar("_T") -_TKey = TypeVar("_TKey") - - -class GroupedObservable(Generic[_TKey, _T], Observable[_T]): - def __init__( - self, - key: _TKey, - underlying_observable: Observable[_T], - merged_disposable: Optional[RefCountDisposable] = None, - ): - super().__init__() - self.key = key - - def subscribe( - observer: abc.ObserverBase[_T], - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - return CompositeDisposable( - merged_disposable.disposable if merged_disposable else Disposable(), - underlying_observable.subscribe(observer, scheduler=scheduler), - ) - - self.underlying_observable: Observable[_T] = ( - underlying_observable if not merged_disposable else Observable(subscribe) - ) - - def _subscribe_core( - self, - observer: abc.ObserverBase[_T], - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - return self.underlying_observable.subscribe(observer, scheduler=scheduler) diff --git a/frogpilot/third_party/reactivex/observable/ifthen.py b/frogpilot/third_party/reactivex/observable/ifthen.py deleted file mode 100644 index 00759885..00000000 --- a/frogpilot/third_party/reactivex/observable/ifthen.py +++ /dev/null @@ -1,55 +0,0 @@ -from asyncio import Future -from typing import Callable, TypeVar, Union - -import reactivex -from reactivex import Observable, abc - -_T = TypeVar("_T") - - -def if_then_( - condition: Callable[[], bool], - then_source: Union[Observable[_T], "Future[_T]"], - else_source: Union[None, Observable[_T], "Future[_T]"] = None, -) -> Observable[_T]: - """Determines whether an observable collection contains values. - - Example: - 1 - res = reactivex.if_then(condition, obs1) - 2 - res = reactivex.if_then(condition, obs1, obs2) - - Args: - condition: The condition which determines if the then_source or - else_source will be run. - then_source: The observable sequence or Promise that - will be run if the condition function returns true. - else_source: [Optional] The observable sequence or - Promise that will be run if the condition function returns - False. If this is not provided, it defaults to - reactivex.empty - - Returns: - An observable sequence which is either the then_source or - else_source. - """ - - else_source_: Union[Observable[_T], "Future[_T]"] = else_source or reactivex.empty() - - then_source = ( - reactivex.from_future(then_source) - if isinstance(then_source, Future) - else then_source - ) - else_source_ = ( - reactivex.from_future(else_source_) - if isinstance(else_source_, Future) - else else_source_ - ) - - def factory(_: abc.SchedulerBase) -> Union[Observable[_T], "Future[_T]"]: - return then_source if condition() else else_source_ - - return reactivex.defer(factory) - - -__all__ = ["if_then_"] diff --git a/frogpilot/third_party/reactivex/observable/interval.py b/frogpilot/third_party/reactivex/observable/interval.py deleted file mode 100644 index cf05a610..00000000 --- a/frogpilot/third_party/reactivex/observable/interval.py +++ /dev/null @@ -1,13 +0,0 @@ -from typing import Optional - -from reactivex import Observable, abc, timer, typing - - -def interval_( - period: typing.RelativeTime, scheduler: Optional[abc.SchedulerBase] = None -) -> Observable[int]: - - return timer(period, period, scheduler) - - -__all__ = ["interval_"] diff --git a/frogpilot/third_party/reactivex/observable/marbles.py b/frogpilot/third_party/reactivex/observable/marbles.py deleted file mode 100644 index 209459db..00000000 --- a/frogpilot/third_party/reactivex/observable/marbles.py +++ /dev/null @@ -1,273 +0,0 @@ -import re -import threading -from datetime import datetime, timedelta -from typing import Any, List, Mapping, Optional, Tuple, Union - -from reactivex import Notification, Observable, abc, notification, typing -from reactivex.disposable import CompositeDisposable, Disposable -from reactivex.scheduler import NewThreadScheduler - -new_thread_scheduler = NewThreadScheduler() - -# tokens will be searched in the order below using pipe -# group of elements: match any characters surrounded by () -pattern_group = r"(\(.*?\))" -# timespan: match one or multiple hyphens -pattern_ticks = r"(-+)" -# comma err: match any comma which is not in a group -pattern_comma_error = r"(,)" -# element: match | or # or one or more characters which are not - | # ( ) , -pattern_element = r"(#|\||[^-,()#\|]+)" - -pattern = r"|".join( - [ - pattern_group, - pattern_ticks, - pattern_comma_error, - pattern_element, - ] -) -tokens = re.compile(pattern) - - -def hot( - string: str, - timespan: typing.RelativeTime = 0.1, - duetime: typing.AbsoluteOrRelativeTime = 0.0, - lookup: Optional[Mapping[Union[str, float], Any]] = None, - error: Optional[Exception] = None, - scheduler: Optional[abc.SchedulerBase] = None, -) -> Observable[Any]: - _scheduler = scheduler or new_thread_scheduler - - if isinstance(duetime, datetime): - duetime = duetime - _scheduler.now - - messages = parse( - string, - timespan=timespan, - time_shift=duetime, - lookup=lookup, - error=error, - raise_stopped=True, - ) - - lock = threading.RLock() - is_stopped = False - observers: List[abc.ObserverBase[Any]] = [] - - def subscribe( - observer: abc.ObserverBase[Any], scheduler: Optional[abc.SchedulerBase] = None - ) -> abc.DisposableBase: - # should a hot observable already completed or on error - # re-push on_completed/on_error at subscription time? - if not is_stopped: - with lock: - observers.append(observer) - - def dispose() -> None: - with lock: - try: - observers.remove(observer) - except ValueError: - pass - - return Disposable(dispose) - - def create_action(notification: Notification[Any]) -> typing.ScheduledAction[Any]: - def action(scheduler: abc.SchedulerBase, state: Any = None) -> None: - nonlocal is_stopped - - with lock: - for observer in observers: - notification.accept(observer) - - if notification.kind in ("C", "E"): - is_stopped = True - - return action - - for message in messages: - timespan, notification = message - action = create_action(notification) - - # Don't make closures within a loop - _scheduler.schedule_relative(timespan, action) - - return Observable(subscribe) - - -def from_marbles( - string: str, - timespan: typing.RelativeTime = 0.1, - lookup: Optional[Mapping[Union[str, float], Any]] = None, - error: Optional[Exception] = None, - scheduler: Optional[abc.SchedulerBase] = None, -) -> Observable[Any]: - messages = parse( - string, timespan=timespan, lookup=lookup, error=error, raise_stopped=True - ) - - def subscribe( - observer: abc.ObserverBase[Any], scheduler_: Optional[abc.SchedulerBase] = None - ) -> abc.DisposableBase: - _scheduler = scheduler or scheduler_ or new_thread_scheduler - disp = CompositeDisposable() - - def schedule_msg( - message: Tuple[typing.RelativeTime, Notification[Any]] - ) -> None: - duetime, notification = message - - def action(scheduler: abc.SchedulerBase, state: Any = None) -> None: - notification.accept(observer) - - disp.add(_scheduler.schedule_relative(duetime, action)) - - for message in messages: - # Don't make closures within a loop - schedule_msg(message) - - return disp - - return Observable(subscribe) - - -def parse( - string: str, - timespan: typing.RelativeTime = 1.0, - time_shift: typing.RelativeTime = 0.0, - lookup: Optional[Mapping[Union[str, float], Any]] = None, - error: Optional[Exception] = None, - raise_stopped: bool = False, -) -> List[Tuple[typing.RelativeTime, notification.Notification[Any]]]: - """Convert a marble diagram string to a list of messages. - - Each character in the string will advance time by timespan - (exept for space). Characters that are not special (see the table below) - will be interpreted as a value to be emitted. numbers will be cast - to int or float. - - Special characters: - +--------+--------------------------------------------------------+ - | `-` | advance time by timespan | - +--------+--------------------------------------------------------+ - | `#` | on_error() | - +--------+--------------------------------------------------------+ - | `|` | on_completed() | - +--------+--------------------------------------------------------+ - | `(` | open a group of elements sharing the same timestamp | - +--------+--------------------------------------------------------+ - | `)` | close a group of elements | - +--------+--------------------------------------------------------+ - | `,` | separate elements in a group | - +--------+--------------------------------------------------------+ - | space | used to align multiple diagrams, does not advance time | - +--------+--------------------------------------------------------+ - - In a group of elements, the position of the initial `(` determines the - timestamp at which grouped elements will be emitted. E.g. `--(12,3,4)--` - will emit 12, 3, 4 at 2 * timespan and then advance virtual time - by 8 * timespan. - - Examples: - >>> parse("--1--(2,3)-4--|") - >>> parse("a--b--c-", lookup={'a': 1, 'b': 2, 'c': 3}) - >>> parse("a--b---#", error=ValueError("foo")) - - Args: - string: String with marble diagram - - timespan: [Optional] duration of each character in second. - If not specified, defaults to 0.1s. - - lookup: [Optional] dict used to convert an element into a specified - value. If not specified, defaults to {}. - - time_shift: [Optional] time used to delay every elements. - If not specified, defaults to 0.0s. - - error: [Optional] exception that will be use in place of the # symbol. - If not specified, defaults to Exception('error'). - - raise_finished: [optional] raise ValueError if elements are - declared after on_completed or on_error symbol. - - Returns: - A list of messages defined as a tuple of (timespan, notification). - - """ - - error_ = error or Exception("error") - lookup_ = lookup or {} - - if isinstance(timespan, timedelta): - timespan = timespan.total_seconds() - if isinstance(time_shift, timedelta): - time_shift = time_shift.total_seconds() - - string = string.replace(" ", "") - - # try to cast a string to an int, then to a float - def try_number(element: str) -> Union[float, str]: - try: - return int(element) - except ValueError: - try: - return float(element) - except ValueError: - return element - - def map_element( - time: typing.RelativeTime, element: str - ) -> Tuple[typing.RelativeTime, Notification[Any]]: - if element == "|": - return (time, notification.OnCompleted()) - elif element == "#": - return (time, notification.OnError(error_)) - else: - value = try_number(element) - value = lookup_.get(value, value) - return (time, notification.OnNext(value)) - - is_stopped = False - - def check_stopped(element: str) -> None: - nonlocal is_stopped - if raise_stopped: - if is_stopped: - raise ValueError("Elements cannot be declared after a # or | symbol.") - - if element in ("#", "|"): - is_stopped = True - - iframe = 0 - messages: List[Tuple[typing.RelativeTime, Notification[Any]]] = [] - - for results in tokens.findall(string): - timestamp = iframe * timespan + time_shift - group, ticks, comma_error, element = results - - if group: - elements = group[1:-1].split(",") - for elm in elements: - check_stopped(elm) - grp_messages = [ - map_element(timestamp, elm) for elm in elements if elm != "" - ] - messages.extend(grp_messages) - iframe += len(group) - - if ticks: - iframe += len(ticks) - - if comma_error: - raise ValueError("Comma is only allowed in group of elements.") - - if element: - check_stopped(element) - message = map_element(timestamp, element) - messages.append(message) - iframe += len(element) - - return messages diff --git a/frogpilot/third_party/reactivex/observable/merge.py b/frogpilot/third_party/reactivex/observable/merge.py deleted file mode 100644 index 0b5c9745..00000000 --- a/frogpilot/third_party/reactivex/observable/merge.py +++ /dev/null @@ -1,14 +0,0 @@ -from typing import TypeVar - -import reactivex -from reactivex import Observable -from reactivex import operators as ops - -_T = TypeVar("_T") - - -def merge_(*sources: Observable[_T]) -> Observable[_T]: - return reactivex.from_iterable(sources).pipe(ops.merge_all()) - - -__all__ = ["merge_"] diff --git a/frogpilot/third_party/reactivex/observable/never.py b/frogpilot/third_party/reactivex/observable/never.py deleted file mode 100644 index 74e28316..00000000 --- a/frogpilot/third_party/reactivex/observable/never.py +++ /dev/null @@ -1,23 +0,0 @@ -from typing import Any, Optional - -from reactivex import Observable, abc -from reactivex.disposable import Disposable - - -def never_() -> Observable[Any]: - """Returns a non-terminating observable sequence, which can be used - to denote an infinite duration (e.g. when using reactive joins). - - Returns: - An observable sequence whose observers will never get called. - """ - - def subscribe( - observer: abc.ObserverBase[Any], scheduler: Optional[abc.SchedulerBase] = None - ) -> abc.DisposableBase: - return Disposable() - - return Observable(subscribe) - - -__all__ = ["never_"] diff --git a/frogpilot/third_party/reactivex/observable/observable.py b/frogpilot/third_party/reactivex/observable/observable.py deleted file mode 100644 index 6e864da9..00000000 --- a/frogpilot/third_party/reactivex/observable/observable.py +++ /dev/null @@ -1,350 +0,0 @@ -# By design, pylint: disable=C0302 -from __future__ import annotations - -import asyncio -import threading -from typing import Any, Callable, Generator, Optional, TypeVar, Union, cast, overload - -from reactivex import abc -from reactivex.disposable import Disposable -from reactivex.scheduler import CurrentThreadScheduler -from reactivex.scheduler.eventloop import AsyncIOScheduler - -from ..observer import AutoDetachObserver - -_A = TypeVar("_A") -_B = TypeVar("_B") -_C = TypeVar("_C") -_D = TypeVar("_D") -_E = TypeVar("_E") -_F = TypeVar("_F") -_G = TypeVar("_G") - -_T_out = TypeVar("_T_out", covariant=True) - - -class Observable(abc.ObservableBase[_T_out]): - """Observable base class. - - Represents a push-style collection, which you can :func:`pipe ` into - :mod:`operators `.""" - - def __init__(self, subscribe: Optional[abc.Subscription[_T_out]] = None) -> None: - """Creates an observable sequence object from the specified - subscription function. - - Args: - subscribe: [Optional] Subscription function - """ - super().__init__() - - self.lock = threading.RLock() - self._subscribe = subscribe - - def _subscribe_core( - self, - observer: abc.ObserverBase[_T_out], - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - return self._subscribe(observer, scheduler) if self._subscribe else Disposable() - - def subscribe( - self, - on_next: Optional[ - Union[abc.ObserverBase[_T_out], abc.OnNext[_T_out], None] - ] = None, - on_error: Optional[abc.OnError] = None, - on_completed: Optional[abc.OnCompleted] = None, - *, - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - """Subscribe an observer to the observable sequence. - - You may subscribe using an observer or callbacks, not both; if the first - argument is an instance of :class:`Observer <..abc.ObserverBase>` or if - it has a (callable) attribute named :code:`on_next`, then any callback - arguments will be ignored. - - Examples: - >>> source.subscribe() - >>> source.subscribe(observer) - >>> source.subscribe(observer, scheduler=scheduler) - >>> source.subscribe(on_next) - >>> source.subscribe(on_next, on_error) - >>> source.subscribe(on_next, on_error, on_completed) - >>> source.subscribe(on_next, on_error, on_completed, scheduler=scheduler) - - Args: - observer: [Optional] The object that is to receive - notifications. - on_error: [Optional] Action to invoke upon exceptional termination - of the observable sequence. - on_completed: [Optional] Action to invoke upon graceful termination - of the observable sequence. - on_next: [Optional] Action to invoke for each element in the - observable sequence. - scheduler: [Optional] The default scheduler to use for this - subscription. - - Returns: - Disposable object representing an observer's subscription to - the observable sequence. - """ - if ( - isinstance(on_next, abc.ObserverBase) - or hasattr(on_next, "on_next") - and callable(getattr(on_next, "on_next")) - ): - obv = cast(abc.ObserverBase[_T_out], on_next) - on_next = obv.on_next - on_error = obv.on_error - on_completed = obv.on_completed - - auto_detach_observer: AutoDetachObserver[_T_out] = AutoDetachObserver( - on_next, on_error, on_completed - ) - - def fix_subscriber( - subscriber: Union[abc.DisposableBase, Callable[[], None]] - ) -> abc.DisposableBase: - """Fixes subscriber to make sure it returns a Disposable instead - of None or a dispose function""" - - if isinstance(subscriber, abc.DisposableBase) or hasattr( - subscriber, "dispose" - ): - # Note: cast can be avoided using Protocols (Python 3.9) - return cast(abc.DisposableBase, subscriber) - - return Disposable(subscriber) - - def set_disposable( - _: Optional[abc.SchedulerBase] = None, __: Any = None - ) -> None: - try: - subscriber = self._subscribe_core(auto_detach_observer, scheduler) - except Exception as ex: # By design. pylint: disable=W0703 - if not auto_detach_observer.fail(ex): - raise - else: - auto_detach_observer.subscription = fix_subscriber(subscriber) - - # Subscribe needs to set up the trampoline before for subscribing. - # Actually, the first call to Subscribe creates the trampoline so - # that it may assign its disposable before any observer executes - # OnNext over the CurrentThreadScheduler. This enables single- - # threaded cancellation - # https://social.msdn.microsoft.com/Forums/en-US/eb82f593-9684-4e27- - # 97b9-8b8886da5c33/whats-the-rationale-behind-how-currentthreadsche - # dulerschedulerequired-behaves?forum=rx - current_thread_scheduler = CurrentThreadScheduler.singleton() - if current_thread_scheduler.schedule_required(): - current_thread_scheduler.schedule(set_disposable) - else: - set_disposable() - - # Hide the identity of the auto detach observer - return Disposable(auto_detach_observer.dispose) - - @overload - def pipe(self, __op1: Callable[[Observable[_T_out]], _A]) -> _A: ... - - @overload - def pipe( - self, - __op1: Callable[[Observable[_T_out]], _A], - __op2: Callable[[_A], _B], - ) -> _B: ... - - @overload - def pipe( - self, - __op1: Callable[[Observable[_T_out]], _A], - __op2: Callable[[_A], _B], - __op3: Callable[[_B], _C], - ) -> _C: ... - - @overload - def pipe( - self, - __op1: Callable[[Observable[_T_out]], _A], - __op2: Callable[[_A], _B], - __op3: Callable[[_B], _C], - __op4: Callable[[_C], _D], - ) -> _D: ... - - @overload - def pipe( - self, - __op1: Callable[[Observable[_T_out]], _A], - __op2: Callable[[_A], _B], - __op3: Callable[[_B], _C], - __op4: Callable[[_C], _D], - __op5: Callable[[_D], _E], - ) -> _E: ... - - @overload - def pipe( - self, - __op1: Callable[[Observable[_T_out]], _A], - __op2: Callable[[_A], _B], - __op3: Callable[[_B], _C], - __op4: Callable[[_C], _D], - __op5: Callable[[_D], _E], - __op6: Callable[[_E], _F], - ) -> _F: ... - - @overload - def pipe( - self, - __op1: Callable[[Observable[_T_out]], _A], - __op2: Callable[[_A], _B], - __op3: Callable[[_B], _C], - __op4: Callable[[_C], _D], - __op5: Callable[[_D], _E], - __op6: Callable[[_E], _F], - __op7: Callable[[_F], _G], - ) -> _G: ... - - def pipe(self, *operators: Callable[[Any], Any]) -> Any: - """Compose multiple operators left to right. - - Composes zero or more operators into a functional composition. - The operators are composed from left to right. A composition of zero - operators gives back the original source. - - Examples: - >>> source.pipe() == source - >>> source.pipe(f) == f(source) - >>> source.pipe(g, f) == f(g(source)) - >>> source.pipe(h, g, f) == f(g(h(source))) - - Args: - operators: Sequence of operators. - - Returns: - The composed observable. - """ - from ..pipe import pipe as pipe_ - - return pipe_(self, *operators) - - def run(self) -> Any: - """Run source synchronously. - - Subscribes to the observable source. Then blocks and waits for the - observable source to either complete or error. Returns the - last value emitted, or throws exception if any error occurred. - - Examples: - >>> result = run(source) - - Raises: - SequenceContainsNoElementsError: if observable completes - (on_completed) without any values being emitted. - Exception: raises exception if any error (on_error) occurred. - - Returns: - The last element emitted from the observable. - """ - from ..run import run - - return run(self) - - def __await__(self) -> Generator[Any, None, _T_out]: - """Awaits the given observable. - - Returns: - The last item of the observable sequence. - """ - from ..operators._tofuture import to_future_ - - loop = asyncio.get_event_loop() - future: asyncio.Future[_T_out] = self.pipe( - to_future_(scheduler=AsyncIOScheduler(loop=loop)) - ) - return future.__await__() - - def __add__(self, other: Observable[_T_out]) -> Observable[_T_out]: - """Pythonic version of :func:`concat `. - - Example: - >>> zs = xs + ys - - Args: - other: The second observable sequence in the concatenation. - - Returns: - Concatenated observable sequence. - """ - from reactivex import concat - - return concat(self, other) - - def __iadd__(self, other: Observable[_T_out]) -> "Observable[_T_out]": - """Pythonic use of :func:`concat `. - - Example: - >>> xs += ys - - Args: - other: The second observable sequence in the concatenation. - - Returns: - Concatenated observable sequence. - """ - from reactivex import concat - - return concat(self, other) - - def __getitem__(self, key: Union[slice, int]) -> Observable[_T_out]: - """ - Pythonic version of :func:`slice `. - - Slices the given observable using Python slice notation. The arguments - to slice are `start`, `stop` and `step` given within brackets `[]` and - separated by the colons `:`. - - It is basically a wrapper around the operators - :func:`skip `, - :func:`skip_last `, - :func:`take `, - :func:`take_last ` and - :func:`filter `. - - The following diagram helps you remember how slices works with streams. - Positive numbers are relative to the start of the events, while negative - numbers are relative to the end (close) of the stream. - - .. code:: - - r---e---a---c---t---i---v---e---! - 0 1 2 3 4 5 6 7 8 - -8 -7 -6 -5 -4 -3 -2 -1 0 - - Examples: - >>> result = source[1:10] - >>> result = source[1:-2] - >>> result = source[1:-1:2] - - Args: - key: Slice object - - Returns: - Sliced observable sequence. - - Raises: - TypeError: If key is not of type :code:`int` or :code:`slice` - """ - - if isinstance(key, slice): - start, stop, step = key.start, key.stop, key.step - else: - start, stop, step = key, key + 1, 1 - - from ..operators._slice import slice_ - - return slice_(start, stop, step)(self) - - -__all__ = ["Observable"] diff --git a/frogpilot/third_party/reactivex/observable/onerrorresumenext.py b/frogpilot/third_party/reactivex/observable/onerrorresumenext.py deleted file mode 100644 index f4e28c6f..00000000 --- a/frogpilot/third_party/reactivex/observable/onerrorresumenext.py +++ /dev/null @@ -1,73 +0,0 @@ -from asyncio import Future -from typing import Callable, Optional, TypeVar, Union - -import reactivex -from reactivex import Observable, abc -from reactivex.disposable import ( - CompositeDisposable, - SerialDisposable, - SingleAssignmentDisposable, -) -from reactivex.scheduler import CurrentThreadScheduler - -_T = TypeVar("_T") - - -def on_error_resume_next_( - *sources: Union[ - Observable[_T], "Future[_T]", Callable[[Optional[Exception]], Observable[_T]] - ] -) -> Observable[_T]: - """Continues an observable sequence that is terminated normally or - by an exception with the next observable sequence. - - Examples: - >>> res = reactivex.on_error_resume_next(xs, ys, zs) - - Returns: - An observable sequence that concatenates the source sequences, - even if a sequence terminates exceptionally. - """ - - sources_ = iter(sources) - - def subscribe( - observer: abc.ObserverBase[_T], scheduler: Optional[abc.SchedulerBase] = None - ) -> abc.DisposableBase: - scheduler = scheduler or CurrentThreadScheduler.singleton() - - subscription = SerialDisposable() - cancelable = SerialDisposable() - - def action( - scheduler: abc.SchedulerBase, state: Optional[Exception] = None - ) -> None: - try: - source = next(sources_) - except StopIteration: - observer.on_completed() - return - - # Allow source to be a factory method taking an error - source = source(state) if callable(source) else source - current = ( - reactivex.from_future(source) if isinstance(source, Future) else source - ) - - d = SingleAssignmentDisposable() - subscription.disposable = d - - def on_resume(state: Optional[Exception] = None) -> None: - scheduler.schedule(action, state) - - d.disposable = current.subscribe( - observer.on_next, on_resume, on_resume, scheduler=scheduler - ) - - cancelable.disposable = scheduler.schedule(action) - return CompositeDisposable(subscription, cancelable) - - return Observable(subscribe) - - -__all__ = ["on_error_resume_next_"] diff --git a/frogpilot/third_party/reactivex/observable/range.py b/frogpilot/third_party/reactivex/observable/range.py deleted file mode 100644 index e7bada73..00000000 --- a/frogpilot/third_party/reactivex/observable/range.py +++ /dev/null @@ -1,70 +0,0 @@ -from sys import maxsize -from typing import Iterator, Optional - -from reactivex import Observable, abc -from reactivex.disposable import MultipleAssignmentDisposable -from reactivex.scheduler import CurrentThreadScheduler - - -def range_( - start: int, - stop: Optional[int] = None, - step: Optional[int] = None, - scheduler: Optional[abc.SchedulerBase] = None, -) -> Observable[int]: - """Generates an observable sequence of integral numbers within a - specified range, using the specified scheduler to send out observer - messages. - - Examples: - >>> res = range(10) - >>> res = range(0, 10) - >>> res = range(0, 10, 1) - - Args: - start: The value of the first integer in the sequence. - stop: [Optional] Generate number up to (exclusive) the stop - value. Default is `sys.maxsize`. - step: [Optional] The step to be used (default is 1). - scheduler: The scheduler to schedule the values on. - - Returns: - An observable sequence that contains a range of sequential - integral numbers. - """ - - _stop: int = maxsize if stop is None else stop - _step: int = 1 if step is None else step - - if step is None and stop is None: - range_t = range(start) - elif step is None: - range_t = range(start, _stop) - else: - range_t = range(start, _stop, _step) - - def subscribe( - observer: abc.ObserverBase[int], scheduler_: Optional[abc.SchedulerBase] = None - ) -> abc.DisposableBase: - nonlocal range_t - - _scheduler = scheduler or scheduler_ or CurrentThreadScheduler.singleton() - sd = MultipleAssignmentDisposable() - - def action( - scheduler: abc.SchedulerBase, iterator: Optional[Iterator[int]] - ) -> None: - try: - assert iterator - observer.on_next(next(iterator)) - sd.disposable = _scheduler.schedule(action, state=iterator) - except StopIteration: - observer.on_completed() - - sd.disposable = _scheduler.schedule(action, iter(range_t)) - return sd - - return Observable(subscribe) - - -__all__ = ["range_"] diff --git a/frogpilot/third_party/reactivex/observable/repeat.py b/frogpilot/third_party/reactivex/observable/repeat.py deleted file mode 100644 index a3ecf9aa..00000000 --- a/frogpilot/third_party/reactivex/observable/repeat.py +++ /dev/null @@ -1,35 +0,0 @@ -from typing import Optional, TypeVar - -import reactivex -from reactivex import Observable -from reactivex import operators as ops - -_T = TypeVar("_T") - - -def repeat_value_(value: _T, repeat_count: Optional[int] = None) -> Observable[_T]: - """Generates an observable sequence that repeats the given element - the specified number of times. - - Examples: - 1 - res = repeat_value(42) - 2 - res = repeat_value(42, 4) - - Args: - value: Element to repeat. - repeat_count: [Optional] Number of times to repeat the element. - If not specified, repeats indefinitely. - - Returns: - An observable sequence that repeats the given element the - specified number of times. - """ - - if repeat_count == -1: - repeat_count = None - - xs = reactivex.return_value(value) - return xs.pipe(ops.repeat(repeat_count)) - - -__all__ = ["repeat_value_"] diff --git a/frogpilot/third_party/reactivex/observable/returnvalue.py b/frogpilot/third_party/reactivex/observable/returnvalue.py deleted file mode 100644 index f4238ae5..00000000 --- a/frogpilot/third_party/reactivex/observable/returnvalue.py +++ /dev/null @@ -1,64 +0,0 @@ -from typing import Any, Callable, Optional, TypeVar - -from reactivex import Observable, abc -from reactivex.scheduler import CurrentThreadScheduler - -_T = TypeVar("_T") - - -def return_value_( - value: _T, scheduler: Optional[abc.SchedulerBase] = None -) -> Observable[_T]: - """Returns an observable sequence that contains a single element, - using the specified scheduler to send out observer messages. - There is an alias called 'just'. - - Examples: - >>> res = return(42) - >>> res = return(42, rx.Scheduler.timeout) - - Args: - value: Single element in the resulting observable sequence. - - Returns: - An observable sequence containing the single specified - element. - """ - - def subscribe( - observer: abc.ObserverBase[_T], scheduler_: Optional[abc.SchedulerBase] = None - ) -> abc.DisposableBase: - _scheduler = scheduler or scheduler_ or CurrentThreadScheduler.singleton() - - def action(scheduler: abc.SchedulerBase, state: Any = None) -> None: - observer.on_next(value) - observer.on_completed() - - return _scheduler.schedule(action) - - return Observable(subscribe) - - -def from_callable_( - supplier: Callable[[], _T], scheduler: Optional[abc.SchedulerBase] = None -) -> Observable[_T]: - def subscribe( - observer: abc.ObserverBase[_T], scheduler_: Optional[abc.SchedulerBase] = None - ) -> abc.DisposableBase: - _scheduler = scheduler or scheduler_ or CurrentThreadScheduler.singleton() - - def action(_: abc.SchedulerBase, __: Any = None) -> None: - nonlocal observer - - try: - observer.on_next(supplier()) - observer.on_completed() - except Exception as e: # pylint: disable=broad-except - observer.on_error(e) - - return _scheduler.schedule(action) - - return Observable(subscribe) - - -__all__ = ["return_value_", "from_callable_"] diff --git a/frogpilot/third_party/reactivex/observable/start.py b/frogpilot/third_party/reactivex/observable/start.py deleted file mode 100644 index e25ade48..00000000 --- a/frogpilot/third_party/reactivex/observable/start.py +++ /dev/null @@ -1,36 +0,0 @@ -from typing import Callable, Optional, TypeVar - -from reactivex import Observable, abc, to_async - -_T = TypeVar("_T") - - -def start_( - func: Callable[[], _T], scheduler: Optional[abc.SchedulerBase] = None -) -> Observable[_T]: - """Invokes the specified function asynchronously on the specified - scheduler, surfacing the result through an observable sequence. - - Example: - >>> res = reactivex.start(lambda: pprint('hello')) - >>> res = reactivex.start(lambda: pprint('hello'), rx.Scheduler.timeout) - - Args: - func: Function to run asynchronously. - scheduler: [Optional] Scheduler to run the function on. If - not specified, defaults to Scheduler.timeout. - - Remarks: - The function is called immediately, not during the subscription - of the resulting sequence. Multiple subscriptions to the - resulting sequence can observe the function's result. - - Returns: - An observable sequence exposing the function's result value, - or an exception. - """ - - return to_async(func, scheduler)() - - -__all__ = ["start_"] diff --git a/frogpilot/third_party/reactivex/observable/startasync.py b/frogpilot/third_party/reactivex/observable/startasync.py deleted file mode 100644 index 458acf76..00000000 --- a/frogpilot/third_party/reactivex/observable/startasync.py +++ /dev/null @@ -1,18 +0,0 @@ -from asyncio import Future -from typing import Callable, TypeVar - -from reactivex import Observable, from_future, throw - -_T = TypeVar("_T") - - -def start_async_(function_async: Callable[[], "Future[_T]"]) -> Observable[_T]: - try: - future = function_async() - except Exception as ex: # pylint: disable=broad-except - return throw(ex) - - return from_future(future) - - -__all__ = ["start_async_"] diff --git a/frogpilot/third_party/reactivex/observable/throw.py b/frogpilot/third_party/reactivex/observable/throw.py deleted file mode 100644 index 1e90cb25..00000000 --- a/frogpilot/third_party/reactivex/observable/throw.py +++ /dev/null @@ -1,25 +0,0 @@ -from typing import Any, Optional, Union - -from reactivex import Observable, abc -from reactivex.scheduler import ImmediateScheduler - - -def throw_( - exception: Union[str, Exception], scheduler: Optional[abc.SchedulerBase] = None -) -> Observable[Any]: - exception_ = exception if isinstance(exception, Exception) else Exception(exception) - - def subscribe( - observer: abc.ObserverBase[Any], scheduler: Optional[abc.SchedulerBase] = None - ) -> abc.DisposableBase: - _scheduler = scheduler or ImmediateScheduler.singleton() - - def action(scheduler: abc.SchedulerBase, state: Any) -> None: - observer.on_error(exception_) - - return _scheduler.schedule(action) - - return Observable(subscribe) - - -__all__ = ["throw_"] diff --git a/frogpilot/third_party/reactivex/observable/timer.py b/frogpilot/third_party/reactivex/observable/timer.py deleted file mode 100644 index 3bde5f40..00000000 --- a/frogpilot/third_party/reactivex/observable/timer.py +++ /dev/null @@ -1,134 +0,0 @@ -from datetime import datetime -from typing import Any, Optional - -from reactivex import Observable, abc, typing -from reactivex.disposable import MultipleAssignmentDisposable -from reactivex.scheduler import TimeoutScheduler -from reactivex.scheduler.periodicscheduler import PeriodicScheduler - - -def observable_timer_date( - duetime: typing.AbsoluteTime, scheduler: Optional[abc.SchedulerBase] = None -) -> Observable[int]: - def subscribe( - observer: abc.ObserverBase[int], scheduler_: Optional[abc.SchedulerBase] = None - ) -> abc.DisposableBase: - _scheduler: abc.SchedulerBase = ( - scheduler or scheduler_ or TimeoutScheduler.singleton() - ) - - def action(scheduler: abc.SchedulerBase, state: Any) -> None: - observer.on_next(0) - observer.on_completed() - - return _scheduler.schedule_absolute(duetime, action) - - return Observable(subscribe) - - -def observable_timer_duetime_and_period( - duetime: typing.AbsoluteOrRelativeTime, - period: typing.AbsoluteOrRelativeTime, - scheduler: Optional[abc.SchedulerBase] = None, -) -> Observable[int]: - def subscribe( - observer: abc.ObserverBase[int], scheduler_: Optional[abc.SchedulerBase] = None - ) -> abc.DisposableBase: - _scheduler = scheduler or scheduler_ or TimeoutScheduler.singleton() - nonlocal duetime - - if not isinstance(duetime, datetime): - duetime = _scheduler.now + _scheduler.to_timedelta(duetime) - - p = max(0.0, _scheduler.to_seconds(period)) - mad = MultipleAssignmentDisposable() - dt = duetime - count = 0 - - def action(scheduler: abc.SchedulerBase, state: Any) -> None: - nonlocal dt - nonlocal count - - if p > 0.0: - now = scheduler.now - dt = dt + scheduler.to_timedelta(p) - if dt <= now: - dt = now + scheduler.to_timedelta(p) - - observer.on_next(count) - count += 1 - mad.disposable = scheduler.schedule_absolute(dt, action) - - mad.disposable = _scheduler.schedule_absolute(dt, action) - return mad - - return Observable(subscribe) - - -def observable_timer_timespan( - duetime: typing.RelativeTime, scheduler: Optional[abc.SchedulerBase] = None -) -> Observable[int]: - def subscribe( - observer: abc.ObserverBase[int], scheduler_: Optional[abc.SchedulerBase] = None - ) -> abc.DisposableBase: - _scheduler = scheduler or scheduler_ or TimeoutScheduler.singleton() - d = _scheduler.to_seconds(duetime) - - def action(scheduler: abc.SchedulerBase, state: Any) -> None: - observer.on_next(0) - observer.on_completed() - - if d <= 0.0: - return _scheduler.schedule(action) - return _scheduler.schedule_relative(d, action) - - return Observable(subscribe) - - -def observable_timer_timespan_and_period( - duetime: typing.RelativeTime, - period: typing.RelativeTime, - scheduler: Optional[abc.SchedulerBase] = None, -) -> Observable[int]: - if duetime == period: - - def subscribe( - observer: abc.ObserverBase[int], - scheduler_: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - _scheduler: abc.SchedulerBase = ( - scheduler or scheduler_ or TimeoutScheduler.singleton() - ) - - def action(count: Optional[int] = None) -> Optional[int]: - if count is not None: - observer.on_next(count) - return count + 1 - return None - - if not isinstance(_scheduler, PeriodicScheduler): - raise ValueError("Sceduler must be PeriodicScheduler") - return _scheduler.schedule_periodic(period, action, state=0) - - return Observable(subscribe) - return observable_timer_duetime_and_period(duetime, period, scheduler) - - -def timer_( - duetime: typing.AbsoluteOrRelativeTime, - period: Optional[typing.RelativeTime] = None, - scheduler: Optional[abc.SchedulerBase] = None, -) -> Observable[int]: - if isinstance(duetime, datetime): - if period is None: - return observable_timer_date(duetime, scheduler) - else: - return observable_timer_duetime_and_period(duetime, period, scheduler) - - if period is None: - return observable_timer_timespan(duetime, scheduler) - - return observable_timer_timespan_and_period(duetime, period, scheduler) - - -__all__ = ["timer_"] diff --git a/frogpilot/third_party/reactivex/observable/toasync.py b/frogpilot/third_party/reactivex/observable/toasync.py deleted file mode 100644 index 72164fe1..00000000 --- a/frogpilot/third_party/reactivex/observable/toasync.py +++ /dev/null @@ -1,54 +0,0 @@ -from typing import Any, Callable, Optional, TypeVar - -from reactivex import Observable, abc -from reactivex import operators as ops -from reactivex.scheduler import TimeoutScheduler -from reactivex.subject import AsyncSubject - -_T = TypeVar("_T") - - -def to_async_( - func: Callable[..., _T], scheduler: Optional[abc.SchedulerBase] = None -) -> Callable[..., Observable[_T]]: - """Converts the function into an asynchronous function. Each - invocation of the resulting asynchronous function causes an - invocation of the original synchronous function on the specified - scheduler. - - Examples: - res = reactivex.to_async(lambda x, y: x + y)(4, 3) - res = reactivex.to_async(lambda x, y: x + y, Scheduler.timeout)(4, 3) - res = reactivex.to_async(lambda x: log.debug(x), Scheduler.timeout)('hello') - - Args: - func: Function to convert to an asynchronous function. - scheduler: [Optional] Scheduler to run the function on. If not - specified, defaults to Scheduler.timeout. - - Returns: - Aynchronous function. - """ - - _scheduler = scheduler or TimeoutScheduler.singleton() - - def wrapper(*args: Any) -> Observable[_T]: - subject: AsyncSubject[_T] = AsyncSubject() - - def action(scheduler: abc.SchedulerBase, state: Any = None) -> None: - try: - result = func(*args) - except Exception as ex: # pylint: disable=broad-except - subject.on_error(ex) - return - - subject.on_next(result) - subject.on_completed() - - _scheduler.schedule(action) - return subject.pipe(ops.as_observable()) - - return wrapper - - -__all__ = ["to_async_"] diff --git a/frogpilot/third_party/reactivex/observable/using.py b/frogpilot/third_party/reactivex/observable/using.py deleted file mode 100644 index f0210401..00000000 --- a/frogpilot/third_party/reactivex/observable/using.py +++ /dev/null @@ -1,53 +0,0 @@ -from typing import Callable, Optional, TypeVar - -import reactivex -from reactivex import Observable, abc -from reactivex.disposable import CompositeDisposable, Disposable - -_T = TypeVar("_T") - - -def using_( - resource_factory: Callable[[], Optional[abc.DisposableBase]], - observable_factory: Callable[[Optional[abc.DisposableBase]], Observable[_T]], -) -> Observable[_T]: - """Constructs an observable sequence that depends on a resource - object, whose lifetime is tied to the resulting observable - sequence's lifetime. - - Example: - >>> res = reactivex.using(lambda: AsyncSubject(), lambda: s: s) - - Args: - resource_factory: Factory function to obtain a resource object. - observable_factory: Factory function to obtain an observable - sequence that depends on the obtained resource. - - Returns: - An observable sequence whose lifetime controls the lifetime - of the dependent resource object. - """ - - def subscribe( - observer: abc.ObserverBase[_T], scheduler: Optional[abc.SchedulerBase] = None - ) -> abc.DisposableBase: - disp: abc.DisposableBase = Disposable() - - try: - resource = resource_factory() - if resource is not None: - disp = resource - - source = observable_factory(resource) - except Exception as exception: # pylint: disable=broad-except - d = reactivex.throw(exception).subscribe(observer, scheduler=scheduler) - return CompositeDisposable(d, disp) - - return CompositeDisposable( - source.subscribe(observer, scheduler=scheduler), disp - ) - - return Observable(subscribe) - - -__all__ = ["using_"] diff --git a/frogpilot/third_party/reactivex/observable/withlatestfrom.py b/frogpilot/third_party/reactivex/observable/withlatestfrom.py deleted file mode 100644 index 8aff8721..00000000 --- a/frogpilot/third_party/reactivex/observable/withlatestfrom.py +++ /dev/null @@ -1,59 +0,0 @@ -from typing import Any, List, Optional, Tuple - -from reactivex import Observable, abc -from reactivex.disposable import CompositeDisposable, SingleAssignmentDisposable -from reactivex.internal.utils import NotSet - - -def with_latest_from_( - parent: Observable[Any], *sources: Observable[Any] -) -> Observable[Tuple[Any, ...]]: - NO_VALUE = NotSet() - - def subscribe( - observer: abc.ObserverBase[Any], scheduler: Optional[abc.SchedulerBase] = None - ) -> abc.DisposableBase: - def subscribeall( - parent: Observable[Any], *children: Observable[Any] - ) -> List[SingleAssignmentDisposable]: - - values = [NO_VALUE for _ in children] - - def subscribechild( - i: int, child: Observable[Any] - ) -> SingleAssignmentDisposable: - subscription = SingleAssignmentDisposable() - - def on_next(value: Any) -> None: - with parent.lock: - values[i] = value - - subscription.disposable = child.subscribe( - on_next, observer.on_error, scheduler=scheduler - ) - return subscription - - parent_subscription = SingleAssignmentDisposable() - - def on_next(value: Any) -> None: - with parent.lock: - if NO_VALUE not in values: - result = (value,) + tuple(values) - observer.on_next(result) - - children_subscription = [ - subscribechild(i, child) for i, child in enumerate(children) - ] - disp = parent.subscribe( - on_next, observer.on_error, observer.on_completed, scheduler=scheduler - ) - parent_subscription.disposable = disp - - return [parent_subscription] + children_subscription - - return CompositeDisposable(subscribeall(parent, *sources)) - - return Observable(subscribe) - - -__all__ = ["with_latest_from_"] diff --git a/frogpilot/third_party/reactivex/observable/zip.py b/frogpilot/third_party/reactivex/observable/zip.py deleted file mode 100644 index a8d1baa6..00000000 --- a/frogpilot/third_party/reactivex/observable/zip.py +++ /dev/null @@ -1,90 +0,0 @@ -from asyncio import Future -from threading import RLock -from typing import Any, List, Optional, Tuple - -from reactivex import Observable, abc, from_future -from reactivex.disposable import CompositeDisposable, SingleAssignmentDisposable -from reactivex.internal import synchronized - - -def zip_(*args: Observable[Any]) -> Observable[Tuple[Any, ...]]: - """Merges the specified observable sequences into one observable - sequence by creating a tuple whenever all of the - observable sequences have produced an element at a corresponding - index. - - Example: - >>> res = zip(obs1, obs2) - - Args: - args: Observable sources to zip. - - Returns: - An observable sequence containing the result of combining - elements of the sources as tuple. - """ - - sources = list(args) - - def subscribe( - observer: abc.ObserverBase[Any], scheduler: Optional[abc.SchedulerBase] = None - ) -> CompositeDisposable: - n = len(sources) - queues: List[List[Any]] = [[] for _ in range(n)] - lock = RLock() - is_completed = [False] * n - - @synchronized(lock) - def next_(i: int) -> None: - if all(len(q) for q in queues): - try: - queued_values = [x.pop(0) for x in queues] - res = tuple(queued_values) - except Exception as ex: # pylint: disable=broad-except - observer.on_error(ex) - return - - observer.on_next(res) - - # after sending the zipped values, complete the observer if at least one - # upstream observable is completed and its queue has length zero - if any( - ( - done - for queue, done in zip(queues, is_completed) - if len(queue) == 0 - ) - ): - observer.on_completed() - - def completed(i: int) -> None: - is_completed[i] = True - if len(queues[i]) == 0: - observer.on_completed() - - subscriptions: List[Optional[abc.DisposableBase]] = [None] * n - - def func(i: int) -> None: - source: Observable[Any] = sources[i] - if isinstance(source, Future): - source = from_future(source) - - sad = SingleAssignmentDisposable() - - def on_next(x: Any) -> None: - queues[i].append(x) - next_(i) - - sad.disposable = source.subscribe( - on_next, observer.on_error, lambda: completed(i), scheduler=scheduler - ) - subscriptions[i] = sad - - for idx in range(n): - func(idx) - return CompositeDisposable(subscriptions) - - return Observable(subscribe) - - -__all__ = ["zip_"] diff --git a/frogpilot/third_party/reactivex/observer/__init__.py b/frogpilot/third_party/reactivex/observer/__init__.py deleted file mode 100644 index d68f8991..00000000 --- a/frogpilot/third_party/reactivex/observer/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -from .autodetachobserver import AutoDetachObserver -from .observeonobserver import ObserveOnObserver -from .observer import Observer -from .scheduledobserver import ScheduledObserver - -__all__ = ["AutoDetachObserver", "ObserveOnObserver", "Observer", "ScheduledObserver"] diff --git a/frogpilot/third_party/reactivex/observer/autodetachobserver.py b/frogpilot/third_party/reactivex/observer/autodetachobserver.py deleted file mode 100644 index ca615287..00000000 --- a/frogpilot/third_party/reactivex/observer/autodetachobserver.py +++ /dev/null @@ -1,65 +0,0 @@ -from typing import Optional, TypeVar - -from reactivex.disposable import SingleAssignmentDisposable -from reactivex.internal import default_error, noop - -from .. import abc, typing - -_T_in = TypeVar("_T_in", contravariant=True) - - -class AutoDetachObserver(abc.ObserverBase[_T_in]): - def __init__( - self, - on_next: Optional[typing.OnNext[_T_in]] = None, - on_error: Optional[typing.OnError] = None, - on_completed: Optional[typing.OnCompleted] = None, - ) -> None: - self._on_next = on_next or noop - self._on_error = on_error or default_error - self._on_completed = on_completed or noop - - self._subscription = SingleAssignmentDisposable() - self.is_stopped = False - - def on_next(self, value: _T_in) -> None: - if self.is_stopped: - return - self._on_next(value) - - def on_error(self, error: Exception) -> None: - if self.is_stopped: - return - self.is_stopped = True - - try: - self._on_error(error) - finally: - self.dispose() - - def on_completed(self) -> None: - if self.is_stopped: - return - self.is_stopped = True - - try: - self._on_completed() - finally: - self.dispose() - - def set_disposable(self, value: abc.DisposableBase) -> None: - self._subscription.disposable = value - - subscription = property(fset=set_disposable) - - def dispose(self) -> None: - self.is_stopped = True - self._subscription.dispose() - - def fail(self, exn: Exception) -> bool: - if self.is_stopped: - return False - - self.is_stopped = True - self._on_error(exn) - return True diff --git a/frogpilot/third_party/reactivex/observer/observeonobserver.py b/frogpilot/third_party/reactivex/observer/observeonobserver.py deleted file mode 100644 index 8c4a20b9..00000000 --- a/frogpilot/third_party/reactivex/observer/observeonobserver.py +++ /dev/null @@ -1,19 +0,0 @@ -from typing import TypeVar - -from .scheduledobserver import ScheduledObserver - -_T = TypeVar("_T") - - -class ObserveOnObserver(ScheduledObserver[_T]): - def _on_next_core(self, value: _T) -> None: - super()._on_next_core(value) - self.ensure_active() - - def _on_error_core(self, error: Exception) -> None: - super()._on_error_core(error) - self.ensure_active() - - def _on_completed_core(self) -> None: - super()._on_completed_core() - self.ensure_active() diff --git a/frogpilot/third_party/reactivex/observer/observer.py b/frogpilot/third_party/reactivex/observer/observer.py deleted file mode 100644 index 11ec0e09..00000000 --- a/frogpilot/third_party/reactivex/observer/observer.py +++ /dev/null @@ -1,113 +0,0 @@ -from __future__ import annotations - -from typing import TYPE_CHECKING, Callable, Optional, TypeVar - -from reactivex import abc -from reactivex.internal.basic import default_error, noop -from reactivex.typing import OnCompleted, OnError, OnNext - -_T_in = TypeVar("_T_in", contravariant=True) - -if TYPE_CHECKING: - from reactivex.notification import Notification -else: - - class Notification: - pass - - -class Observer(abc.ObserverBase[_T_in], abc.DisposableBase): - """Base class for implementations of the Observer class. This base - class enforces the grammar of observers where OnError and - OnCompleted are terminal messages. - """ - - def __init__( - self, - on_next: Optional[OnNext[_T_in]] = None, - on_error: Optional[OnError] = None, - on_completed: Optional[OnCompleted] = None, - ) -> None: - self.is_stopped = False - self._handler_on_next: OnNext[_T_in] = on_next or noop - self._handler_on_error: OnError = on_error or default_error - self._handler_on_completed: OnCompleted = on_completed or noop - - def on_next(self, value: _T_in) -> None: - """Notify the observer of a new element in the sequence.""" - if not self.is_stopped: - self._on_next_core(value) - - def _on_next_core(self, value: _T_in) -> None: - """For Subclassing purpose. This method is called by `on_next()` - method until the observer is stopped. - """ - self._handler_on_next(value) - - def on_error(self, error: Exception) -> None: - """Notify the observer that an exception has occurred. - - Args: - error: The error that occurred. - """ - - if not self.is_stopped: - self.is_stopped = True - self._on_error_core(error) - - def _on_error_core(self, error: Exception) -> None: - """For Subclassing purpose. This method is called by `on_error()` - method until the observer is stopped. - """ - self._handler_on_error(error) - - def on_completed(self) -> None: - """Notifies the observer of the end of the sequence.""" - - if not self.is_stopped: - self.is_stopped = True - self._on_completed_core() - - def _on_completed_core(self) -> None: - """For Subclassing purpose. This method is called by `on_completed()` - method until the observer is stopped. - """ - self._handler_on_completed() - - def dispose(self) -> None: - """Disposes the observer, causing it to transition to the - stopped state.""" - self.is_stopped = True - - def fail(self, exn: Exception) -> bool: - if not self.is_stopped: - self.is_stopped = True - self._on_error_core(exn) - return True - - return False - - def throw(self, error: Exception) -> None: - import traceback - - traceback.print_stack() - raise error - - def to_notifier(self) -> Callable[[Notification[_T_in]], None]: - """Creates a notification callback from an observer. - - Returns the action that forwards its input notification to the - underlying observer.""" - - def func(notifier: Notification[_T_in]) -> None: - return notifier.accept(self) - - return func - - def as_observer(self) -> abc.ObserverBase[_T_in]: - """Hides the identity of an observer. - - Returns an observer that hides the identity of the specified - observer. - """ - return Observer(self.on_next, self.on_error, self.on_completed) diff --git a/frogpilot/third_party/reactivex/observer/scheduledobserver.py b/frogpilot/third_party/reactivex/observer/scheduledobserver.py deleted file mode 100644 index 744a7699..00000000 --- a/frogpilot/third_party/reactivex/observer/scheduledobserver.py +++ /dev/null @@ -1,81 +0,0 @@ -import threading -from typing import Any, List, TypeVar - -from reactivex import abc, typing -from reactivex.disposable import SerialDisposable - -from .observer import Observer - -_T_in = TypeVar("_T_in", contravariant=True) - - -class ScheduledObserver(Observer[_T_in]): - def __init__( - self, scheduler: abc.SchedulerBase, observer: abc.ObserverBase[_T_in] - ) -> None: - super().__init__() - - self.scheduler = scheduler - self.observer = observer - - self.lock = threading.RLock() - self.is_acquired = False - self.has_faulted = False - self.queue: List[typing.Action] = [] - self.disposable = SerialDisposable() - - # Note to self: list append is thread safe - # http://effbot.org/pyfaq/what-kinds-of-global-value-mutation-are-thread-safe.htm - - def _on_next_core(self, value: Any) -> None: - def action() -> None: - self.observer.on_next(value) - - self.queue.append(action) - - def _on_error_core(self, error: Exception) -> None: - def action() -> None: - self.observer.on_error(error) - - self.queue.append(action) - - def _on_completed_core(self) -> None: - def action() -> None: - self.observer.on_completed() - - self.queue.append(action) - - def ensure_active(self) -> None: - is_owner = False - - with self.lock: - if not self.has_faulted and self.queue: - is_owner = not self.is_acquired - self.is_acquired = True - - if is_owner: - self.disposable.disposable = self.scheduler.schedule(self.run) - - def run(self, scheduler: abc.SchedulerBase, state: Any) -> None: - parent = self - - with self.lock: - if parent.queue: - work = parent.queue.pop(0) - else: - parent.is_acquired = False - return - - try: - work() - except Exception: - with self.lock: - parent.queue = [] - parent.has_faulted = True - raise - - self.scheduler.schedule(self.run) - - def dispose(self) -> None: - super().dispose() - self.disposable.dispose() diff --git a/frogpilot/third_party/reactivex/operators/__init__.py b/frogpilot/third_party/reactivex/operators/__init__.py deleted file mode 100644 index 3413e535..00000000 --- a/frogpilot/third_party/reactivex/operators/__init__.py +++ /dev/null @@ -1,4394 +0,0 @@ -# pylint: disable=too-many-lines,redefined-builtin,import-outside-toplevel - - -from asyncio import Future -from typing import ( - TYPE_CHECKING, - Any, - Callable, - Dict, - Iterable, - List, - Optional, - Set, - Tuple, - Type, - TypeVar, - Union, - cast, - overload, -) - -from reactivex import ( - ConnectableObservable, - GroupedObservable, - Notification, - Observable, - abc, - compose, - typing, -) -from reactivex.internal.basic import identity -from reactivex.internal.utils import NotSet -from reactivex.subject import Subject -from reactivex.typing import ( - Accumulator, - Comparer, - Mapper, - MapperIndexed, - Predicate, - PredicateIndexed, -) - -_T = TypeVar("_T") -_T1 = TypeVar("_T1") -_T2 = TypeVar("_T2") -_TKey = TypeVar("_TKey") -_TState = TypeVar("_TState") -_TValue = TypeVar("_TValue") -_TRight = TypeVar("_TRight") -_TLeft = TypeVar("_TLeft") - -_A = TypeVar("_A") -_B = TypeVar("_B") -_C = TypeVar("_C") -_D = TypeVar("_D") - - -def all(predicate: Predicate[_T]) -> Callable[[Observable[_T]], Observable[bool]]: - """Determines whether all elements of an observable sequence satisfy - a condition. - - .. marble:: - :alt: all - - --1--2--3--4--5-| - [ all(i: i<10) ] - ----------------true-| - - Example: - >>> op = all(lambda value: value.length > 3) - - Args: - predicate: A function to test each element for a condition. - - Returns: - An operator function that takes an observable source and - returns an observable sequence containing a single element - determining whether all elements in the source sequence pass - the test in the specified predicate. - """ - from ._all import all_ - - return all_(predicate) - - -def amb(right_source: Observable[_T]) -> Callable[[Observable[_T]], Observable[_T]]: - """Propagates the observable sequence that reacts first. - - .. marble:: - :alt: amb - - ---8--6--9-----------| - --1--2--3---5--------| - ----------10-20-30---| - [ amb() ] - --1--2--3---5--------| - - Example: - >>> op = amb(ys) - - Returns: - An operator function that takes an observable source and - returns an observable sequence that surfaces any of the given - sequences, whichever reacted first. - """ - from ._amb import amb_ - - return amb_(right_source) - - -def as_observable() -> Callable[[Observable[_T]], Observable[_T]]: - """Hides the identity of an observable sequence. - - Returns: - An operator function that takes an observable source and - returns and observable sequence that hides the identity of the - source sequence. - """ - from ._asobservable import as_observable_ - - return as_observable_() - - -def average( - key_mapper: Optional[Mapper[_T, float]] = None, -) -> Callable[[Observable[_T]], Observable[float]]: - """The average operator. - - Computes the average of an observable sequence of values that - are in the sequence or obtained by invoking a transform function on - each element of the input sequence if present. - - .. marble:: - :alt: average - - ---1--2--3--4----| - [ average() ] - -----------------2.5-| - - Examples: - >>> op = average() - >>> op = average(lambda x: x.value) - - Args: - key_mapper: [Optional] A transform function to apply to each element. - - Returns: - An operator function that takes an observable source and - returns an observable sequence containing a single element with - the average of the sequence of values. - """ - from ._average import average_ - - return average_(key_mapper) - - -def buffer( - boundaries: Observable[Any], -) -> Callable[[Observable[_T]], Observable[List[_T]]]: - """Projects each element of an observable sequence into zero or - more buffers. - - .. marble:: - :alt: buffer - - ---a-----b-----c--------| - --1--2--3--4--5--6--7---| - [ buffer() ] - ---1-----2,3---4,5------| - - Examples: - >>> res = buffer(reactivex.interval(1.0)) - - Args: - boundaries: Observable sequence whose elements denote the - creation and completion of buffers. - - Returns: - A function that takes an observable source and returns an - observable sequence of buffers. - """ - from ._buffer import buffer_ - - return buffer_(boundaries) - - -def buffer_when( - closing_mapper: Callable[[], Observable[Any]], -) -> Callable[[Observable[_T]], Observable[List[_T]]]: - """Projects each element of an observable sequence into zero or - more buffers. - - .. marble:: - :alt: buffer_when - - --------c-| - --------c-| - --------c-| - ---1--2--3--4--5--6-------| - [ buffer_when() ] - +-------1,2-----3,4,5---6-| - - Examples: - >>> res = buffer_when(lambda: reactivex.timer(0.5)) - - Args: - closing_mapper: A function invoked to define the closing of each - produced buffer. A buffer is started when the previous one is - closed, resulting in non-overlapping buffers. The buffer is closed - when one item is emitted or when the observable completes. - - Returns: - A function that takes an observable source and returns an - observable sequence of windows. - """ - from ._buffer import buffer_when_ - - return buffer_when_(closing_mapper) - - -def buffer_toggle( - openings: Observable[Any], closing_mapper: Callable[[Any], Observable[Any]] -) -> Callable[[Observable[_T]], Observable[List[_T]]]: - """Projects each element of an observable sequence into zero or - more buffers. - - .. marble:: - :alt: buffer_toggle - - ---a-----------b--------------| - ---d--| - --------e--| - ----1--2--3--4--5--6--7--8----| - [ buffer_toggle() ] - ------1----------------5,6,7--| - - >>> res = buffer_toggle(reactivex.interval(0.5), lambda i: reactivex.timer(i)) - - Args: - openings: Observable sequence whose elements denote the - creation of buffers. - closing_mapper: A function invoked to define the closing of each - produced buffer. Value from openings Observable that initiated - the associated buffer is provided as argument to the function. The - buffer is closed when one item is emitted or when the observable - completes. - - Returns: - A function that takes an observable source and returns an - observable sequence of windows. - """ - from ._buffer import buffer_toggle_ - - return buffer_toggle_(openings, closing_mapper) - - -def buffer_with_count( - count: int, skip: Optional[int] = None -) -> Callable[[Observable[_T]], Observable[List[_T]]]: - """Projects each element of an observable sequence into zero or more - buffers which are produced based on element count information. - - .. marble:: - :alt: buffer_with_count - - ----1-2-3-4-5-6------| - [buffer_with_count(3)] - --------1,2,3-4,5,6--| - - Examples: - >>> res = buffer_with_count(10)(xs) - >>> res = buffer_with_count(10, 1)(xs) - - Args: - count: Length of each buffer. - skip: [Optional] Number of elements to skip between - creation of consecutive buffers. If not provided, defaults to - the count. - - Returns: - A function that takes an observable source and returns an - observable sequence of buffers. - """ - from ._buffer import buffer_with_count_ - - return buffer_with_count_(count, skip) - - -def buffer_with_time( - timespan: typing.RelativeTime, - timeshift: Optional[typing.RelativeTime] = None, - scheduler: Optional[abc.SchedulerBase] = None, -) -> Callable[[Observable[_T]], Observable[List[_T]]]: - """Projects each element of an observable sequence into zero or more - buffers which are produced based on timing information. - - .. marble:: - :alt: buffer_with_time - - ---1-2-3-4-5-6-----| - [buffer_with_time()] - -------1,2,3-4,5,6-| - - Examples: - >>> # non-overlapping segments of 1 second - >>> res = buffer_with_time(1.0) - >>> # segments of 1 second with time shift 0.5 seconds - >>> res = buffer_with_time(1.0, 0.5) - - Args: - timespan: Length of each buffer (specified as a float denoting seconds - or an instance of timedelta). - timeshift: [Optional] Interval between creation of consecutive buffers - (specified as a float denoting seconds or an instance of timedelta). - If not specified, the timeshift will be the same as the timespan - argument, resulting in non-overlapping adjacent buffers. - scheduler: [Optional] Scheduler to run the timer on. If not specified, - the timeout scheduler is used - - Returns: - An operator function that takes an observable source and - returns an observable sequence of buffers. - """ - from ._bufferwithtime import buffer_with_time_ - - return buffer_with_time_(timespan, timeshift, scheduler) - - -def buffer_with_time_or_count( - timespan: typing.RelativeTime, - count: int, - scheduler: Optional[abc.SchedulerBase] = None, -) -> Callable[[Observable[_T]], Observable[List[_T]]]: - """Projects each element of an observable sequence into a buffer - that is completed when either it's full or a given amount of time - has elapsed. - - .. marble:: - :alt: buffer_with_time_or_count - - --1-2-3-4-5-6------| - [ buffer() ] - ------1,2,3-4,5,6--| - - Examples: - >>> # 5s or 50 items in an array - >>> res = source._buffer_with_time_or_count(5.0, 50) - >>> # 5s or 50 items in an array - >>> res = source._buffer_with_time_or_count(5.0, 50, Scheduler.timeout) - - Args: - timespan: Maximum time length of a buffer. - count: Maximum element count of a buffer. - scheduler: [Optional] Scheduler to run buffering timers on. If - not specified, the timeout scheduler is used. - - Returns: - An operator function that takes an observable source and - returns an observable sequence of buffers. - """ - from ._bufferwithtimeorcount import buffer_with_time_or_count_ - - return buffer_with_time_or_count_(timespan, count, scheduler) - - -def catch( - handler: Union[ - Observable[_T], Callable[[Exception, Observable[_T]], Observable[_T]] - ], -) -> Callable[[Observable[_T]], Observable[_T]]: - """Continues an observable sequence that is terminated by an - exception with the next observable sequence. - - .. marble:: - :alt: catch - - ---1---2---3-* - a-7-8-| - [ catch(a) ] - ---1---2---3---7-8-| - - Examples: - >>> op = catch(ys) - >>> op = catch(lambda ex, src: ys(ex)) - - Args: - handler: Second observable sequence used to produce - results when an error occurred in the first sequence, or an - exception handler function that returns an observable sequence - given the error and source observable that occurred in the - first sequence. - - Returns: - A function taking an observable source and returns an - observable sequence containing the first sequence's elements, - followed by the elements of the handler sequence in case an - exception occurred. - """ - from ._catch import catch_ - - return catch_(handler) - - -def combine_latest( - *others: Observable[Any], -) -> Callable[[Observable[Any]], Observable[Any]]: - """Merges the specified observable sequences into one observable - sequence by creating a tuple whenever any of the - observable sequences produces an element. - - .. marble:: - :alt: combine_latest - - ---a-----b--c------| - --1---2--------3---| - [ combine_latest() ] - ---a1-a2-b2-c2-c3--| - - Examples: - >>> obs = combine_latest(other) - >>> obs = combine_latest(obs1, obs2, obs3) - - Returns: - An operator function that takes an observable sources and - returns an observable sequence containing the result of - combining elements of the sources into a tuple. - """ - from ._combinelatest import combine_latest_ - - return combine_latest_(*others) - - -def concat(*sources: Observable[_T]) -> Callable[[Observable[_T]], Observable[_T]]: - """Concatenates all the observable sequences. - - .. marble:: - :alt: concat - - ---1--2--3--| - --6--8--| - [ concat() ] - ---1--2--3----6--8-| - - Examples: - >>> op = concat(xs, ys, zs) - - Returns: - An operator function that takes one or more observable sources and - returns an observable sequence that contains the elements of - each given sequence, in sequential order. - """ - from ._concat import concat_ - - return concat_(*sources) - - -def concat_map( - project: Mapper[_T1, Observable[_T2]], -) -> Callable[[Observable[_T1]], Observable[_T2]]: - """Projects each source value to an Observable which is merged in the - output Observable, in a serialized fashion waiting for each one to complete - before merging the next. - - Warning: if source values arrive endlessly and faster than their corresponding - inner Observables can complete, it will result in memory issues as inner - Observables amass in an unbounded buffer waiting - for their turn to be subscribed to. - - Note: concatMap is equivalent to mergeMap with concurrency parameter set to 1. - - .. marble:: - :alt: concat_map - - ---1------------2-----3----------------------------| - [ concat_map(i: 10*i---10*i---10*i|) ] - ---10---10---10-20---20---(20,30)---30---30--------| - - Examples: - >>> op = concat(lambda i: reactivex.timer(1.0).pipe(take(3))) - - Args: - project: Projecting function which takes the outer observable value - and emits the inner observable - - Returns: - An operator function that maps each value to the inner observable - and emits its values in order. - - """ - - return compose(map(project), merge(max_concurrent=1)) - - -def contains( - value: _T, comparer: Optional[typing.Comparer[_T]] = None -) -> Callable[[Observable[_T]], Observable[bool]]: - """Determines whether an observable sequence contains a specified - element with an optional equality comparer. - - .. marble:: - :alt: contains - - --1--2--3--4--| - [ contains(3) ] - --------------true-| - - Examples: - >>> op = contains(42) - >>> op = contains({ "value": 42 }, lambda x, y: x["value"] == y["value"]) - - Args: - value: The value to locate in the source sequence. - comparer: [Optional] An equality comparer to compare elements. - - Returns: - A function that takes a source observable that returns an - observable sequence containing a single element determining - whether the source sequence contains an element that has the - specified value. - """ - from ._contains import contains_ - - return contains_(value, comparer) - - -def count( - predicate: Optional[typing.Predicate[_T]] = None, -) -> Callable[[Observable[_T]], Observable[int]]: - """Returns an observable sequence containing a value that - represents how many elements in the specified observable sequence - satisfy a condition if provided, else the count of items. - - .. marble:: - :alt: count - - --1--2--3--4--| - [ count(i: i>2) ] - --------------2-| - - Examples: - >>> op = count() - >>> op = count(lambda x: x > 3) - - Args: - predicate: A function to test each element for a condition. - - Returns: - An operator function that takes an observable source and - returns an observable sequence containing a single element with - a number that represents how many elements in the input - sequence satisfy the condition in the predicate function if - provided, else the count of items in the sequence. - """ - - from ._count import count_ - - return count_(predicate) - - -def debounce( - duetime: typing.RelativeTime, scheduler: Optional[abc.SchedulerBase] = None -) -> Callable[[Observable[_T]], Observable[_T]]: - """Ignores values from an observable sequence which are followed by - another value before duetime. - - .. marble:: - :alt: debounce - - --1--2-3-4--5------| - [ debounce() ] - ----1------4---5---| - - Example: - >>> res = debounce(5.0) # 5 seconds - - Args: - duetime: Duration of the throttle period for each value - (specified as a float denoting seconds or an instance of timedelta). - scheduler: Scheduler to debounce values on. - - Returns: - An operator function that takes the source observable and - returns the debounced observable sequence. - """ - from ._debounce import debounce_ - - return debounce_(duetime, scheduler) - - -throttle_with_timeout = debounce - - -@overload -def default_if_empty( - default_value: _T, -) -> Callable[[Observable[_T]], Observable[_T]]: ... - - -@overload -def default_if_empty() -> Callable[[Observable[_T]], Observable[Optional[_T]]]: ... - - -def default_if_empty( - default_value: Any = None, -) -> Callable[[Observable[Any]], Observable[Any]]: - """Returns the elements of the specified sequence or the specified - value in a singleton sequence if the sequence is empty. - - .. marble:: - :alt: default_if_empty - - ----------| - [default_if_empty(42)] - ----------42-| - - Examples: - >>> res = obs = default_if_empty() - >>> obs = default_if_empty(False) - - Args: - default_value: The value to return if the sequence is empty. If - not provided, this defaults to None. - - Returns: - An operator function that takes an observable source and - returns an observable sequence that contains the specified - default value if the source is empty otherwise, the elements of - the source. - """ - from ._defaultifempty import default_if_empty_ - - return default_if_empty_(default_value) - - -def delay_subscription( - duetime: typing.AbsoluteOrRelativeTime, - scheduler: Optional[abc.SchedulerBase] = None, -) -> Callable[[Observable[_T]], Observable[_T]]: - """Time shifts the observable sequence by delaying the - subscription. - - .. marble:: - :alt: delay_subscription - - ----1--2--3--4-----| - [ delay() ] - --------1--2--3--4-| - - Example: - >>> res = delay_subscription(5.0) # 5s - - Args: - duetime: Absolute or relative time to perform the subscription - at. - scheduler: Scheduler to delay subscription on. - - Returns: - A function that take a source observable and returns a - time-shifted observable sequence. - """ - from ._delaysubscription import delay_subscription_ - - return delay_subscription_(duetime, scheduler=scheduler) - - -def delay_with_mapper( - subscription_delay: Union[ - Observable[Any], - typing.Mapper[Any, Observable[Any]], - None, - ] = None, - delay_duration_mapper: Optional[typing.Mapper[_T, Observable[Any]]] = None, -) -> Callable[[Observable[_T]], Observable[_T]]: - """Time shifts the observable sequence based on a subscription - delay and a delay mapper function for each element. - - .. marble:: - :alt: delay_with_mapper - - ----1--2--3--4-----| - [ delay() ] - --------1--2--3--4-| - - Examples: - >>> # with mapper only - >>> res = source.delay_with_mapper(lambda x: reactivex.timer(5.0)) - >>> # with delay and mapper - >>> res = source.delay_with_mapper( - reactivex.timer(2.0), lambda x: reactivex.timer(x) - ) - - Args: - subscription_delay: [Optional] Sequence indicating the delay - for the subscription to the source. - delay_duration_mapper: [Optional] Selector function to retrieve - a sequence indicating the delay for each given element. - - Returns: - A function that takes an observable source and returns a - time-shifted observable sequence. - """ - from ._delaywithmapper import delay_with_mapper_ - - return delay_with_mapper_(subscription_delay, delay_duration_mapper) - - -def dematerialize() -> Callable[[Observable[Notification[_T]]], Observable[_T]]: - """Dematerialize operator. - - Dematerializes the explicit notification values of an - observable sequence as implicit notifications. - - Returns: - An observable sequence exhibiting the behavior - corresponding to the source sequence's notification values. - """ - from ._dematerialize import dematerialize_ - - return dematerialize_() - - -def delay( - duetime: typing.RelativeTime, scheduler: Optional[abc.SchedulerBase] = None -) -> Callable[[Observable[_T]], Observable[_T]]: - """The delay operator. - - .. marble:: - :alt: delay - - ----1--2--3--4-----| - [ delay() ] - --------1--2--3--4-| - - Time shifts the observable sequence by duetime. The relative time - intervals between the values are preserved. - - Examples: - >>> res = delay(timedelta(seconds=10)) - >>> res = delay(5.0) - - Args: - duetime: Relative time, specified as a float denoting seconds or an - instance of timedelta, by which to shift the observable sequence. - scheduler: [Optional] Scheduler to run the delay timers on. - If not specified, the timeout scheduler is used. - - Returns: - A partially applied operator function that takes the source - observable and returns a time-shifted sequence. - """ - from ._delay import delay_ - - return delay_(duetime, scheduler) - - -def distinct( - key_mapper: Optional[Mapper[_T, _TKey]] = None, - comparer: Optional[Comparer[_TKey]] = None, -) -> Callable[[Observable[_T]], Observable[_T]]: - """Returns an observable sequence that contains only distinct - elements according to the key_mapper and the comparer. Usage of - this operator should be considered carefully due to the maintenance - of an internal lookup structure which can grow large. - - .. marble:: - :alt: distinct - - -0-1-2-1-3-4-2-0---| - [ distinct() ] - -0-1-2---3-4-------| - - - Examples: - >>> res = obs = xs.distinct() - >>> obs = xs.distinct(lambda x: x.id) - >>> obs = xs.distinct(lambda x: x.id, lambda a,b: a == b) - - Args: - key_mapper: [Optional] A function to compute the comparison - key for each element. - comparer: [Optional] Used to compare items in the collection. - - Returns: - An operator function that takes an observable source and - returns an observable sequence only containing the distinct - elements, based on a computed key value, from the source - sequence. - """ - from ._distinct import distinct_ - - return distinct_(key_mapper, comparer) - - -def distinct_until_changed( - key_mapper: Optional[Mapper[_T, _TKey]] = None, - comparer: Optional[Comparer[_TKey]] = None, -) -> Callable[[Observable[_T]], Observable[_T]]: - """Returns an observable sequence that contains only distinct - contiguous elements according to the key_mapper and the comparer. - - .. marble:: - :alt: distinct_until_changed - - -0-1-1-2-3-1-2-2-3-| - [ distinct() ] - -0-1---2-3-1-2---3-| - - - Examples: - >>> op = distinct_until_changed(); - >>> op = distinct_until_changed(lambda x: x.id) - >>> op = distinct_until_changed(lambda x: x.id, lambda x, y: x == y) - - Args: - key_mapper: [Optional] A function to compute the comparison key - for each element. If not provided, it projects the value. - comparer: [Optional] Equality comparer for computed key values. - If not provided, defaults to an equality comparer function. - - Returns: - An operator function that takes an observable source and - returns an observable sequence only containing the distinct - contiguous elements, based on a computed key value, from the - source sequence. - """ - from ._distinctuntilchanged import distinct_until_changed_ - - return distinct_until_changed_(key_mapper, comparer) - - -def do(observer: abc.ObserverBase[_T]) -> Callable[[Observable[_T]], Observable[_T]]: - """Invokes an action for each element in the observable sequence - and invokes an action on graceful or exceptional termination of the - observable sequence. This method can be used for debugging, - logging, etc. of query behavior by intercepting the message stream - to run arbitrary actions for messages on the pipeline. - - .. marble:: - :alt: do - - ----1---2---3---4---| - [ do(i: foo()) ] - ----1---2---3---4---| - - - >>> do(observer) - - Args: - observer: Observer - - Returns: - An operator function that takes the source observable and - returns the source sequence with the side-effecting behavior - applied. - """ - from ._do import do_ - - return do_(observer) - - -def do_action( - on_next: Optional[typing.OnNext[_T]] = None, - on_error: Optional[typing.OnError] = None, - on_completed: Optional[typing.OnCompleted] = None, -) -> Callable[[Observable[_T]], Observable[_T]]: - """Invokes an action for each element in the observable sequence - and invokes an action on graceful or exceptional termination of the - observable sequence. This method can be used for debugging, - logging, etc. of query behavior by intercepting the message stream - to run arbitrary actions for messages on the pipeline. - - .. marble:: - :alt: do_action - - ----1---2---3---4---| - [do_action(i: foo())] - ----1---2---3---4---| - - Examples: - >>> do_action(send) - >>> do_action(on_next, on_error) - >>> do_action(on_next, on_error, on_completed) - - Args: - on_next: [Optional] Action to invoke for each element in the - observable sequence. - on_error: [Optional] Action to invoke on exceptional - termination of the observable sequence. - on_completed: [Optional] Action to invoke on graceful - termination of the observable sequence. - - Returns: - An operator function that takes the source observable an - returns the source sequence with the side-effecting behavior - applied. - """ - from ._do import do_action_ - - return do_action_(on_next, on_error, on_completed) - - -def do_while( - condition: Predicate[Observable[_T]], -) -> Callable[[Observable[_T]], Observable[_T]]: - """Repeats source as long as condition holds emulating a do while - loop. - - .. marble:: - :alt: do_while - - --1--2--| - [ do_while() ] - --1--2--1--2--1--2--| - - - Args: - condition: The condition which determines if the source will be - repeated. - - Returns: - An observable sequence which is repeated as long - as the condition holds. - """ - from ._dowhile import do_while_ - - return do_while_(condition) - - -def element_at(index: int) -> Callable[[Observable[_T]], Observable[_T]]: - """Returns the element at a specified index in a sequence. - - .. marble:: - :alt: element_at - - ----1---2---3---4---| - [ element_at(2) ] - ------------3-| - - Example: - >>> res = source.element_at(5) - - Args: - index: The zero-based index of the element to retrieve. - - Returns: - An operator function that takes an observable source and - returns an observable sequence that produces the element at - the specified position in the source sequence. - """ - from ._elementatordefault import element_at_or_default_ - - return element_at_or_default_(index, False) - - -def element_at_or_default( - index: int, default_value: Optional[_T] = None -) -> Callable[[Observable[_T]], Observable[_T]]: - """Returns the element at a specified index in a sequence or a - default value if the index is out of range. - - .. marble:: - :alt: element_at_or_default - - --1---2---3---4-| - [ element_at(6, a) ] - ----------------a-| - - Example: - >>> res = source.element_at_or_default(5) - >>> res = source.element_at_or_default(5, 0) - - Args: - index: The zero-based index of the element to retrieve. - default_value: [Optional] The default value if the index is - outside the bounds of the source sequence. - - Returns: - A function that takes an observable source and returns an - observable sequence that produces the element at the - specified position in the source sequence, or a default value if - the index is outside the bounds of the source sequence. - """ - from ._elementatordefault import element_at_or_default_ - - return element_at_or_default_(index, True, default_value) - - -def exclusive() -> Callable[[Observable[Observable[_T]]], Observable[_T]]: - """Performs a exclusive waiting for the first to finish before - subscribing to another observable. Observables that come in between - subscriptions will be dropped on the floor. - - .. marble:: - :alt: exclusive - - -+---+-----+-------| - +-7-8-9-| - +-4-5-6-| - +-1-2-3-| - [ exclusive() ] - ---1-2-3-----7-8-9-| - - - Returns: - An exclusive observable with only the results that - happen when subscribed. - """ - from ._exclusive import exclusive_ - - return exclusive_() - - -def expand( - mapper: typing.Mapper[_T, Observable[_T]], -) -> Callable[[Observable[_T]], Observable[_T]]: - """Expands an observable sequence by recursively invoking mapper. - - Args: - mapper: Mapper function to invoke for each produced element, - resulting in another sequence to which the mapper will be - invoked recursively again. - - Returns: - An observable sequence containing all the elements produced - by the recursive expansion. - """ - from ._expand import expand_ - - return expand_(mapper) - - -def filter(predicate: Predicate[_T]) -> Callable[[Observable[_T]], Observable[_T]]: - """Filters the elements of an observable sequence based on a - predicate. - - .. marble:: - :alt: filter - - ----1---2---3---4---| - [ filter(i: i>2) ] - ------------3---4---| - - Example: - >>> op = filter(lambda value: value < 10) - - Args: - predicate: A function to test each source element for a - condition. - - Returns: - An operator function that takes an observable source and - returns an observable sequence that contains elements from the - input sequence that satisfy the condition. - """ - from ._filter import filter_ - - return filter_(predicate) - - -def filter_indexed( - predicate_indexed: Optional[PredicateIndexed[_T]] = None, -) -> Callable[[Observable[_T]], Observable[_T]]: - """Filters the elements of an observable sequence based on a - predicate by incorporating the element's index. - - .. marble:: - :alt: filter_indexed - - ----1---2---3---4---| - [ filter(i,id: id>2)] - ----------------4---| - - Example: - >>> op = filter_indexed(lambda value, index: (value + index) < 10) - - Args: - predicate: A function to test each source element for a - condition; the second parameter of the function represents - the index of the source element. - - Returns: - An operator function that takes an observable source and - returns an observable sequence that contains elements from the - input sequence that satisfy the condition. - """ - from ._filter import filter_indexed_ - - return filter_indexed_(predicate_indexed) - - -def finally_action(action: typing.Action) -> Callable[[Observable[_T]], Observable[_T]]: - """Invokes a specified action after the source observable sequence - terminates gracefully or exceptionally. - - .. marble:: - :alt: finally_action - - --1--2--3--4--| - a-6-7-| - [finally_action(a)] - --1--2--3--4--6-7-| - - Example: - >>> res = finally_action(lambda: print('sequence ended') - - Args: - action: Action to invoke after the source observable sequence - terminates. - - Returns: - An operator function that takes an observable source and - returns an observable sequence with the action-invoking - termination behavior applied. - """ - from ._finallyaction import finally_action_ - - return finally_action_(action) - - -def find( - predicate: Callable[[_T, int, Observable[_T]], bool], -) -> Callable[[Observable[_T]], Observable[Union[_T, None]]]: - """Searches for an element that matches the conditions defined by - the specified predicate, and returns the first occurrence within - the entire Observable sequence. - - .. marble:: - :alt: find - - --1--2--3--4--3--2--| - [ find(3) ] - --------3-| - - Args: - predicate: The predicate that defines the conditions of the - element to search for. - - Returns: - An operator function that takes an observable source and - returns an observable sequence with the first element that - matches the conditions defined by the specified predicate, if - found otherwise, None. - """ - from ._find import find_value_ - - return cast( - Callable[[Observable[_T]], Observable[Union[_T, None]]], - find_value_(predicate, False), - ) - - -def find_index( - predicate: Callable[[_T, int, Observable[_T]], bool], -) -> Callable[[Observable[_T]], Observable[Union[int, None]]]: - """Searches for an element that matches the conditions defined by - the specified predicate, and returns an Observable sequence with the - zero-based index of the first occurrence within the entire - Observable sequence. - - .. marble:: - :alt: find_index - - --1--2--3--4--3--2--| - [ find_index(3) ] - --------2-| - - Args: - predicate: The predicate that defines the conditions of the - element to search for. - - Returns: - An operator function that takes an observable source and - returns an observable sequence with the zero-based index of the - first occurrence of an element that matches the conditions - defined by match, if found; otherwise, -1. - """ - from ._find import find_value_ - - return cast( - Callable[[Observable[_T]], Observable[Union[int, None]]], - find_value_(predicate, True), - ) - - -def first( - predicate: Optional[Predicate[_T]] = None, -) -> Callable[[Observable[_T]], Observable[_T]]: - """Returns the first element of an observable sequence that - satisfies the condition in the predicate if present else the first - item in the sequence. - - .. marble:: - :alt: first - - ---1---2---3---4----| - [ first(i: i>1) ] - -------2-| - - - Examples: - >>> res = res = first() - >>> res = res = first(lambda x: x > 3) - - Args: - predicate: [Optional] A predicate function to evaluate for - elements in the source sequence. - - Returns: - A function that takes an observable source and returns an - observable sequence containing the first element in the - observable sequence that satisfies the condition in the - predicate if provided, else the first item in the sequence. - """ - from ._first import first_ - - return first_(predicate) - - -def first_or_default( - predicate: Optional[Predicate[_T]] = None, default_value: Optional[_T] = None -) -> Callable[[Observable[_T]], Observable[_T]]: - """Returns the first element of an observable sequence that - satisfies the condition in the predicate, or a default value if no - such element exists. - - .. marble:: - :alt: first_or_default - - --1--2--3--4-| - [first(i: i>10, 42)] - -------------42-| - - Examples: - >>> res = first_or_default() - >>> res = first_or_default(lambda x: x > 3) - >>> res = first_or_default(lambda x: x > 3, 0) - >>> res = first_or_default(None, 0) - - Args: - predicate: [optional] A predicate function to evaluate for - elements in the source sequence. - default_value: [Optional] The default value if no such element - exists. If not specified, defaults to None. - - Returns: - A function that takes an observable source and returns an - observable sequence containing the first element in the - observable sequence that satisfies the condition in the - predicate, or a default value if no such element exists. - """ - from ._firstordefault import first_or_default_ - - return first_or_default_(predicate, default_value) - - -@overload -def flat_map( - mapper: Optional[Iterable[_T2]] = None, -) -> Callable[[Observable[Any]], Observable[_T2]]: ... - - -@overload -def flat_map( - mapper: Optional[Observable[_T2]] = None, -) -> Callable[[Observable[Any]], Observable[_T2]]: ... - - -@overload -def flat_map( - mapper: Optional[Mapper[_T1, Iterable[_T2]]] = None, -) -> Callable[[Observable[_T1]], Observable[_T2]]: ... - - -@overload -def flat_map( - mapper: Optional[Mapper[_T1, Observable[_T2]]] = None, -) -> Callable[[Observable[_T1]], Observable[_T2]]: ... - - -def flat_map( - mapper: Optional[Any] = None, -) -> Callable[[Observable[Any]], Observable[Any]]: - """The flat_map operator. - - .. marble:: - :alt: flat_map - - --1-2-3-| - [ flat_map(range) ] - --0-0-1-0-1-2-| - - - One of the Following: - Projects each element of an observable sequence to an observable - sequence and merges the resulting observable sequences into one - observable sequence. - - Example: - >>> flat_map(lambda x: Observable.range(0, x)) - - Or: - Projects each element of the source observable sequence to the - other observable sequence and merges the resulting observable - sequences into one observable sequence. - - Example: - >>> flat_map(Observable.of(1, 2, 3)) - - Args: - mapper: A transform function to apply to each element or an - observable sequence to project each element from the source - sequence onto. - - Returns: - An operator function that takes a source observable and returns - an observable sequence whose elements are the result of - invoking the one-to-many transform function on each element of - the input sequence. - """ - from ._flatmap import flat_map_ - - return flat_map_(mapper) - - -@overload -def flat_map_indexed( - mapper_indexed: Optional[Iterable[_T2]] = None, -) -> Callable[[Observable[Any]], Observable[_T2]]: ... - - -@overload -def flat_map_indexed( - mapper_indexed: Optional[Observable[_T2]] = None, -) -> Callable[[Observable[Any]], Observable[_T2]]: ... - - -@overload -def flat_map_indexed( - mapper_indexed: Optional[MapperIndexed[_T1, Iterable[_T2]]] = None, -) -> Callable[[Observable[_T1]], Observable[_T2]]: ... - - -@overload -def flat_map_indexed( - mapper_indexed: Optional[MapperIndexed[_T1, Observable[_T2]]] = None, -) -> Callable[[Observable[_T1]], Observable[_T2]]: ... - - -def flat_map_indexed( - mapper_indexed: Any = None, -) -> Callable[[Observable[Any]], Observable[Any]]: - """The `flat_map_indexed` operator. - - One of the Following: - Projects each element of an observable sequence to an observable - sequence and merges the resulting observable sequences into one - observable sequence. - - .. marble:: - :alt: flat_map_indexed - - --1-2-3-| - [ flat_map(range) ] - --0-0-1-0-1-2-| - - Example: - >>> source.flat_map_indexed(lambda x, i: Observable.range(0, x)) - - Or: - Projects each element of the source observable sequence to the - other observable sequence and merges the resulting observable - sequences into one observable sequence. - - Example: - >>> source.flat_map_indexed(Observable.of(1, 2, 3)) - - Args: - mapper_indexed: [Optional] A transform function to apply to - each element or an observable sequence to project each - element from the source sequence onto. - - Returns: - An operator function that takes an observable source and - returns an observable sequence whose elements are the result of - invoking the one-to-many transform function on each element of - the input sequence. - """ - from ._flatmap import flat_map_indexed_ - - return flat_map_indexed_(mapper_indexed) - - -def flat_map_latest( - mapper: Mapper[_T1, Union[Observable[_T2], "Future[_T2]"]], -) -> Callable[[Observable[_T1]], Observable[_T2]]: - """Projects each element of an observable sequence into a new - sequence of observable sequences by incorporating the element's - index and then transforms an observable sequence of observable - sequences into an observable sequence producing values only from - the most recent observable sequence. - - Args: - mapper: A transform function to apply to each source element. - The second parameter of the function represents the index - of the source element. - - Returns: - An operator function that takes an observable source and - returns an observable sequence whose elements are the result of - invoking the transform function on each element of source - producing an observable of Observable sequences and that at any - point in time produces the elements of the most recent inner - observable sequence that has been received. - """ - from ._flatmap import flat_map_latest_ - - return flat_map_latest_(mapper) - - -def fork_join( - *others: Observable[Any], -) -> Callable[[Observable[Any]], Observable[Tuple[Any, ...]]]: - """Wait for observables to complete and then combine last values - they emitted into a tuple. Whenever any of that observables completes - without emitting any value, result sequence will complete at that moment as well. - - .. marble:: - :alt: fork_join - - ---a-----b--c---d-| - --1---2------3-4---| - -a---------b---| - [ fork_join() ] - --------------------d4b| - - Examples: - >>> res = fork_join(obs1) - >>> res = fork_join(obs1, obs2, obs3) - - Returns: - An operator function that takes an observable source and - return an observable sequence containing the result - of combining last element from each source in given sequence. - """ - from ._forkjoin import fork_join_ - - return fork_join_(*others) - - -def group_by( - key_mapper: Mapper[_T, _TKey], - element_mapper: Optional[Mapper[_T, _TValue]] = None, - subject_mapper: Optional[Callable[[], Subject[_TValue]]] = None, -) -> Callable[[Observable[_T]], Observable[GroupedObservable[_TKey, _TValue]]]: - """Groups the elements of an observable sequence according to a - specified key mapper function and comparer and selects the - resulting elements by using a specified function. - - .. marble:: - :alt: group_by - - --1--2--a--3--b--c-| - [ group_by() ] - -+-----+-----------| - +a-----b--c-| - +1--2-----3-------| - - Examples: - >>> group_by(lambda x: x.id) - >>> group_by(lambda x: x.id, lambda x: x.name) - >>> group_by(lambda x: x.id, lambda x: x.name, lambda: ReplaySubject()) - - Keyword arguments: - key_mapper: A function to extract the key for each element. - element_mapper: [Optional] A function to map each source - element to an element in an observable group. - subject_mapper: A function that returns a subject used to initiate - a grouped observable. Default mapper returns a Subject object. - - Returns: - An operator function that takes an observable source and - returns a sequence of observable groups, each of which - corresponds to a unique key value, containing all elements that - share that same key value. - """ - from ._groupby import group_by_ - - return group_by_(key_mapper, element_mapper, subject_mapper) - - -def group_by_until( - key_mapper: Mapper[_T, _TKey], - element_mapper: Optional[Mapper[_T, _TValue]], - duration_mapper: Callable[[GroupedObservable[_TKey, _TValue]], Observable[Any]], - subject_mapper: Optional[Callable[[], Subject[_TValue]]] = None, -) -> Callable[[Observable[_T]], Observable[GroupedObservable[_TKey, _TValue]]]: - """Groups the elements of an observable sequence according to a - specified key mapper function. A duration mapper function is used - to control the lifetime of groups. When a group expires, it - receives an OnCompleted notification. When a new element with the - same key value as a reclaimed group occurs, the group will be - reborn with a new lifetime request. - - .. marble:: - :alt: group_by_until - - --1--2--a--3--b--c-| - [ group_by_until() ] - -+-----+-----------| - +a-----b--c-| - +1--2-----3-------| - - Examples: - >>> group_by_until(lambda x: x.id, None, lambda : reactivex.never()) - >>> group_by_until( - lambda x: x.id, lambda x: x.name, lambda grp: reactivex.never() - ) - >>> group_by_until( - lambda x: x.id, - lambda x: x.name, - lambda grp: reactivex.never(), - lambda: ReplaySubject() - ) - - Args: - key_mapper: A function to extract the key for each element. - element_mapper: A function to map each source element to an element in - an observable group. - duration_mapper: A function to signal the expiration of a group. - subject_mapper: A function that returns a subject used to initiate - a grouped observable. Default mapper returns a Subject object. - - Returns: - An operator function that takes an observable source and - returns a sequence of observable groups, each of which - corresponds to a unique key value, containing all elements that - share that same key value. If a group's lifetime expires, a new - group with the same key value can be created once an element - with such a key value is encountered. - """ - from ._groupbyuntil import group_by_until_ - - return group_by_until_(key_mapper, element_mapper, duration_mapper, subject_mapper) - - -def group_join( - right: Observable[_TRight], - left_duration_mapper: Callable[[_TLeft], Observable[Any]], - right_duration_mapper: Callable[[_TRight], Observable[Any]], -) -> Callable[[Observable[_TLeft]], Observable[Tuple[_TLeft, Observable[_TRight]]]]: - """Correlates the elements of two sequences based on overlapping - durations, and groups the results. - - .. marble:: - :alt: group_join - - -1---2----3---4----> - --a--------b-----c-> - [ group_join() ] - --a1-a2----b3-b4-c4| - - Args: - right: The right observable sequence to join elements for. - left_duration_mapper: A function to select the duration - (expressed as an observable sequence) of each element of - the left observable sequence, used to determine overlap. - right_duration_mapper: A function to select the duration - (expressed as an observable sequence) of each element of - the right observable sequence, used to determine overlap. - - - Returns: - An operator function that takes an observable source and - returns an observable sequence that contains elements combined into - a tuple from source elements that have an overlapping - duration. - """ - from ._groupjoin import group_join_ - - return group_join_(right, left_duration_mapper, right_duration_mapper) - - -def ignore_elements() -> Callable[[Observable[_T]], Observable[_T]]: - """Ignores all elements in an observable sequence leaving only the - termination messages. - - .. marble:: - :alt: ignore_elements - - ---1---2---3---4---| - [ ignore_elements()] - -------------------| - - Returns: - An operator function that takes an observable source and - returns an empty observable sequence that signals termination, - successful or exceptional, of the source sequence. - """ - from ._ignoreelements import ignore_elements_ - - return ignore_elements_() - - -def is_empty() -> Callable[[Observable[Any]], Observable[bool]]: - """Determines whether an observable sequence is empty. - - .. marble:: - :alt: is_empty - - -------| - [ is_empty() ] - -------True-| - - - Returns: - An operator function that takes an observable source and - returns an observable sequence containing a single element - determining whether the source sequence is empty. - """ - from ._isempty import is_empty_ - - return is_empty_() - - -def join( - right: Observable[_T2], - left_duration_mapper: Callable[[Any], Observable[Any]], - right_duration_mapper: Callable[[Any], Observable[Any]], -) -> Callable[[Observable[_T1]], Observable[Tuple[_T1, _T2]]]: - """Correlates the elements of two sequences based on overlapping - durations. - - .. marble:: - :alt: join - - -1---2----3---4----> - --a--------b-----c-> - [ join() ] - --a1-a2----b3-b4-c4| - - Args: - right: The right observable sequence to join elements for. - left_duration_mapper: A function to select the duration - (expressed as an observable sequence) of each element of - the left observable sequence, used to determine overlap. - right_duration_mapper: A function to select the duration - (expressed as an observable sequence) of each element of - the right observable sequence, used to determine overlap. - - Return: - An operator function that takes an observable source and - returns an observable sequence that contains elements combined - into a tuple from source elements that have an overlapping - duration. - """ - from ._join import join_ - - return join_(right, left_duration_mapper, right_duration_mapper) - - -def last( - predicate: Optional[Predicate[_T]] = None, -) -> Callable[[Observable[_T]], Observable[_T]]: - """The last operator. - - Returns the last element of an observable sequence that satisfies - the condition in the predicate if specified, else the last element. - - .. marble:: - :alt: last - - ---1--2--3--4-| - [ last() ] - ------------4-| - - Examples: - >>> op = last() - >>> op = last(lambda x: x > 3) - - Args: - predicate: [Optional] A predicate function to evaluate for - elements in the source sequence. - - Returns: - An operator function that takes an observable source and - returns an observable sequence containing the last element in - the observable sequence that satisfies the condition in the - predicate. - """ - from ._last import last_ - - return last_(predicate) - - -@overload -def last_or_default() -> Callable[[Observable[_T]], Observable[Optional[_T]]]: ... - - -@overload -def last_or_default( - default_value: _T, -) -> Callable[[Observable[_T]], Observable[_T]]: ... - - -@overload -def last_or_default( - default_value: _T, - predicate: Predicate[_T], -) -> Callable[[Observable[_T]], Observable[_T]]: ... - - -def last_or_default( - default_value: Any = None, - predicate: Optional[Predicate[_T]] = None, -) -> Callable[[Observable[_T]], Observable[Any]]: - """The last_or_default operator. - - Returns the last element of an observable sequence that satisfies - the condition in the predicate, or a default value if no such - element exists. - - .. marble:: - :alt: last - - ---1--2--3--4-| - [last_or_default(8)] - --------------8-| - - - Examples: - >>> res = last_or_default() - >>> res = last_or_default(lambda x: x > 3) - >>> res = last_or_default(lambda x: x > 3, 0) - >>> res = last_or_default(None, 0) - - Args: - predicate: [Optional] A predicate function to evaluate for - elements in the source sequence. - default_value: [Optional] The default value if no such element - exists. If not specified, defaults to None. - - Returns: - An operator function that takes an observable source and - returns an observable sequence containing the last element in - the observable sequence that satisfies the condition in the - predicate, or a default value if no such element exists. - """ - from ._lastordefault import last_or_default - - return last_or_default(default_value, predicate) - - -def map( - mapper: Optional[Mapper[_T1, _T2]] = None, -) -> Callable[[Observable[_T1]], Observable[_T2]]: - """The map operator. - - Project each element of an observable sequence into a new form. - - .. marble:: - :alt: map - - ---1---2---3---4---> - [ map(i: i*2) ] - ---2---4---6---8---> - - - Example: - >>> map(lambda value: value * 10) - - Args: - mapper: A transform function to apply to each source element. - - Returns: - A partially applied operator function that takes an observable - source and returns an observable sequence whose elements are - the result of invoking the transform function on each element - of the source. - """ - from ._map import map_ - - return map_(mapper) - - -def map_indexed( - mapper_indexed: Optional[MapperIndexed[_T1, _T2]] = None, -) -> Callable[[Observable[_T1]], Observable[_T2]]: - """Project each element of an observable sequence into a new form - by incorporating the element's index. - - .. marble:: - :alt: map_indexed - - ---1---2---3---4---> - [ map(i,id: i*2) ] - ---2---4---6---8---> - - Example: - >>> ret = map_indexed(lambda value, index: value * value + index) - - Args: - mapper_indexed: A transform function to apply to each source - element. The second parameter of the function represents - the index of the source element. - - Returns: - A partially applied operator function that takes an observable - source and returns an observable sequence whose elements are - the result of invoking the transform function on each element - of the source. - """ - from ._map import map_indexed_ - - return map_indexed_(mapper_indexed) - - -def materialize() -> Callable[[Observable[_T]], Observable[Notification[_T]]]: - """Materializes the implicit notifications of an observable - sequence as explicit notification values. - - Returns: - An operator function that takes an observable source and - returns an observable sequence containing the materialized - notification values from the source sequence. - """ - from ._materialize import materialize - - return materialize() - - -def max( - comparer: Optional[Comparer[_T]] = None, -) -> Callable[[Observable[_T]], Observable[_T]]: - """Returns the maximum value in an observable sequence according to - the specified comparer. - - .. marble:: - :alt: max - - ---1--2--3--4-| - [ max() ] - --------------4-| - - Examples: - >>> op = max() - >>> op = max(lambda x, y: x.value - y.value) - - Args: - comparer: [Optional] Comparer used to compare elements. - - Returns: - A partially applied operator function that takes an observable - source and returns an observable sequence containing a single - element with the maximum element in the source sequence. - """ - from ._max import max_ - - return max_(comparer) - - -def max_by( - key_mapper: Mapper[_T, _TKey], comparer: Optional[Comparer[_TKey]] = None -) -> Callable[[Observable[_T]], Observable[List[_T]]]: - """The max_by operator. - - Returns the elements in an observable sequence with the maximum - key value according to the specified comparer. - - .. marble:: - :alt: max_by - - ---1--2--3--4-| - [ max_by() ] - --------------4-| - - Examples: - >>> res = max_by(lambda x: x.value) - >>> res = max_by(lambda x: x.value, lambda x, y: x - y) - - Args: - key_mapper: Key mapper function. - comparer: [Optional] Comparer used to compare key values. - - Returns: - A partially applied operator function that takes an observable - source and return an observable sequence containing a list of - zero or more elements that have a maximum key value. - """ - from ._maxby import max_by_ - - return max_by_(key_mapper, comparer) - - -def merge( - *sources: Observable[Any], max_concurrent: Optional[int] = None -) -> Callable[[Observable[Any]], Observable[Any]]: - """Merges an observable sequence of observable sequences into an - observable sequence, limiting the number of concurrent - subscriptions to inner sequences. Or merges two observable - sequences into a single observable sequence. - - .. marble:: - :alt: merge - - ---1---2---3---4-| - -a---b---c---d--| - [ merge() ] - -a-1-b-2-c-3-d-4-| - - Examples: - >>> op = merge(max_concurrent=1) - >>> op = merge(other_source) - - Args: - max_concurrent: [Optional] Maximum number of inner observable - sequences being subscribed to concurrently or the second - observable sequence. - - Returns: - An operator function that takes an observable source and - returns the observable sequence that merges the elements of the - inner sequences. - """ - from ._merge import merge_ - - return merge_(*sources, max_concurrent=max_concurrent) - - -def merge_all() -> Callable[[Observable[Observable[_T]]], Observable[_T]]: - """The merge_all operator. - - Merges an observable sequence of observable sequences into an - observable sequence. - - .. marble:: - :alt: merge_all - - ---1---2---3---4-| - -a---b---c---d--| - [ merge_all() ] - -a-1-b-2-c-3-d-4-| - - Returns: - A partially applied operator function that takes an observable - source and returns the observable sequence that merges the - elements of the inner sequences. - """ - from ._merge import merge_all_ - - return merge_all_() - - -def min( - comparer: Optional[Comparer[_T]] = None, -) -> Callable[[Observable[_T]], Observable[_T]]: - """The `min` operator. - - Returns the minimum element in an observable sequence according to - the optional comparer else a default greater than less than check. - - .. marble:: - :alt: min - - ---1--2--3--4-| - [ min() ] - --------------1-| - - Examples: - >>> res = source.min() - >>> res = source.min(lambda x, y: x.value - y.value) - - Args: - comparer: [Optional] Comparer used to compare elements. - - Returns: - An operator function that takes an observable source and - returns an observable sequence containing a single element - with the minimum element in the source sequence. - """ - from ._min import min_ - - return min_(comparer) - - -def min_by( - key_mapper: Mapper[_T, _TKey], comparer: Optional[Comparer[_TKey]] = None -) -> Callable[[Observable[_T]], Observable[List[_T]]]: - """The `min_by` operator. - - Returns the elements in an observable sequence with the minimum key - value according to the specified comparer. - - .. marble:: - :alt: min_by - - ---1--2--3--4-| - [ min_by() ] - --------------1-| - - Examples: - >>> res = min_by(lambda x: x.value) - >>> res = min_by(lambda x: x.value, lambda x, y: x - y) - - Args: - key_mapper: Key mapper function. - comparer: [Optional] Comparer used to compare key values. - - Returns: - An operator function that takes an observable source and - reuturns an observable sequence containing a list of zero - or more elements that have a minimum key value. - """ - from ._minby import min_by_ - - return min_by_(key_mapper, comparer) - - -@overload -def multicast() -> Callable[[Observable[_T]], ConnectableObservable[_T]]: ... - - -@overload -def multicast( - subject: abc.SubjectBase[_T], -) -> Callable[[Observable[_T]], ConnectableObservable[_T]]: ... - - -@overload -def multicast( - *, - subject_factory: Callable[[Optional[abc.SchedulerBase]], abc.SubjectBase[_T]], - mapper: Optional[Callable[[Observable[_T]], Observable[_T2]]] = None, -) -> Callable[[Observable[_T]], Observable[_T2]]: ... - - -def multicast( - subject: Optional[abc.SubjectBase[_T]] = None, - *, - subject_factory: Optional[ - Callable[[Optional[abc.SchedulerBase]], abc.SubjectBase[_T]] - ] = None, - mapper: Optional[Callable[[Observable[_T]], Observable[_T2]]] = None, -) -> Callable[[Observable[_T]], Union[Observable[_T2], ConnectableObservable[_T]]]: - """Multicasts the source sequence notifications through an - instantiated subject into all uses of the sequence within a mapper - function. Each subscription to the resulting sequence causes a - separate multicast invocation, exposing the sequence resulting from - the mapper function's invocation. For specializations with fixed - subject types, see Publish, PublishLast, and Replay. - - Examples: - >>> res = multicast(observable) - >>> res = multicast( - subject_factory=lambda scheduler: Subject(), mapper=lambda x: x - ) - - Args: - subject_factory: Factory function to create an intermediate - subject through which the source sequence's elements will - be multicast to the mapper function. - subject: Subject to push source elements into. - mapper: [Optional] Mapper function which can use the - multicasted source sequence subject to the policies - enforced by the created subject. Specified only if - subject_factory" is a factory function. - - Returns: - An operator function that takes an observable source and - returns an observable sequence that contains the elements of a - sequence produced by multicasting the source sequence within a - mapper function. - """ - from ._multicast import multicast_ - - return multicast_(subject, subject_factory=subject_factory, mapper=mapper) - - -def observe_on( - scheduler: abc.SchedulerBase, -) -> Callable[[Observable[_T]], Observable[_T]]: - """Wraps the source sequence in order to run its observer callbacks - on the specified scheduler. - - Args: - scheduler: Scheduler to notify observers on. - - This only invokes observer callbacks on a scheduler. In case the - subscription and/or unsubscription actions have side-effects - that require to be run on a scheduler, use subscribe_on. - - Returns: - An operator function that takes an observable source and - returns the source sequence whose observations happen on the - specified scheduler. - """ - from ._observeon import observe_on_ - - return observe_on_(scheduler) - - -def on_error_resume_next( - second: Observable[_T], -) -> Callable[[Observable[_T]], Observable[_T]]: - """Continues an observable sequence that is terminated normally - or by an exception with the next observable sequence. - - .. marble:: - :alt: on_error - - ---1--2--3--4-* - e-a--b-| - [ on_error(e) ] - -1--2--3--4-a--b-| - - Keyword arguments: - second: Second observable sequence used to produce results - after the first sequence terminates. - - - Returns: - An observable sequence that concatenates the first and - second sequence, even if the first sequence terminates - exceptionally. - """ - - from ._onerrorresumenext import on_error_resume_next_ - - return on_error_resume_next_(second) - - -def pairwise() -> Callable[[Observable[_T]], Observable[Tuple[_T, _T]]]: - """The pairwise operator. - - Returns a new observable that triggers on the second and subsequent - triggerings of the input observable. The Nth triggering of the - input observable passes the arguments from the N-1th and Nth - triggering as a pair. The argument passed to the N-1th triggering - is held in hidden internal state until the Nth triggering occurs. - - Returns: - An operator function that takes an observable source and - returns an observable that triggers on successive pairs of - observations from the input observable as an array. - """ - from ._pairwise import pairwise_ - - return pairwise_() - - -def partition( - predicate: Predicate[_T], -) -> Callable[[Observable[_T]], List[Observable[_T]]]: - """Returns two observables which partition the observations of the - source by the given function. The first will trigger observations - for those values for which the predicate returns true. The second - will trigger observations for those values where the predicate - returns false. The predicate is executed once for each subscribed - observer. Both also propagate all error observations arising from - the source and each completes when the source completes. - - .. marble:: - :alt: partition - - ---1--2--3--4--| - [ partition(even) ] - ---1-----3-----| - ------2-----4--| - - Args: - predicate: The function to determine which output Observable - will trigger a particular observation. - - Returns: - An operator function that takes an observable source and - returns a list of observables. The first triggers when the - predicate returns True, and the second triggers when the - predicate returns False. - """ - from ._partition import partition_ - - return partition_(predicate) - - -def partition_indexed( - predicate_indexed: PredicateIndexed[_T], -) -> Callable[[Observable[_T]], List[Observable[_T]]]: - """The indexed partition operator. - - Returns two observables which partition the observations of the - source by the given function. The first will trigger observations - for those values for which the predicate returns true. The second - will trigger observations for those values where the predicate - returns false. The predicate is executed once for each subscribed - observer. Both also propagate all error observations arising from - the source and each completes when the source completes. - - .. marble:: - :alt: partition_indexed - - ---1--2--3--4--| - [ partition(even) ] - ---1-----3-----| - ------2-----4--| - - Args: - predicate: The function to determine which output Observable - will trigger a particular observation. - - Returns: - A list of observables. The first triggers when the predicate - returns True, and the second triggers when the predicate - returns False. - """ - from ._partition import partition_indexed_ - - return partition_indexed_(predicate_indexed) - - -def pluck( - key: _TKey, -) -> Callable[[Observable[Dict[_TKey, _TValue]]], Observable[_TValue]]: - """Retrieves the value of a specified key using dict-like access (as in - element[key]) from all elements in the Observable sequence. - - To pluck an attribute of each element, use pluck_attr. - - Args: - key: The key to pluck. - - Returns: - An operator function that takes an observable source and - returns a new observable sequence of key values. - """ - from ._pluck import pluck_ - - return pluck_(key) - - -def pluck_attr(prop: str) -> Callable[[Observable[Any]], Observable[Any]]: - """Retrieves the value of a specified property (using getattr) from - all elements in the Observable sequence. - - To pluck values using dict-like access (as in element[key]) on each - element, use pluck. - - Args: - property: The property to pluck. - - Returns: - An operator function that takes an observable source and - returns a new observable sequence of property values. - """ - from ._pluck import pluck_attr_ - - return pluck_attr_(prop) - - -@overload -def publish() -> Callable[[Observable[_T1]], ConnectableObservable[_T1]]: ... - - -@overload -def publish( - mapper: Mapper[Observable[_T1], Observable[_T2]], -) -> Callable[[Observable[_T1]], Observable[_T2]]: ... - - -def publish( - mapper: Optional[Mapper[Observable[_T1], Observable[_T2]]] = None, -) -> Callable[[Observable[_T1]], Union[Observable[_T2], ConnectableObservable[_T1]]]: - """The `publish` operator. - - Returns an observable sequence that is the result of invoking the - mapper on a connectable observable sequence that shares a single - subscription to the underlying sequence. This operator is a - specialization of Multicast using a regular Subject. - - Example: - >>> res = publish() - >>> res = publish(lambda x: x) - - Args: - mapper: [Optional] Selector function which can use the - multicasted source sequence as many times as needed, - without causing multiple subscriptions to the source - sequence. Subscribers to the given source will receive all - notifications of the source from the time of the - subscription on. - - Returns: - An operator function that takes an observable source and - returns an observable sequence that contains the elements of a - sequence produced by multicasting the source sequence within a - mapper function. - """ - from ._publish import publish_ - - return publish_(mapper) - - -@overload -def publish_value( - initial_value: _T1, -) -> Callable[[Observable[_T1]], ConnectableObservable[_T1]]: ... - - -@overload -def publish_value( - initial_value: _T1, - mapper: Mapper[Observable[_T1], Observable[_T2]], -) -> Callable[[Observable[_T1]], Observable[_T2]]: ... - - -def publish_value( - initial_value: _T1, - mapper: Optional[Mapper[Observable[_T1], Observable[_T2]]] = None, -) -> Union[ - Callable[[Observable[_T1]], ConnectableObservable[_T1]], - Callable[[Observable[_T1]], Observable[_T2]], -]: - """Returns an observable sequence that is the result of invoking - the mapper on a connectable observable sequence that shares a - single subscription to the underlying sequence and starts with - initial_value. - - This operator is a specialization of Multicast using a - BehaviorSubject. - - Examples: - >>> res = source.publish_value(42) - >>> res = source.publish_value(42, lambda x: x.map(lambda y: y * y)) - - Args: - initial_value: Initial value received by observers upon - subscription. - mapper: [Optional] Optional mapper function which can use the - multicasted source sequence as many times as needed, - without causing multiple subscriptions to the source - sequence. Subscribers to the given source will receive - immediately receive the initial value, followed by all - notifications of the source from the time of the - subscription on. - - Returns: - An operator function that takes an observable source and returns - an observable sequence that contains the elements of a - sequence produced by multicasting the source sequence within a - mapper function. - """ - from ._publishvalue import publish_value_ - - return publish_value_(initial_value, mapper) - - -@overload -def reduce( - accumulator: Accumulator[_TState, _T], -) -> Callable[[Observable[_T]], Observable[_T]]: ... - - -@overload -def reduce( - accumulator: Accumulator[_TState, _T], seed: _TState -) -> Callable[[Observable[_T]], Observable[_TState]]: ... - - -def reduce( - accumulator: Accumulator[_TState, _T], seed: Union[_TState, Type[NotSet]] = NotSet -) -> Callable[[Observable[_T]], Observable[Any]]: - """The reduce operator. - - Applies an accumulator function over an observable sequence, - returning the result of the aggregation as a single element in the - result sequence. The specified seed value is used as the initial - accumulator value. - - For aggregation behavior with incremental intermediate results, - see `scan`. - - .. marble:: - :alt: reduce - - ---1--2--3--4--| - [reduce(acc,i: acc+i)] - ---------------10-| - - Examples: - >>> res = reduce(lambda acc, x: acc + x) - >>> res = reduce(lambda acc, x: acc + x, 0) - - Args: - accumulator: An accumulator function to be invoked on each - element. - seed: Optional initial accumulator value. - - Returns: - A partially applied operator function that takes an observable - source and returns an observable sequence containing a single - element with the final accumulator value. - """ - from ._reduce import reduce_ - - return reduce_(accumulator, seed) - - -def ref_count() -> Callable[[ConnectableObservable[_T]], Observable[_T]]: - """Returns an observable sequence that stays connected to the - source as long as there is at least one subscription to the - observable sequence. - """ - from .connectable._refcount import ref_count_ - - return ref_count_() - - -def repeat( - repeat_count: Optional[int] = None, -) -> Callable[[Observable[_T]], Observable[_T]]: - """Repeats the observable sequence a specified number of times. - If the repeat count is not specified, the sequence repeats - indefinitely. - - .. marble:: - :alt: repeat - - -1--2-| - [ repeat(3) ] - -1--2--1--2--1--2-| - - - Examples: - >>> repeated = repeat() - >>> repeated = repeat(42) - Args: - repeat_count: Number of times to repeat the sequence. If not - provided, repeats the sequence indefinitely. - - Returns: - An operator function that takes an observable sources and - returns an observable sequence producing the elements of the - given sequence repeatedly. - """ - from ._repeat import repeat_ - - return repeat_(repeat_count) - - -@overload -def replay( - buffer_size: Optional[int] = None, - window: Optional[typing.RelativeTime] = None, - *, - scheduler: Optional[abc.SchedulerBase] = None, -) -> Callable[[Observable[_T1]], ConnectableObservable[_T1]]: ... - - -@overload -def replay( - buffer_size: Optional[int] = None, - window: Optional[typing.RelativeTime] = None, - *, - mapper: Optional[Mapper[Observable[_T1], Observable[_T2]]], - scheduler: Optional[abc.SchedulerBase] = None, -) -> Callable[[Observable[_T1]], Observable[_T2]]: ... - - -def replay( - buffer_size: Optional[int] = None, - window: Optional[typing.RelativeTime] = None, - *, - mapper: Optional[Mapper[Observable[_T1], Observable[_T2]]] = None, - scheduler: Optional[abc.SchedulerBase] = None, -) -> Callable[[Observable[_T1]], Union[Observable[_T2], ConnectableObservable[_T1]]]: - """The `replay` operator. - - Returns an observable sequence that is the result of invoking the - mapper on a connectable observable sequence that shares a single - subscription to the underlying sequence replaying notifications - subject to a maximum time length for the replay buffer. - - This operator is a specialization of Multicast using a - ReplaySubject. - - Examples: - >>> res = replay(buffer_size=3) - >>> res = replay(buffer_size=3, window=0.5) - >>> res = replay(None, 3, 0.5) - >>> res = replay(lambda x: x.take(6).repeat(), 3, 0.5) - - Args: - mapper: [Optional] Selector function which can use the - multicasted source sequence as many times as needed, - without causing multiple subscriptions to the source - sequence. Subscribers to the given source will receive all - the notifications of the source subject to the specified - replay buffer trimming policy. - buffer_size: [Optional] Maximum element count of the replay - buffer. - window: [Optional] Maximum time length of the replay buffer. - scheduler: [Optional] Scheduler the observers are invoked on. - - Returns: - An operator function that takes an observable source and - returns an observable sequence that contains the elements of a - sequence produced by multicasting the source sequence within a - mapper function. - """ - from ._replay import replay_ - - return replay_(mapper, buffer_size, window, scheduler=scheduler) - - -def retry( - retry_count: Optional[int] = None, -) -> Callable[[Observable[_T]], Observable[_T]]: - """Repeats the source observable sequence the specified number of - times or until it successfully terminates. If the retry count is - not specified, it retries indefinitely. - - Examples: - >>> retried = retry() - >>> retried = retry(42) - - Args: - retry_count: [Optional] Number of times to retry the sequence. - If not provided, retry the sequence indefinitely. - - Returns: - An observable sequence producing the elements of the given - sequence repeatedly until it terminates successfully. - """ - from ._retry import retry_ - - return retry_(retry_count) - - -def sample( - sampler: Union[typing.RelativeTime, Observable[Any]], - scheduler: Optional[abc.SchedulerBase] = None, -) -> Callable[[Observable[_T]], Observable[_T]]: - """Samples the observable sequence at each interval. - - .. marble:: - :alt: sample - - ---1-2-3-4------| - [ sample(4) ] - ----1---3---4---| - - Examples: - >>> res = sample(sample_observable) # Sampler tick sequence - >>> res = sample(5.0) # 5 seconds - - Args: - sampler: Observable used to sample the source observable **or** time - interval at which to sample (specified as a float denoting - seconds or an instance of timedelta). - scheduler: Scheduler to use only when a time interval is given. - - Returns: - An operator function that takes an observable source and - returns a sampled observable sequence. - """ - from ._sample import sample_ - - return sample_(sampler, scheduler) - - -@overload -def scan( - accumulator: Accumulator[_T, _T], -) -> Callable[[Observable[_T]], Observable[_T]]: ... - - -@overload -def scan( - accumulator: Accumulator[_TState, _T], seed: Union[_TState, Type[NotSet]] -) -> Callable[[Observable[_T]], Observable[_TState]]: ... - - -def scan( - accumulator: Accumulator[_TState, _T], seed: Union[_TState, Type[NotSet]] = NotSet -) -> Callable[[Observable[_T]], Observable[_TState]]: - """The scan operator. - - Applies an accumulator function over an observable sequence and - returns each intermediate result. The optional seed value is used - as the initial accumulator value. For aggregation behavior with no - intermediate results, see `aggregate()` or `Observable()`. - - .. marble:: - :alt: scan - - ----1--2--3--4-----| - [scan(acc,i: acc+i)] - ----1--3--6--10----| - - Examples: - >>> scanned = source.scan(lambda acc, x: acc + x) - >>> scanned = source.scan(lambda acc, x: acc + x, 0) - - Args: - accumulator: An accumulator function to be invoked on each - element. - seed: [Optional] The initial accumulator value. - - Returns: - A partially applied operator function that takes an observable - source and returns an observable sequence containing the - accumulated values. - """ - from ._scan import scan_ - - return scan_(accumulator, seed) - - -def sequence_equal( - second: Union[Observable[_T], Iterable[_T]], comparer: Optional[Comparer[_T]] = None -) -> Callable[[Observable[_T]], Observable[bool]]: - """Determines whether two sequences are equal by comparing the - elements pairwise using a specified equality comparer. - - .. marble:: - :alt: scan - - -1--2--3--4----| - ----1--2--3--4-| - [ sequence_equal() ] - ---------------True| - - Examples: - >>> res = sequence_equal([1,2,3]) - >>> res = sequence_equal([{ "value": 42 }], lambda x, y: x.value == y.value) - >>> res = sequence_equal(reactivex.return_value(42)) - >>> res = sequence_equal( - reactivex.return_value({ "value": 42 }), lambda x, y: x.value == y.value) - - Args: - second: Second observable sequence or iterable to compare. - comparer: [Optional] Comparer used to compare elements of both - sequences. No guarantees on order of comparer arguments. - - Returns: - An operator function that takes an observable source and - returns an observable sequence that contains a single element - which indicates whether both sequences are of equal length and - their corresponding elements are equal according to the - specified equality comparer. - """ - from ._sequenceequal import sequence_equal_ - - return sequence_equal_(second, comparer) - - -def share() -> Callable[[Observable[_T]], Observable[_T]]: - """Share a single subscription among multiple observers. - - This is an alias for a composed publish() and ref_count(). - - Returns: - An operator function that takes an observable source and - returns a new Observable that multicasts (shares) the original - Observable. As long as there is at least one Subscriber this - Observable will be subscribed and emitting data. When all - subscribers have unsubscribed it will unsubscribe from the - source - Observable. - """ - from ._publish import share_ - - return share_() - - -def single( - predicate: Optional[Predicate[_T]] = None, -) -> Callable[[Observable[_T]], Observable[_T]]: - """The single operator. - - Returns the only element of an observable sequence that satisfies - the condition in the optional predicate, and reports an exception - if there is not exactly one element in the observable sequence. - - .. marble:: - :alt: single - - ----1--2--3--4-----| - [ single(3) ] - ----------3--------| - - Example: - >>> res = single() - >>> res = single(lambda x: x == 42) - - Args: - predicate: [Optional] A predicate function to evaluate for - elements in the source sequence. - - Returns: - An operator function that takes an observable source and - returns an observable sequence containing the single element in - the observable sequence that satisfies the condition in the - predicate. - """ - from ._single import single_ - - return single_(predicate) - - -def single_or_default( - predicate: Optional[Predicate[_T]] = None, default_value: Any = None -) -> Callable[[Observable[_T]], Observable[_T]]: - """Returns the only element of an observable sequence that matches - the predicate, or a default value if no such element exists this - method reports an exception if there is more than one element in - the observable sequence. - - .. marble:: - :alt: single_or_default - - ----1--2--3--4--| - [ single(8,42) ] - ----------------42-| - - Examples: - >>> res = single_or_default() - >>> res = single_or_default(lambda x: x == 42) - >>> res = single_or_default(lambda x: x == 42, 0) - >>> res = single_or_default(None, 0) - - Args: - predicate: [Optional] A predicate function to evaluate for - elements in the source sequence. - default_value: [Optional] The default value if the index is - outside the bounds of the source sequence. - - Returns: - An operator function that takes an observable source and - returns an observable sequence containing the single element in - the observable sequence that satisfies the condition in the - predicate, or a default value if no such element exists. - """ - from ._singleordefault import single_or_default_ - - return single_or_default_(predicate, default_value) - - -def single_or_default_async( - has_default: bool = False, default_value: _T = None -) -> Callable[[Observable[_T]], Observable[_T]]: - from ._singleordefault import single_or_default_async_ - - return single_or_default_async_(has_default, default_value) - - -def skip(count: int) -> Callable[[Observable[_T]], Observable[_T]]: - """The skip operator. - - Bypasses a specified number of elements in an observable sequence - and then returns the remaining elements. - - .. marble:: - :alt: skip - - ----1--2--3--4-----| - [ skip(2) ] - ----------3--4-----| - - - Args: - count: The number of elements to skip before returning the - remaining elements. - - Returns: - An operator function that takes an observable source and - returns an observable sequence that contains the elements that - occur after the specified index in the input sequence. - """ - from ._skip import skip_ - - return skip_(count) - - -def skip_last(count: int) -> Callable[[Observable[_T]], Observable[_T]]: - """The skip_last operator. - - .. marble:: - :alt: skip_last - - ----1--2--3--4-----| - [ skip_last(1) ] - -------1--2--3-----| - - - Bypasses a specified number of elements at the end of an observable - sequence. - - This operator accumulates a queue with a length enough to store the - first `count` elements. As more elements are received, elements are - taken from the front of the queue and produced on the result - sequence. This causes elements to be delayed. - - Args: - count: Number of elements to bypass at the end of the source - sequence. - - Returns: - An operator function that takes an observable source and - returns an observable sequence containing the source sequence - elements except for the bypassed ones at the end. - """ - from ._skiplast import skip_last_ - - return skip_last_(count) - - -def skip_last_with_time( - duration: typing.RelativeTime, scheduler: Optional[abc.SchedulerBase] = None -) -> Callable[[Observable[_T]], Observable[_T]]: - """Skips elements for the specified duration from the end of the - observable source sequence. - - Example: - >>> res = skip_last_with_time(5.0) - - This operator accumulates a queue with a length enough to store - elements received during the initial duration window. As more - elements are received, elements older than the specified duration - are taken from the queue and produced on the result sequence. This - causes elements to be delayed with duration. - - Args: - duration: Duration for skipping elements from the end of the - sequence. - scheduler: Scheduler to use for time handling. - - Returns: - An observable sequence with the elements skipped during the - specified duration from the end of the source sequence. - """ - from ._skiplastwithtime import skip_last_with_time_ - - return skip_last_with_time_(duration, scheduler=scheduler) - - -def skip_until( - other: Union[Observable[Any], "Future[Any]"], -) -> Callable[[Observable[_T]], Observable[_T]]: - """Returns the values from the source observable sequence only - after the other observable sequence produces a value. - - .. marble:: - :alt: skip_until - - ----1--2--3--4-----| - ---------1---------| - [ skip_until() ] - ----------3--4-----| - - Args: - other: The observable sequence that triggers propagation of - elements of the source sequence. - - Returns: - An operator function that takes an observable source and - returns an observable sequence containing the elements of the - source sequence starting from the point the other sequence - triggered propagation. - """ - from ._skipuntil import skip_until_ - - return skip_until_(other) - - -def skip_until_with_time( - start_time: typing.AbsoluteOrRelativeTime, - scheduler: Optional[abc.SchedulerBase] = None, -) -> Callable[[Observable[_T]], Observable[_T]]: - """Skips elements from the observable source sequence until the - specified start time. - Errors produced by the source sequence are always forwarded to the - result sequence, even if the error occurs before the start time. - - .. marble:: - :alt: skip_until - - ------1--2--3--4-------| - [skip_until_with_time()] - ------------3--4-------| - - Examples: - >>> res = skip_until_with_time(datetime()) - >>> res = skip_until_with_time(5.0) - - Args: - start_time: Time to start taking elements from the source - sequence. If this value is less than or equal to - `datetime.now(timezone.utc)`, no elements will be skipped. - - Returns: - An operator function that takes an observable source and - returns an observable sequence with the elements skipped - until the specified start time. - """ - from ._skipuntilwithtime import skip_until_with_time_ - - return skip_until_with_time_(start_time, scheduler=scheduler) - - -def skip_while( - predicate: typing.Predicate[_T], -) -> Callable[[Observable[_T]], Observable[_T]]: - """The `skip_while` operator. - - Bypasses elements in an observable sequence as long as a specified - condition is true and then returns the remaining elements. The - element's index is used in the logic of the predicate function. - - .. marble:: - :alt: skip_while - - ----1--2--3--4-----| - [skip_while(i: i<3)] - ----------3--4-----| - - Example: - >>> skip_while(lambda value: value < 10) - - Args: - predicate: A function to test each element for a condition; the - second parameter of the function represents the index of - the source element. - - Returns: - An operator function that takes an observable source and - returns an observable sequence that contains the elements from - the input sequence starting at the first element in the linear - series that does not pass the test specified by predicate. - """ - from ._skipwhile import skip_while_ - - return skip_while_(predicate) - - -def skip_while_indexed( - predicate: typing.PredicateIndexed[_T], -) -> Callable[[Observable[_T]], Observable[_T]]: - """Bypasses elements in an observable sequence as long as a - specified condition is true and then returns the remaining - elements. The element's index is used in the logic of the predicate - function. - - .. marble:: - :alt: skip_while_indexed - - ----1--2--3--4-----| - [skip_while(i: i<3)] - ----------3--4-----| - - Example: - >>> skip_while(lambda value, index: value < 10 or index < 10) - - Args: - predicate: A function to test each element for a condition; the - second parameter of the function represents the index of - the source element. - - Returns: - An operator function that takes an observable source and - returns an observable sequence that contains the elements from - the input sequence starting at the first element in the linear - series that does not pass the test specified by predicate. - """ - from ._skipwhile import skip_while_indexed_ - - return skip_while_indexed_(predicate) - - -def skip_with_time( - duration: typing.RelativeTime, scheduler: Optional[abc.SchedulerBase] = None -) -> Callable[[Observable[_T]], Observable[_T]]: - """Skips elements for the specified duration from the start of the - observable source sequence. - - .. marble:: - :alt: skip_with_time - - ----1--2--3--4-----| - [ skip_with_time() ] - ----------3--4-----| - - Args: - >>> res = skip_with_time(5.0) - - Specifying a zero value for duration doesn't guarantee no elements - will be dropped from the start of the source sequence. This is a - side-effect of the asynchrony introduced by the scheduler, where - the action that causes callbacks from the source sequence to be - forwarded may not execute immediately, despite the zero due time. - - Errors produced by the source sequence are always forwarded to the - result sequence, even if the error occurs before the duration. - - Args: - duration: Duration for skipping elements from the start of the - sequence. - - Returns: - An operator function that takes an observable source and - returns an observable sequence with the elements skipped during - the specified duration from the start of the source sequence. - """ - from ._skipwithtime import skip_with_time_ - - return skip_with_time_(duration, scheduler=scheduler) - - -def slice( - start: Optional[int] = None, stop: Optional[int] = None, step: Optional[int] = None -) -> Callable[[Observable[_T]], Observable[_T]]: - """The slice operator. - - Slices the given observable. It is basically a wrapper around the operators - :func:`skip `, - :func:`skip_last `, - :func:`take `, - :func:`take_last ` and - :func:`filter `. - - .. marble:: - :alt: slice - - ----1--2--3--4-----| - [ slice(1, 2) ] - -------2--3--------| - - Examples: - >>> result = source.slice(1, 10) - >>> result = source.slice(1, -2) - >>> result = source.slice(1, -1, 2) - - Args: - start: First element to take of skip last - stop: Last element to take of skip last - step: Takes every step element. Must be larger than zero - - Returns: - An operator function that takes an observable source and - returns a sliced observable sequence. - """ - from ._slice import slice_ - - return slice_(start, stop, step) - - -def some( - predicate: Optional[Predicate[_T]] = None, -) -> Callable[[Observable[_T]], Observable[bool]]: - """The some operator. - - Determines whether some element of an observable sequence - satisfies a condition if present, else if some items are in the - sequence. - - .. marble:: - :alt: some - - ----1--2--3--4-----| - [ some(i: i>3) ] - -------------True--| - - Examples: - >>> result = source.some() - >>> result = source.some(lambda x: x > 3) - - Args: - predicate: A function to test each element for a condition. - - Returns: - An operator function that takes an observable source and - returns an observable sequence containing a single element - determining whether some elements in the source sequence - pass the test in the specified predicate if given, else if some - items are in the sequence. - """ - from ._some import some_ - - return some_(predicate) - - -@overload -def starmap( - mapper: Callable[[_A, _B], _T], -) -> Callable[[Observable[Tuple[_A, _B]]], Observable[_T]]: ... - - -@overload -def starmap( - mapper: Callable[[_A, _B, _C], _T], -) -> Callable[[Observable[Tuple[_A, _B, _C]]], Observable[_T]]: ... - - -@overload -def starmap( - mapper: Callable[[_A, _B, _C, _D], _T], -) -> Callable[[Observable[Tuple[_A, _B, _C, _D]]], Observable[_T]]: ... - - -def starmap( - mapper: Optional[Callable[..., Any]] = None, -) -> Callable[[Observable[Any]], Observable[Any]]: - """The starmap operator. - - Unpack arguments grouped as tuple elements of an observable - sequence and return an observable sequence of values by invoking - the mapper function with star applied unpacked elements as - positional arguments. - - Use instead of `map()` when the the arguments to the mapper is - grouped as tuples and the mapper function takes multiple arguments. - - .. marble:: - :alt: starmap - - -----1,2---3,4-----| - [ starmap(add) ] - -----3-----7-------| - - Example: - >>> starmap(lambda x, y: x + y) - - Args: - mapper: A transform function to invoke with unpacked elements - as arguments. - - Returns: - An operator function that takes an observable source and - returns an observable sequence containing the results of - invoking the mapper function with unpacked elements of the - source. - """ - - if mapper is None: - return compose(identity) - - def starred(values: Tuple[Any, ...]) -> Any: - assert mapper # mypy is paranoid - return mapper(*values) - - return compose(map(starred)) - - -@overload -def starmap_indexed( - mapper: Callable[[_A, int], _T], -) -> Callable[[Observable[_A]], Observable[_T]]: ... - - -@overload -def starmap_indexed( - mapper: Callable[[_A, _B, int], _T], -) -> Callable[[Observable[Tuple[_A, _B]]], Observable[_T]]: ... - - -@overload -def starmap_indexed( - mapper: Callable[[_A, _B, _C, int], _T], -) -> Callable[[Observable[Tuple[_A, _B, _C]]], Observable[_T]]: ... - - -@overload -def starmap_indexed( - mapper: Callable[[_A, _B, _C, _D, int], _T], -) -> Callable[[Observable[Tuple[_A, _B, _C, _D]]], Observable[_T]]: ... - - -def starmap_indexed( - mapper: Optional[Callable[..., Any]] = None, -) -> Callable[[Observable[Any]], Observable[Any]]: - """Variant of :func:`starmap` which accepts an indexed mapper. - - .. marble:: - :alt: starmap_indexed - - ---------1,2---3,4---------| - [ starmap_indexed(sum) ] - ---------3-----8-----------| - - Example: - >>> starmap_indexed(lambda x, y, i: x + y + i) - - Args: - mapper: A transform function to invoke with unpacked elements - as arguments. - - Returns: - An operator function that takes an observable source and - returns an observable sequence containing the results of - invoking the indexed mapper function with unpacked elements - of the source. - """ - from ._map import map_ - - if mapper is None: - return compose(identity) - - def starred(values: Tuple[Any, ...]) -> Any: - assert mapper # mypy is paranoid - return mapper(*values) - - return compose(map_(starred)) - - -def start_with(*args: _T) -> Callable[[Observable[_T]], Observable[_T]]: - """Prepends a sequence of values to an observable sequence. - - .. marble:: - :alt: start_with - - -----1--2--3--4----| - [ start_with(7,8) ] - -7-8-1--2--3--4----| - - Example: - >>> start_with(1, 2, 3) - - Returns: - An operator function that takes a source observable and returns - the source sequence prepended with the specified values. - """ - from ._startswith import start_with_ - - return start_with_(*args) - - -def subscribe_on( - scheduler: abc.SchedulerBase, -) -> Callable[[Observable[_T]], Observable[_T]]: - """Subscribe on the specified scheduler. - - Wrap the source sequence in order to run its subscription and - unsubscription logic on the specified scheduler. This operation is - not commonly used; see the remarks section for more information on - the distinction between subscribe_on and observe_on. - - This only performs the side-effects of subscription and - unsubscription on the specified scheduler. In order to invoke - observer callbacks on a scheduler, use observe_on. - - Args: - scheduler: Scheduler to perform subscription and unsubscription - actions on. - - Returns: - An operator function that takes an observable source and - returns the source sequence whose subscriptions and - un-subscriptions happen on the specified scheduler. - """ - from ._subscribeon import subscribe_on_ - - return subscribe_on_(scheduler) - - -@overload -def sum() -> Callable[[Observable[float]], Observable[float]]: ... - - -@overload -def sum( - key_mapper: Mapper[_T, float], -) -> Callable[[Observable[_T]], Observable[float]]: ... - - -def sum( - key_mapper: Optional[Mapper[Any, float]] = None, -) -> Callable[[Observable[Any]], Observable[float]]: - """Computes the sum of a sequence of values that are obtained by - invoking an optional transform function on each element of the - input sequence, else if not specified computes the sum on each item - in the sequence. - - .. marble:: - :alt: sum - - -----1--2--3--4-| - [ sum() ] - ----------------10-| - - Examples: - >>> res = sum() - >>> res = sum(lambda x: x.value) - - Args: - key_mapper: [Optional] A transform function to apply to each - element. - - Returns: - An operator function that takes a source observable and returns - an observable sequence containing a single element with the sum - of the values in the source sequence. - """ - from ._sum import sum_ - - return sum_(key_mapper) - - -def switch_latest() -> ( - Callable[[Observable[Union[Observable[_T], "Future[_T]"]]], Observable[_T]] -): - """The switch_latest operator. - - Transforms an observable sequence of observable sequences into an - observable sequence producing values only from the most recent - observable sequence. - - .. marble:: - :alt: switch_latest - - -+------+----------| - +--a--b--c-| - +--1--2--3--4--| - [ switch_latest() ] - ----1--2---a--b--c-| - - Returns: - A partially applied operator function that takes an observable - source and returns the observable sequence that at any point in - time produces the elements of the most recent inner observable - sequence that has been received. - """ - from ._switchlatest import switch_latest_ - - return switch_latest_() - - -def switch_map( - project: Optional[Mapper[_T1, Observable[_T2]]] = None, -) -> Callable[[Observable[_T1]], Observable[_T2]]: - """Projects each source value to an Observable which is merged in - the output Observable, emitting values only from the most recently - projected Observable. - - - .. marble:: - :alt: switch_map - - ---a----------b-------c---------| - [ switch_map(x: x---x---x|) ] - ---a---a---a--b---b---c---c---c-| - - Examples: - >>> op = switch_map(lambda x: reactivex.timer(1.0).pipe(map(lambda x: x))) - >>> op = switch_map() - - Args: - project: Projecting function which takes the outer observable value - and the emission index and emits the inner observable; defaults to `identity` - - Returns: - An operator function that maps each value to the inner observable - and emits its values in order, emitting values only from the - most recently projected Observable. - - - If an inner observable complete, the resulting sequence does *not* - complete. - If an inner observable errors, the resulting sequence errors as well. - If the outer observable completes/errors, the resulting sequence - completes/errors. - - """ - - return compose(map(project), switch_latest()) - - -def switch_map_indexed( - project: Optional[MapperIndexed[_T1, Observable[_T2]]] = None, -) -> Callable[[Observable[_T1]], Observable[_T2]]: - """Projects each source value to an Observable which is merged in - the output Observable, emitting values only from the most recently - projected Observable. - - - .. marble:: - :alt: switch_map - - ---a----------b-------c---------------------| - [ switch_map_indexed(x,i: x*i---x*i---x*i|) ] - ---a---a---a--bb---bb-ccc---ccc---ccc-------| - - Examples: - >>> op = switch_map_indexed(lambda x, i: reactivex.timer(1.0).pipe(map(x*i))) - - Args: - project: Projecting function which takes the outer observable value - and the emission index and emits the inner observable - - Returns: - An operator function that maps each value to the inner observable - and emits its values in order, emitting values only from the - most recently projected Observable. - - - If an inner observable complete, the resulting sequence does *not* - complete. - If an inner observable errors, the resulting sequence errors as well. - If the outer observable completes/errors, the resulting sequence - completes/errors. - - """ - - return compose(map_indexed(project), switch_latest()) - - -def take(count: int) -> Callable[[Observable[_T]], Observable[_T]]: - """Returns a specified number of contiguous elements from the start - of an observable sequence. - - .. marble:: - :alt: take - - -----1--2--3--4----| - [ take(2) ] - -----1--2-| - - Example: - >>> op = take(5) - - Args: - count: The number of elements to return. - - Returns: - An operator function that takes an observable source and - returns an observable sequence that contains the specified - number of elements from the start of the input sequence. - """ - from ._take import take_ - - return take_(count) - - -def take_last(count: int) -> Callable[[Observable[_T]], Observable[_T]]: - """Returns a specified number of contiguous elements from the end - of an observable sequence. - - .. marble:: - :alt: take_last - - -1--2--3--4-| - [ take_last(2) ] - ------------3--4-| - - Example: - >>> res = take_last(5) - - This operator accumulates a buffer with a length enough to store - elements count elements. Upon completion of the source sequence, - this buffer is drained on the result sequence. This causes the - elements to be delayed. - - Args: - count: Number of elements to take from the end of the source - sequence. - - Returns: - An operator function that takes an observable source and - returns an observable sequence containing the specified number - of elements from the end of the source sequence. - """ - from ._takelast import take_last_ - - return take_last_(count) - - -def take_last_buffer(count: int) -> Callable[[Observable[_T]], Observable[List[_T]]]: - """The `take_last_buffer` operator. - - Returns an array with the specified number of contiguous elements - from the end of an observable sequence. - - .. marble:: - :alt: take_last_buffer - - -----1--2--3--4-| - [take_last_buffer(2)] - ----------------3,4-| - - Example: - >>> res = source.take_last(5) - - This operator accumulates a buffer with a length enough to store - elements count elements. Upon completion of the source sequence, - this buffer is drained on the result sequence. This causes the - elements to be delayed. - - Args: - count: Number of elements to take from the end of the source - sequence. - - Returns: - An operator function that takes an observable source and - returns an observable sequence containing a single list with - the specified number of elements from the end of the source - sequence. - """ - from ._takelastbuffer import take_last_buffer_ - - return take_last_buffer_(count) - - -def take_last_with_time( - duration: typing.RelativeTime, scheduler: Optional[abc.SchedulerBase] = None -) -> Callable[[Observable[_T]], Observable[_T]]: - """Returns elements within the specified duration from the end of - the observable source sequence. - - .. marble:: - :alt: take_last_with_time - - -----1--2--3--4-| - [take_last_with_time(3)] - ----------------4-| - - Example: - >>> res = take_last_with_time(5.0) - - This operator accumulates a queue with a length enough to store - elements received during the initial duration window. As more - elements are received, elements older than the specified duration - are taken from the queue and produced on the result sequence. This - causes elements to be delayed with duration. - - Args: - duration: Duration for taking elements from the end of the - sequence. - - Returns: - An operator function that takes an observable source and - returns an observable sequence with the elements taken - during the specified duration from the end of the source - sequence. - """ - from ._takelastwithtime import take_last_with_time_ - - return take_last_with_time_(duration, scheduler=scheduler) - - -def take_until(other: Observable[Any]) -> Callable[[Observable[_T]], Observable[_T]]: - """Returns the values from the source observable sequence until the - other observable sequence produces a value. - - .. marble:: - :alt: take_until - - -----1--2--3--4----| - -------------a-| - [ take_until(2) ] - -----1--2--3-------| - - Args: - other: Observable sequence that terminates propagation of - elements of the source sequence. - - Returns: - An operator function that takes an observable source and - returns as observable sequence containing the elements of the - source sequence up to the point the other sequence interrupted - further propagation. - """ - from ._takeuntil import take_until_ - - return take_until_(other) - - -def take_until_with_time( - end_time: typing.AbsoluteOrRelativeTime, - scheduler: Optional[abc.SchedulerBase] = None, -) -> Callable[[Observable[_T]], Observable[_T]]: - """Takes elements for the specified duration until the specified - end time, using the specified scheduler to run timers. - - .. marble:: - :alt: take_until_with_time - - -----1--2--3--4--------| - [take_until_with_time()] - -----1--2--3-----------| - - Examples: - >>> res = take_until_with_time(dt, [optional scheduler]) - >>> res = take_until_with_time(5.0, [optional scheduler]) - - Args: - end_time: Time to stop taking elements from the source - sequence. If this value is less than or equal to - `datetime.now(timezone.utc)`, the result stream will complete - immediately. - scheduler: Scheduler to run the timer on. - - Returns: - An operator function that takes an observable source and - returns an observable sequence with the elements taken until - the specified end time. - """ - from ._takeuntilwithtime import take_until_with_time_ - - return take_until_with_time_(end_time, scheduler=scheduler) - - -def take_while( - predicate: Predicate[_T], inclusive: bool = False -) -> Callable[[Observable[_T]], Observable[_T]]: - """Returns elements from an observable sequence as long as a - specified condition is true. - - .. marble:: - :alt: take_while - - -----1--2--3--4----| - [take_while(i: i<3)] - -----1--2----------| - - Example: - >>> take_while(lambda value: value < 10) - - Args: - predicate: A function to test each element for a condition. - inclusive: [Optional] When set to True the value that caused - the predicate function to return False will also be emitted. - If not specified, defaults to False. - - Returns: - An operator function that takes an observable source and - returns an observable sequence that contains the elements from - the input sequence that occur before the element at which the - test no longer passes. - """ - from ._takewhile import take_while_ - - return take_while_(predicate, inclusive) - - -def take_while_indexed( - predicate: PredicateIndexed[_T], inclusive: bool = False -) -> Callable[[Observable[_T]], Observable[_T]]: - """Returns elements from an observable sequence as long as a - specified condition is true. The element's index is used in the - logic of the predicate function. - - .. marble:: - :alt: take_while_indexed - - --------1------2------3------4-------| - [take_while_indexed(v, i: v<4 or i<3)] - --------1------2---------------------| - - Example: - >>> take_while_indexed(lambda value, index: value < 10 or index < 10) - - Args: - predicate: A function to test each element for a condition; the - second parameter of the function represents the index of the - source element. - inclusive: [Optional] When set to True the value that caused - the predicate function to return False will also be emitted. - If not specified, defaults to False. - - Returns: - An observable sequence that contains the elements from the - input sequence that occur before the element at which the test no - longer passes. - """ - from ._takewhile import take_while_indexed_ - - return take_while_indexed_(predicate, inclusive) - - -def take_with_time( - duration: typing.RelativeTime, scheduler: Optional[abc.SchedulerBase] = None -) -> Callable[[Observable[_T]], Observable[_T]]: - """Takes elements for the specified duration from the start of the - observable source sequence. - - .. marble:: - :alt: take_with_time - - -----1--2--3--4----| - [ take_with_time() ] - -----1--2----------| - - Example: - >>> res = take_with_time(5.0) - - This operator accumulates a queue with a length enough to store - elements received during the initial duration window. As more - elements are received, elements older than the specified duration - are taken from the queue and produced on the result sequence. This - causes elements to be delayed with duration. - - Args: - duration: Duration for taking elements from the start of the - sequence. - - Returns: - An operator function that takes an observable source and - returns an observable sequence with the elements taken during - the specified duration from the start of the source sequence. - """ - from ._takewithtime import take_with_time_ - - return take_with_time_(duration, scheduler=scheduler) - - -def throttle_first( - window_duration: typing.RelativeTime, scheduler: Optional[abc.SchedulerBase] = None -) -> Callable[[Observable[_T]], Observable[_T]]: - """Returns an Observable that emits only the first item emitted by - the source Observable during sequential time windows of a specified - duration. - - Args: - window_duration: time to wait before emitting another item - after emitting the last item. - - Returns: - An operator function that takes an observable source and - returns an observable that performs the throttle operation. - """ - from ._throttlefirst import throttle_first_ - - return throttle_first_(window_duration, scheduler) - - -def throttle_with_mapper( - throttle_duration_mapper: Callable[[Any], Observable[Any]], -) -> Callable[[Observable[_T]], Observable[_T]]: - """The throttle_with_mapper operator. - - Ignores values from an observable sequence which are followed by - another value within a computed throttle duration. - - Example: - >>> op = throttle_with_mapper(lambda x: reactivex.timer(x+x)) - - Args: - throttle_duration_mapper: Mapper function to retrieve an - observable sequence indicating the throttle duration for each - given element. - - Returns: - A partially applied operator function that takes an observable - source and returns the throttled observable sequence. - """ - from ._debounce import throttle_with_mapper_ - - return throttle_with_mapper_(throttle_duration_mapper) - - -if TYPE_CHECKING: - from ._timestamp import Timestamp - - -def timestamp( - scheduler: Optional[abc.SchedulerBase] = None, -) -> Callable[[Observable[_T]], Observable["Timestamp[_T]"]]: - """The timestamp operator. - - Records the timestamp for each value in an observable sequence. - - Examples: - >>> timestamp() - - Produces objects with attributes `value` and `timestamp`, where - value is the original value. - - Returns: - A partially applied operator function that takes an observable - source and returns an observable sequence with timestamp - information on values. - """ - from ._timestamp import timestamp_ - - return timestamp_(scheduler=scheduler) - - -def timeout( - duetime: typing.AbsoluteOrRelativeTime, - other: Optional[Observable[_T]] = None, - scheduler: Optional[abc.SchedulerBase] = None, -) -> Callable[[Observable[_T]], Observable[_T]]: - """Returns the source observable sequence or the other observable - sequence if duetime elapses. - - .. marble:: - :alt: timeout - - -1--2--------3--4--| - o-6--7-| - [ timeout(3,o) ] - -1--2---6--7----------| - - Examples: - >>> res = timeout(5.0) - >>> res = timeout(datetime(), return_value(42)) - >>> res = timeout(5.0, return_value(42)) - - Args: - duetime: Absolute (specified as a datetime object) or relative time - (specified as a float denoting seconds or an instance of timedetla) - when a timeout occurs. - other: Sequence to return in case of a timeout. If not - specified, a timeout error throwing sequence will be used. - scheduler: - - Returns: - An operator function that takes and observable source and - returns the source sequence switching to the other sequence in - case of a timeout. - """ - from ._timeout import timeout_ - - return timeout_(duetime, other, scheduler) - - -def timeout_with_mapper( - first_timeout: Optional[Observable[Any]] = None, - timeout_duration_mapper: Optional[Callable[[_T], Observable[Any]]] = None, - other: Optional[Observable[_T]] = None, -) -> Callable[[Observable[_T]], Observable[_T]]: - """Returns the source observable sequence, switching to the other - observable sequence if a timeout is signaled. - - Examples: - >>> res = timeout_with_mapper(reactivex.timer(0.5)) - >>> res = timeout_with_mapper( - reactivex.timer(0.5), lambda x: reactivex.timer(0.2) - ) - >>> res = timeout_with_mapper( - reactivex.timer(0.5), - lambda x: reactivex.timer(0.2), - reactivex.return_value(42) - ) - - Args: - first_timeout: [Optional] Observable sequence that represents - the timeout for the first element. If not provided, this - defaults to reactivex.never(). - timeout_duration_mapper: [Optional] Selector to retrieve an - observable sequence that represents the timeout between the - current element and the next element. - other: [Optional] Sequence to return in case of a timeout. If - not provided, this is set to reactivex.throw(). - - Returns: - An operator function that takes an observable source and - returns the source sequence switching to the other sequence in - case of a timeout. - """ - from ._timeoutwithmapper import timeout_with_mapper_ - - return timeout_with_mapper_(first_timeout, timeout_duration_mapper, other) - - -if TYPE_CHECKING: - from ._timeinterval import TimeInterval - - -def time_interval( - scheduler: Optional[abc.SchedulerBase] = None, -) -> Callable[[Observable[_T]], Observable["TimeInterval[_T]"]]: - """Records the time interval between consecutive values in an - observable sequence. - - .. marble:: - :alt: time_interval - - --1--2-----3---4--| - [ time_interval() ] - -----2-----5---5---| - - Examples: - >>> res = time_interval() - - Return: - An operator function that takes an observable source and - returns an observable sequence with time interval information - on values. - """ - from ._timeinterval import time_interval_ - - return time_interval_(scheduler=scheduler) - - -def to_dict( - key_mapper: Mapper[_T, _TKey], element_mapper: Optional[Mapper[_T, _TValue]] = None -) -> Callable[[Observable[_T]], Observable[Dict[_TKey, _TValue]]]: - """Converts the observable sequence to a Map if it exists. - - Args: - key_mapper: A function which produces the key for the - dictionary. - element_mapper: [Optional] An optional function which produces - the element for the dictionary. If not present, defaults to - the value from the observable sequence. - - Returns: - An operator function that takes an observable source and - returns an observable sequence with a single value of a - dictionary containing the values from the observable sequence. - """ - from ._todict import to_dict_ - - return to_dict_(key_mapper, element_mapper) - - -def to_future( - future_ctor: Optional[Callable[[], "Future[_T]"]] = None, -) -> Callable[[Observable[_T]], "Future[_T]"]: - """Converts an existing observable sequence to a Future. - - Example: - op = to_future(asyncio.Future); - - Args: - future_ctor: [Optional] The constructor of the future. - - Returns: - An operator function that takes an observable source and returns - a future with the last value from the observable sequence. - """ - from ._tofuture import to_future_ - - return to_future_(future_ctor) - - -def to_iterable() -> Callable[[Observable[_T]], Observable[List[_T]]]: - """Creates an iterable from an observable sequence. - - There is also an alias called ``to_list``. - - Returns: - An operator function that takes an observable source and - returns an observable sequence containing a single element with - an iterable containing all the elements of the source sequence. - """ - from ._toiterable import to_iterable_ - - return to_iterable_() - - -to_list = to_iterable - - -def to_marbles( - timespan: typing.RelativeTime = 0.1, scheduler: Optional[abc.SchedulerBase] = None -) -> Callable[[Observable[Any]], Observable[str]]: - """Convert an observable sequence into a marble diagram string. - - Args: - timespan: [Optional] duration of each character in second. - If not specified, defaults to 0.1s. - scheduler: [Optional] The scheduler used to run the the input - sequence on. - - Returns: - Observable stream. - """ - from ._tomarbles import to_marbles - - return to_marbles(scheduler=scheduler, timespan=timespan) - - -def to_set() -> Callable[[Observable[_T]], Observable[Set[_T]]]: - """Converts the observable sequence to a set. - - Returns: - An operator function that takes an observable source and - returns an observable sequence with a single value of a set - containing the values from the observable sequence. - """ - from ._toset import to_set_ - - return to_set_() - - -def while_do( - condition: Predicate[Observable[_T]], -) -> Callable[[Observable[_T]], Observable[_T]]: - """Repeats source as long as condition holds emulating a while - loop. - - Args: - condition: The condition which determines if the source will be - repeated. - - Returns: - An operator function that takes an observable source and - returns an observable sequence which is repeated as long as the - condition holds. - """ - from ._whiledo import while_do_ - - return while_do_(condition) - - -def window( - boundaries: Observable[Any], -) -> Callable[[Observable[_T]], Observable[Observable[_T]]]: - """Projects each element of an observable sequence into zero or - more windows. - - .. marble:: - :alt: window - - ---a-----b-----c--------| - ----1--2--3--4--5--6--7-| - [ window(open) ] - +--+-----+-----+--------| - +5--6--7-| - +3--4-| - +1--2-| - +--| - - Examples: - >>> res = window(reactivex.interval(1.0)) - - Args: - boundaries: Observable sequence whose elements denote the - creation and completion of non-overlapping windows. - - Returns: - An operator function that takes an observable source and - returns an observable sequence of windows. - - """ - from ._window import window_ - - return window_(boundaries) - - -def window_when( - closing_mapper: Callable[[], Observable[Any]], -) -> Callable[[Observable[_T]], Observable[Observable[_T]]]: - """Projects each element of an observable sequence into zero or - more windows. - - .. marble:: - :alt: window - - ------c| - ------c| - ------c| - ----1--2--3--4--5-| - [ window(close) ] - +-----+-----+-----+| - +4--5-| - +2--3-| - +----1| - - Examples: - >>> res = window(lambda: reactivex.timer(0.5)) - - Args: - closing_mapper: A function invoked to define - the closing of each produced window. It defines the - boundaries of the produced windows (a window is started - when the previous one is closed, resulting in - non-overlapping windows). - - Returns: - An operator function that takes an observable source and - returns an observable sequence of windows. - """ - from ._window import window_when_ - - return window_when_(closing_mapper) - - -def window_toggle( - openings: Observable[Any], closing_mapper: Callable[[Any], Observable[Any]] -) -> Callable[[Observable[_T]], Observable[Observable[_T]]]: - """Projects each element of an observable sequence into zero or - more windows. - - .. marble:: - :alt: window - - ---a-----------b------------| - ---d--| - --------e-| - ----1--2--3--4--5--6--7--8--| - [ window(open, close) ] - ---+-----------+------------| - +5--6--7| - +1-| - - >>> res = window(reactivex.interval(0.5), lambda i: reactivex.timer(i)) - - Args: - openings: Observable sequence whose elements denote the - creation of windows. - closing_mapper: A function invoked to define the closing of each - produced window. Value from openings Observable that initiated - the associated window is provided as argument to the function. - - Returns: - An operator function that takes an observable source and - returns an observable sequence of windows. - """ - from ._window import window_toggle_ - - return window_toggle_(openings, closing_mapper) - - -def window_with_count( - count: int, skip: Optional[int] = None -) -> Callable[[Observable[_T]], Observable[Observable[_T]]]: - """Projects each element of an observable sequence into zero or more - windows which are produced based on element count information. - - .. marble:: - :alt: window_with_count - - ---1-2-3---4-5-6---> - [ window(3) ] - --+-------+--------> - +4-5-6-| - +1-2-3-| - - Examples: - >>> window_with_count(10) - >>> window_with_count(10, 1) - - Args: - count: Length of each window. - skip: [Optional] Number of elements to skip between creation of - consecutive windows. If not specified, defaults to the - count. - - Returns: - An observable sequence of windows. - """ - from ._windowwithcount import window_with_count_ - - return window_with_count_(count, skip) - - -def window_with_time( - timespan: typing.RelativeTime, - timeshift: Optional[typing.RelativeTime] = None, - scheduler: Optional[abc.SchedulerBase] = None, -) -> Callable[[Observable[_T]], Observable[Observable[_T]]]: - from ._windowwithtime import window_with_time_ - - return window_with_time_(timespan, timeshift, scheduler) - - -def window_with_time_or_count( - timespan: typing.RelativeTime, - count: int, - scheduler: Optional[abc.SchedulerBase] = None, -) -> Callable[[Observable[_T]], Observable[Observable[_T]]]: - from ._windowwithtimeorcount import window_with_time_or_count_ - - return window_with_time_or_count_(timespan, count, scheduler) - - -def with_latest_from( - *sources: Observable[Any], -) -> Callable[[Observable[Any]], Observable[Any]]: - """The `with_latest_from` operator. - - Merges the specified observable sequences into one observable - sequence by creating a tuple only when the first - observable sequence produces an element. The observables can be - passed either as separate arguments or as a list. - - .. marble:: - :alt: with_latest_from - - ---1---2---3----4-| - --a-----b----c-d----| - [with_latest_from() ] - ---1,a-2,a-3,b--4,d-| - - Examples: - >>> op = with_latest_from(obs1) - >>> op = with_latest_from([obs1, obs2, obs3]) - - Returns: - An operator function that takes an observable source and - returns an observable sequence containing the result of - combining elements of the sources into a tuple. - """ - from ._withlatestfrom import with_latest_from_ - - return with_latest_from_(*sources) - - -def zip(*args: Observable[Any]) -> Callable[[Observable[Any]], Observable[Any]]: - """Merges the specified observable sequences into one observable - sequence by creating a tuple whenever all of the - observable sequences have produced an element at a corresponding - index. - - .. marble:: - :alt: zip - - --1--2---3-----4---| - -a----b----c-d------| - [ zip() ] - --1,a-2,b--3,c-4,d-| - - - Example: - >>> res = zip(obs1, obs2) - - Args: - args: Observable sources to zip. - - Returns: - An operator function that takes an observable source and - returns an observable sequence containing the result of - combining elements of the sources as a tuple. - """ - from ._zip import zip_ - - return zip_(*args) - - -def zip_with_iterable( - second: Iterable[_T2], -) -> Callable[[Observable[_T1]], Observable[Tuple[_T1, _T2]]]: - """Merges the specified observable sequence and list into one - observable sequence by creating a tuple whenever all of - the observable sequences have produced an element at a - corresponding index. - - .. marble:: - :alt: zip_with_iterable - - --1---2----3---4---| - [ zip(a,b,c,b) ] - --1,a-2,b--3,c-4,d-| - - Example - >>> res = zip([1,2,3]) - - Args: - second: Iterable to zip with the source observable.. - - Returns: - An operator function that takes and observable source and - returns an observable sequence containing the result of - combining elements of the sources as a tuple. - """ - from ._zip import zip_with_iterable_ - - return zip_with_iterable_(second) - - -zip_with_list = zip_with_iterable - -__all__ = [ - "all", - "amb", - "as_observable", - "average", - "buffer", - "buffer_when", - "buffer_toggle", - "buffer_with_count", - "buffer_with_time", - "buffer_with_time_or_count", - "catch", - "combine_latest", - "concat", - "contains", - "count", - "debounce", - "throttle_with_timeout", - "default_if_empty", - "delay_subscription", - "delay_with_mapper", - "dematerialize", - "delay", - "distinct", - "distinct_until_changed", - "do", - "do_action", - "do_while", - "element_at", - "element_at_or_default", - "exclusive", - "expand", - "filter", - "filter_indexed", - "finally_action", - "find", - "find_index", - "first", - "first_or_default", - "flat_map", - "flat_map_indexed", - "flat_map_latest", - "fork_join", - "group_by", - "group_by_until", - "group_join", - "ignore_elements", - "is_empty", - "join", - "last", - "last_or_default", - "map", - "map_indexed", - "materialize", - "max", - "max_by", - "merge", - "merge_all", - "min", - "min_by", - "multicast", - "observe_on", - "on_error_resume_next", - "pairwise", - "partition", - "partition_indexed", - "pluck", - "pluck_attr", - "publish", - "publish_value", - "reduce", - "ref_count", - "repeat", - "replay", - "retry", - "sample", - "scan", - "sequence_equal", - "share", - "single", - "single_or_default", - "single_or_default_async", - "skip", - "skip_last", - "skip_last_with_time", - "skip_until", - "skip_until_with_time", - "skip_while", - "skip_while_indexed", - "skip_with_time", - "slice", - "some", - "starmap", - "starmap_indexed", - "start_with", - "subscribe_on", - "sum", - "switch_latest", - "take", - "take_last", - "take_last_buffer", - "take_last_with_time", - "take_until", - "take_until_with_time", - "take_while", - "take_while_indexed", - "take_with_time", - "throttle_first", - "throttle_with_mapper", - "timestamp", - "timeout", - "timeout_with_mapper", - "time_interval", - "to_dict", - "to_future", - "to_iterable", - "to_list", - "to_marbles", - "to_set", - "while_do", - "window", - "window_when", - "window_toggle", - "window_with_count", - "window_with_time", - "window_with_time_or_count", - "with_latest_from", - "zip", - "zip_with_list", - "zip_with_iterable", - "zip_with_list", -] diff --git a/frogpilot/third_party/reactivex/operators/_all.py b/frogpilot/third_party/reactivex/operators/_all.py deleted file mode 100644 index 45d1d9f5..00000000 --- a/frogpilot/third_party/reactivex/operators/_all.py +++ /dev/null @@ -1,24 +0,0 @@ -from typing import Callable, TypeVar - -from reactivex import Observable, compose -from reactivex import operators as ops -from reactivex.typing import Predicate - -_T = TypeVar("_T") - - -def all_(predicate: Predicate[_T]) -> Callable[[Observable[_T]], Observable[bool]]: - def filter(v: _T): - return not predicate(v) - - def mapping(b: bool) -> bool: - return not b - - return compose( - ops.filter(filter), - ops.some(), - ops.map(mapping), - ) - - -__all__ = ["all_"] diff --git a/frogpilot/third_party/reactivex/operators/_amb.py b/frogpilot/third_party/reactivex/operators/_amb.py deleted file mode 100644 index 49bf94ad..00000000 --- a/frogpilot/third_party/reactivex/operators/_amb.py +++ /dev/null @@ -1,92 +0,0 @@ -from asyncio import Future -from typing import Callable, List, Optional, TypeVar, Union - -from reactivex import Observable, abc, from_future -from reactivex.disposable import CompositeDisposable, SingleAssignmentDisposable - -_T = TypeVar("_T") - - -def amb_( - right_source: Union[Observable[_T], "Future[_T]"] -) -> Callable[[Observable[_T]], Observable[_T]]: - - if isinstance(right_source, Future): - obs: Observable[_T] = from_future(right_source) - else: - obs = right_source - - def amb(left_source: Observable[_T]) -> Observable[_T]: - def subscribe( - observer: abc.ObserverBase[_T], - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - choice: List[Optional[str]] = [None] - left_choice = "L" - right_choice = "R" - left_subscription = SingleAssignmentDisposable() - right_subscription = SingleAssignmentDisposable() - - def choice_left(): - if not choice[0]: - choice[0] = left_choice - right_subscription.dispose() - - def choice_right(): - if not choice[0]: - choice[0] = right_choice - left_subscription.dispose() - - def on_next_left(value: _T) -> None: - with left_source.lock: - choice_left() - if choice[0] == left_choice: - observer.on_next(value) - - def on_error_left(err: Exception) -> None: - with left_source.lock: - choice_left() - if choice[0] == left_choice: - observer.on_error(err) - - def on_completed_left() -> None: - with left_source.lock: - choice_left() - if choice[0] == left_choice: - observer.on_completed() - - left_d = left_source.subscribe( - on_next_left, on_error_left, on_completed_left, scheduler=scheduler - ) - left_subscription.disposable = left_d - - def send_right(value: _T) -> None: - with left_source.lock: - choice_right() - if choice[0] == right_choice: - observer.on_next(value) - - def on_error_right(err: Exception) -> None: - with left_source.lock: - choice_right() - if choice[0] == right_choice: - observer.on_error(err) - - def on_completed_right() -> None: - with left_source.lock: - choice_right() - if choice[0] == right_choice: - observer.on_completed() - - right_d = obs.subscribe( - send_right, on_error_right, on_completed_right, scheduler=scheduler - ) - right_subscription.disposable = right_d - return CompositeDisposable(left_subscription, right_subscription) - - return Observable(subscribe) - - return amb - - -__all__ = ["amb_"] diff --git a/frogpilot/third_party/reactivex/operators/_asobservable.py b/frogpilot/third_party/reactivex/operators/_asobservable.py deleted file mode 100644 index 8a306daf..00000000 --- a/frogpilot/third_party/reactivex/operators/_asobservable.py +++ /dev/null @@ -1,31 +0,0 @@ -from typing import Callable, Optional, TypeVar - -from reactivex import Observable, abc - -_T = TypeVar("_T") - - -def as_observable_() -> Callable[[Observable[_T]], Observable[_T]]: - def as_observable(source: Observable[_T]) -> Observable[_T]: - """Hides the identity of an observable sequence. - - Args: - source: Observable source to hide identity from. - - Returns: - An observable sequence that hides the identity of the - source sequence. - """ - - def subscribe( - observer: abc.ObserverBase[_T], - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - return source.subscribe(observer, scheduler=scheduler) - - return Observable(subscribe) - - return as_observable - - -__all__ = ["as_observable_"] diff --git a/frogpilot/third_party/reactivex/operators/_average.py b/frogpilot/third_party/reactivex/operators/_average.py deleted file mode 100644 index 99ab672e..00000000 --- a/frogpilot/third_party/reactivex/operators/_average.py +++ /dev/null @@ -1,62 +0,0 @@ -from dataclasses import dataclass -from typing import Any, Callable, Optional, TypeVar, cast - -from reactivex import Observable, operators, typing - -_T = TypeVar("_T") - - -@dataclass -class AverageValue: - sum: float - count: int - - -def average_( - key_mapper: Optional[typing.Mapper[_T, float]] = None, -) -> Callable[[Observable[_T]], Observable[float]]: - def average(source: Observable[Any]) -> Observable[float]: - """Partially applied average operator. - - Computes the average of an observable sequence of values that - are in the sequence or obtained by invoking a transform - function on each element of the input sequence if present. - - Examples: - >>> res = average(source) - - Args: - source: Source observable to average. - - Returns: - An observable sequence containing a single element with the - average of the sequence of values. - """ - - key_mapper_: typing.Mapper[_T, float] = key_mapper or ( - lambda x: float(cast(Any, x)) - ) - - def accumulator(prev: AverageValue, cur: float) -> AverageValue: - return AverageValue(sum=prev.sum + cur, count=prev.count + 1) - - def mapper(s: AverageValue) -> float: - if s.count == 0: - raise Exception("The input sequence was empty") - - return s.sum / float(s.count) - - seed = AverageValue(sum=0, count=0) - - ret = source.pipe( - operators.map(key_mapper_), - operators.scan(accumulator, seed), - operators.last(), - operators.map(mapper), - ) - return ret - - return average - - -__all__ = ["average_"] diff --git a/frogpilot/third_party/reactivex/operators/_buffer.py b/frogpilot/third_party/reactivex/operators/_buffer.py deleted file mode 100644 index a8920add..00000000 --- a/frogpilot/third_party/reactivex/operators/_buffer.py +++ /dev/null @@ -1,80 +0,0 @@ -from typing import Any, Callable, List, Optional, TypeVar - -from reactivex import Observable, compose -from reactivex import operators as ops - -_T = TypeVar("_T") - - -def buffer_( - boundaries: Observable[Any], -) -> Callable[[Observable[_T]], Observable[List[_T]]]: - return compose( - ops.window(boundaries), - ops.flat_map(ops.to_list()), - ) - - -def buffer_when_( - closing_mapper: Callable[[], Observable[Any]] -) -> Callable[[Observable[_T]], Observable[List[_T]]]: - return compose( - ops.window_when(closing_mapper), - ops.flat_map(ops.to_list()), - ) - - -def buffer_toggle_( - openings: Observable[Any], closing_mapper: Callable[[Any], Observable[Any]] -) -> Callable[[Observable[_T]], Observable[List[_T]]]: - return compose( - ops.window_toggle(openings, closing_mapper), - ops.flat_map(ops.to_list()), - ) - - -def buffer_with_count_( - count: int, skip: Optional[int] = None -) -> Callable[[Observable[_T]], Observable[List[_T]]]: - """Projects each element of an observable sequence into zero or more - buffers which are produced based on element count information. - - Examples: - >>> res = buffer_with_count(10)(xs) - >>> res = buffer_with_count(10, 1)(xs) - - Args: - count: Length of each buffer. - skip: [Optional] Number of elements to skip between - creation of consecutive buffers. If not provided, defaults to - the count. - - Returns: - A function that takes an observable source and returns an - observable sequence of buffers. - """ - - def buffer_with_count(source: Observable[_T]) -> Observable[List[_T]]: - nonlocal skip - - if skip is None: - skip = count - - def mapper(value: Observable[_T]) -> Observable[List[_T]]: - return value.pipe( - ops.to_list(), - ) - - def predicate(value: List[_T]) -> bool: - return len(value) > 0 - - return source.pipe( - ops.window_with_count(count, skip), - ops.flat_map(mapper), - ops.filter(predicate), - ) - - return buffer_with_count - - -__all__ = ["buffer_", "buffer_with_count_", "buffer_when_", "buffer_toggle_"] diff --git a/frogpilot/third_party/reactivex/operators/_bufferwithtime.py b/frogpilot/third_party/reactivex/operators/_bufferwithtime.py deleted file mode 100644 index e6bc191e..00000000 --- a/frogpilot/third_party/reactivex/operators/_bufferwithtime.py +++ /dev/null @@ -1,24 +0,0 @@ -from typing import Callable, List, Optional, TypeVar - -from reactivex import Observable, abc, compose -from reactivex import operators as ops -from reactivex import typing - -_T = TypeVar("_T") - - -def buffer_with_time_( - timespan: typing.RelativeTime, - timeshift: Optional[typing.RelativeTime] = None, - scheduler: Optional[abc.SchedulerBase] = None, -) -> Callable[[Observable[_T]], Observable[List[_T]]]: - if not timeshift: - timeshift = timespan - - return compose( - ops.window_with_time(timespan, timeshift, scheduler), - ops.flat_map(ops.to_list()), - ) - - -__all__ = ["buffer_with_time_"] diff --git a/frogpilot/third_party/reactivex/operators/_bufferwithtimeorcount.py b/frogpilot/third_party/reactivex/operators/_bufferwithtimeorcount.py deleted file mode 100644 index f20cc56d..00000000 --- a/frogpilot/third_party/reactivex/operators/_bufferwithtimeorcount.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Callable, List, Optional, TypeVar - -from reactivex import Observable, abc, compose -from reactivex import operators as ops -from reactivex import typing - -_T = TypeVar("_T") - - -def buffer_with_time_or_count_( - timespan: typing.RelativeTime, - count: int, - scheduler: Optional[abc.SchedulerBase] = None, -) -> Callable[[Observable[_T]], Observable[List[_T]]]: - return compose( - ops.window_with_time_or_count(timespan, count, scheduler), - ops.flat_map(ops.to_iterable()), - ) - - -__all__ = ["buffer_with_time_or_count_"] diff --git a/frogpilot/third_party/reactivex/operators/_catch.py b/frogpilot/third_party/reactivex/operators/_catch.py deleted file mode 100644 index e6f75321..00000000 --- a/frogpilot/third_party/reactivex/operators/_catch.py +++ /dev/null @@ -1,78 +0,0 @@ -from asyncio import Future -from typing import Callable, Optional, TypeVar, Union - -import reactivex -from reactivex import Observable, abc -from reactivex.disposable import SerialDisposable, SingleAssignmentDisposable - -_T = TypeVar("_T") - - -def catch_handler( - source: Observable[_T], - handler: Callable[[Exception, Observable[_T]], Union[Observable[_T], "Future[_T]"]], -) -> Observable[_T]: - def subscribe( - observer: abc.ObserverBase[_T], scheduler: Optional[abc.SchedulerBase] = None - ) -> abc.DisposableBase: - d1 = SingleAssignmentDisposable() - subscription = SerialDisposable() - - subscription.disposable = d1 - - def on_error(exception: Exception) -> None: - try: - result = handler(exception, source) - except Exception as ex: # By design. pylint: disable=W0703 - observer.on_error(ex) - return - - result = ( - reactivex.from_future(result) if isinstance(result, Future) else result - ) - d = SingleAssignmentDisposable() - subscription.disposable = d - d.disposable = result.subscribe(observer, scheduler=scheduler) - - d1.disposable = source.subscribe( - observer.on_next, on_error, observer.on_completed, scheduler=scheduler - ) - return subscription - - return Observable(subscribe) - - -def catch_( - handler: Union[ - Observable[_T], Callable[[Exception, Observable[_T]], Observable[_T]] - ] -) -> Callable[[Observable[_T]], Observable[_T]]: - def catch(source: Observable[_T]) -> Observable[_T]: - """Continues an observable sequence that is terminated by an - exception with the next observable sequence. - - Examples: - >>> op = catch(ys) - >>> op = catch(lambda ex, src: ys(ex)) - - Args: - handler: Second observable sequence used to produce - results when an error occurred in the first sequence, or an - exception handler function that returns an observable sequence - given the error and source observable that occurred in the - first sequence. - - Returns: - An observable sequence containing the first sequence's - elements, followed by the elements of the handler sequence - in case an exception occurred. - """ - if callable(handler): - return catch_handler(source, handler) - else: - return reactivex.catch(source, handler) - - return catch - - -__all__ = ["catch_"] diff --git a/frogpilot/third_party/reactivex/operators/_combinelatest.py b/frogpilot/third_party/reactivex/operators/_combinelatest.py deleted file mode 100644 index 5a6095d0..00000000 --- a/frogpilot/third_party/reactivex/operators/_combinelatest.py +++ /dev/null @@ -1,30 +0,0 @@ -from typing import Any, Callable - -import reactivex -from reactivex import Observable - - -def combine_latest_( - *others: Observable[Any], -) -> Callable[[Observable[Any]], Observable[Any]]: - def combine_latest(source: Observable[Any]) -> Observable[Any]: - """Merges the specified observable sequences into one - observable sequence by creating a tuple whenever any - of the observable sequences produces an element. - - Examples: - >>> obs = combine_latest(source) - - Returns: - An observable sequence containing the result of combining - elements of the sources into a tuple. - """ - - sources = (source,) + others - - return reactivex.combine_latest(*sources) - - return combine_latest - - -__all__ = ["combine_latest_"] diff --git a/frogpilot/third_party/reactivex/operators/_concat.py b/frogpilot/third_party/reactivex/operators/_concat.py deleted file mode 100644 index e94862ae..00000000 --- a/frogpilot/third_party/reactivex/operators/_concat.py +++ /dev/null @@ -1,26 +0,0 @@ -from typing import Callable, TypeVar - -import reactivex -from reactivex import Observable - -_T = TypeVar("_T") - - -def concat_(*sources: Observable[_T]) -> Callable[[Observable[_T]], Observable[_T]]: - def concat(source: Observable[_T]) -> Observable[_T]: - """Concatenates all the observable sequences. - - Examples: - >>> op = concat(xs, ys, zs) - - Returns: - An operator function that takes one or more observable sources and - returns an observable sequence that contains the elements of - each given sequence, in sequential order. - """ - return reactivex.concat(source, *sources) - - return concat - - -__all__ = ["concat_"] diff --git a/frogpilot/third_party/reactivex/operators/_contains.py b/frogpilot/third_party/reactivex/operators/_contains.py deleted file mode 100644 index 952cb2a7..00000000 --- a/frogpilot/third_party/reactivex/operators/_contains.py +++ /dev/null @@ -1,25 +0,0 @@ -from typing import Callable, Optional, TypeVar - -from reactivex import Observable, compose -from reactivex import operators as ops -from reactivex import typing -from reactivex.internal.basic import default_comparer - -_T = TypeVar("_T") - - -def contains_( - value: _T, comparer: Optional[typing.Comparer[_T]] = None -) -> Callable[[Observable[_T]], Observable[bool]]: - comparer_ = comparer or default_comparer - - def predicate(v: _T) -> bool: - return comparer_(v, value) - - return compose( - ops.filter(predicate), - ops.some(), - ) - - -__all__ = ["contains_"] diff --git a/frogpilot/third_party/reactivex/operators/_count.py b/frogpilot/third_party/reactivex/operators/_count.py deleted file mode 100644 index feb2b2e3..00000000 --- a/frogpilot/third_party/reactivex/operators/_count.py +++ /dev/null @@ -1,27 +0,0 @@ -from typing import Callable, Optional, TypeVar - -from reactivex import Observable, compose -from reactivex import operators as ops -from reactivex.typing import Predicate - -_T = TypeVar("_T") - - -def count_( - predicate: Optional[Predicate[_T]] = None, -) -> Callable[[Observable[_T]], Observable[int]]: - - if predicate: - return compose( - ops.filter(predicate), - ops.count(), - ) - - def reducer(n: int, _: _T) -> int: - return n + 1 - - counter = ops.reduce(reducer, seed=0) - return counter - - -__all__ = ["count_"] diff --git a/frogpilot/third_party/reactivex/operators/_debounce.py b/frogpilot/third_party/reactivex/operators/_debounce.py deleted file mode 100644 index 0736e02e..00000000 --- a/frogpilot/third_party/reactivex/operators/_debounce.py +++ /dev/null @@ -1,174 +0,0 @@ -from typing import Any, Callable, List, Optional, TypeVar, cast - -from reactivex import Observable, abc, typing -from reactivex.disposable import ( - CompositeDisposable, - SerialDisposable, - SingleAssignmentDisposable, -) -from reactivex.scheduler import TimeoutScheduler - -_T = TypeVar("_T") - - -def debounce_( - duetime: typing.RelativeTime, scheduler: Optional[abc.SchedulerBase] -) -> Callable[[Observable[_T]], Observable[_T]]: - def debounce(source: Observable[_T]) -> Observable[_T]: - """Ignores values from an observable sequence which are followed by - another value before duetime. - - Example: - >>> res = debounce(source) - - Args: - source: Source observable to debounce. - - Returns: - An operator function that takes the source observable and - returns the debounced observable sequence. - """ - - def subscribe( - observer: abc.ObserverBase[_T], - scheduler_: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - _scheduler = scheduler or scheduler_ or TimeoutScheduler.singleton() - cancelable = SerialDisposable() - has_value = [False] - value: List[_T] = [cast(_T, None)] - _id: List[int] = [0] - - def on_next(x: _T) -> None: - has_value[0] = True - value[0] = x - _id[0] += 1 - current_id = _id[0] - d = SingleAssignmentDisposable() - cancelable.disposable = d - - def action(scheduler: abc.SchedulerBase, state: Any = None) -> None: - if has_value[0] and _id[0] == current_id: - observer.on_next(value[0]) - has_value[0] = False - - d.disposable = _scheduler.schedule_relative(duetime, action) - - def on_error(exception: Exception) -> None: - cancelable.dispose() - observer.on_error(exception) - has_value[0] = False - _id[0] += 1 - - def on_completed() -> None: - cancelable.dispose() - if has_value[0]: - observer.on_next(value[0]) - - observer.on_completed() - has_value[0] = False - _id[0] += 1 - - subscription = source.subscribe( - on_next, on_error, on_completed, scheduler=scheduler_ - ) - return CompositeDisposable(subscription, cancelable) - - return Observable(subscribe) - - return debounce - - -def throttle_with_mapper_( - throttle_duration_mapper: Callable[[Any], Observable[Any]] -) -> Callable[[Observable[_T]], Observable[_T]]: - def throttle_with_mapper(source: Observable[_T]) -> Observable[_T]: - """Partially applied throttle_with_mapper operator. - - Ignores values from an observable sequence which are followed by - another value within a computed throttle duration. - - Example: - >>> obs = throttle_with_mapper(source) - - Args: - source: The observable source to throttle. - - Returns: - The throttled observable sequence. - """ - - def subscribe( - observer: abc.ObserverBase[_T], - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - cancelable = SerialDisposable() - has_value: bool = False - value: _T = cast(_T, None) - _id = [0] - - def on_next(x: _T) -> None: - nonlocal value, has_value - - throttle = None - try: - throttle = throttle_duration_mapper(x) - except Exception as e: # pylint: disable=broad-except - observer.on_error(e) - return - - has_value = True - value = x - _id[0] += 1 - current_id = _id[0] - d = SingleAssignmentDisposable() - cancelable.disposable = d - - def on_next(x: Any) -> None: - nonlocal has_value - if has_value and _id[0] == current_id: - observer.on_next(value) - - has_value = False - d.dispose() - - def on_completed() -> None: - nonlocal has_value - if has_value and _id[0] == current_id: - observer.on_next(value) - - has_value = False - d.dispose() - - d.disposable = throttle.subscribe( - on_next, observer.on_error, on_completed, scheduler=scheduler - ) - - def on_error(e: Exception) -> None: - nonlocal has_value - cancelable.dispose() - observer.on_error(e) - has_value = False - _id[0] += 1 - - def on_completed() -> None: - nonlocal has_value - cancelable.dispose() - if has_value: - observer.on_next(value) - - observer.on_completed() - has_value = False - _id[0] += 1 - - subscription = source.subscribe( - on_next, on_error, on_completed, scheduler=scheduler - ) - return CompositeDisposable(subscription, cancelable) - - return Observable(subscribe) - - return throttle_with_mapper - - -__all__ = ["debounce_", "throttle_with_mapper_"] diff --git a/frogpilot/third_party/reactivex/operators/_defaultifempty.py b/frogpilot/third_party/reactivex/operators/_defaultifempty.py deleted file mode 100644 index c68cf82e..00000000 --- a/frogpilot/third_party/reactivex/operators/_defaultifempty.py +++ /dev/null @@ -1,52 +0,0 @@ -from typing import Callable, Optional, TypeVar - -from reactivex import Observable, abc - -_T = TypeVar("_T") - - -def default_if_empty_( - default_value: Optional[_T] = None, -) -> Callable[[Observable[_T]], Observable[Optional[_T]]]: - def default_if_empty(source: Observable[_T]) -> Observable[Optional[_T]]: - """Returns the elements of the specified sequence or the - specified value in a singleton sequence if the sequence is - empty. - - Examples: - >>> obs = default_if_empty(source) - - Args: - source: Source observable. - - Returns: - An observable sequence that contains the specified default - value if the source is empty otherwise, the elements of the - source. - """ - - def subscribe( - observer: abc.ObserverBase[Optional[_T]], - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - found = [False] - - def on_next(x: _T): - found[0] = True - observer.on_next(x) - - def on_completed(): - if not found[0]: - observer.on_next(default_value) - observer.on_completed() - - return source.subscribe( - on_next, observer.on_error, on_completed, scheduler=scheduler - ) - - return Observable(subscribe) - - return default_if_empty - - -__all__ = ["default_if_empty_"] diff --git a/frogpilot/third_party/reactivex/operators/_delay.py b/frogpilot/third_party/reactivex/operators/_delay.py deleted file mode 100644 index 90e66a75..00000000 --- a/frogpilot/third_party/reactivex/operators/_delay.py +++ /dev/null @@ -1,141 +0,0 @@ -from datetime import datetime -from typing import Any, Callable, List, Optional, TypeVar - -from reactivex import Notification, Observable, abc -from reactivex import operators as ops -from reactivex import typing -from reactivex.disposable import ( - CompositeDisposable, - MultipleAssignmentDisposable, - SerialDisposable, -) -from reactivex.internal.constants import DELTA_ZERO -from reactivex.notification import OnError -from reactivex.scheduler import TimeoutScheduler - -from ._timestamp import Timestamp - -_T = TypeVar("_T") - - -def observable_delay_timespan( - source: Observable[_T], - duetime: typing.RelativeTime, - scheduler: Optional[abc.SchedulerBase] = None, -) -> Observable[_T]: - def subscribe( - observer: abc.ObserverBase[_T], scheduler_: Optional[abc.SchedulerBase] = None - ): - nonlocal duetime - - _scheduler = scheduler or scheduler_ or TimeoutScheduler.singleton() - - if isinstance(duetime, datetime): - duetime_ = _scheduler.to_datetime(duetime) - _scheduler.now - else: - duetime_ = _scheduler.to_timedelta(duetime) - - cancelable = SerialDisposable() - exception: Optional[Exception] = None - active = [False] - running = [False] - queue: List[Timestamp[Notification[_T]]] = [] - - def on_next(notification: Timestamp[Notification[_T]]) -> None: - nonlocal exception - should_run = False - - with source.lock: - if isinstance(notification.value, OnError): - del queue[:] - queue.append(notification) - exception = notification.value.exception - should_run = not running[0] - else: - queue.append( - Timestamp( - value=notification.value, - timestamp=notification.timestamp + duetime_, - ) - ) - should_run = not active[0] - active[0] = True - - if should_run: - if exception: - observer.on_error(exception) - else: - mad = MultipleAssignmentDisposable() - cancelable.disposable = mad - - def action(scheduler: abc.SchedulerBase, state: Any = None): - if exception: - return - - with source.lock: - running[0] = True - while True: - result = None - if queue and queue[0].timestamp <= scheduler.now: - result = queue.pop(0).value - - if result: - result.accept(observer) - - if not result: - break - - should_continue = False - recurse_duetime: typing.RelativeTime = 0 - if queue: - should_continue = True - diff = queue[0].timestamp - scheduler.now - recurse_duetime = max(DELTA_ZERO, diff) - else: - active[0] = False - - ex = exception - running[0] = False - - if ex: - observer.on_error(ex) - elif should_continue: - mad.disposable = scheduler.schedule_relative( - recurse_duetime, action - ) - - mad.disposable = _scheduler.schedule_relative(duetime_, action) - - subscription = source.pipe( - ops.materialize(), - ops.timestamp(), - ).subscribe(on_next, scheduler=_scheduler) - - return CompositeDisposable(subscription, cancelable) - - return Observable(subscribe) - - -def delay_( - duetime: typing.RelativeTime, scheduler: Optional[abc.SchedulerBase] = None -) -> Callable[[Observable[_T]], Observable[_T]]: - def delay(source: Observable[_T]) -> Observable[_T]: - """Time shifts the observable sequence. - - A partially applied delay operator function. - - Examples: - >>> res = delay(source) - - Args: - source: The observable sequence to delay. - - Returns: - A time-shifted observable sequence. - """ - return observable_delay_timespan(source, duetime, scheduler) - - return delay - - -__all__ = ["delay_"] diff --git a/frogpilot/third_party/reactivex/operators/_delaysubscription.py b/frogpilot/third_party/reactivex/operators/_delaysubscription.py deleted file mode 100644 index 97b7f3fd..00000000 --- a/frogpilot/third_party/reactivex/operators/_delaysubscription.py +++ /dev/null @@ -1,38 +0,0 @@ -from typing import Any, Callable, Optional, TypeVar - -import reactivex -from reactivex import Observable, abc -from reactivex import operators as ops -from reactivex import typing - -_T = TypeVar("_T") - - -def delay_subscription_( - duetime: typing.AbsoluteOrRelativeTime, - scheduler: Optional[abc.SchedulerBase] = None, -) -> Callable[[Observable[_T]], Observable[_T]]: - def delay_subscription(source: Observable[_T]) -> Observable[_T]: - """Time shifts the observable sequence by delaying the subscription. - - Exampeles. - >>> res = source.delay_subscription(5) - - Args: - source: Source subscription to delay. - - Returns: - Time-shifted sequence. - """ - - def mapper(_: Any) -> Observable[_T]: - return reactivex.empty() - - return source.pipe( - ops.delay_with_mapper(reactivex.timer(duetime, scheduler=scheduler), mapper) - ) - - return delay_subscription - - -__all__ = ["delay_subscription_"] diff --git a/frogpilot/third_party/reactivex/operators/_delaywithmapper.py b/frogpilot/third_party/reactivex/operators/_delaywithmapper.py deleted file mode 100644 index 0465256b..00000000 --- a/frogpilot/third_party/reactivex/operators/_delaywithmapper.py +++ /dev/null @@ -1,109 +0,0 @@ -from typing import Any, Callable, Optional, TypeVar, Union - -from reactivex import Observable, abc, typing -from reactivex.disposable import ( - CompositeDisposable, - SerialDisposable, - SingleAssignmentDisposable, -) - -_T = TypeVar("_T") - - -def delay_with_mapper_( - subscription_delay: Union[ - Observable[Any], - typing.Mapper[Any, Observable[Any]], - None, - ] = None, - delay_duration_mapper: Optional[typing.Mapper[_T, Observable[Any]]] = None, -) -> Callable[[Observable[_T]], Observable[_T]]: - def delay_with_mapper(source: Observable[_T]) -> Observable[_T]: - """Time shifts the observable sequence based on a subscription - delay and a delay mapper function for each element. - - Examples: - >>> obs = delay_with_selector(source) - - Args: - subscription_delay: [Optional] Sequence indicating the - delay for the subscription to the source. - delay_duration_mapper: [Optional] Selector function to - retrieve a sequence indicating the delay for each given - element. - - Returns: - Time-shifted observable sequence. - """ - sub_delay: Optional[Observable[Any]] = None - mapper: Optional[typing.Mapper[Any, Observable[Any]]] = None - - if isinstance(subscription_delay, abc.ObservableBase): - mapper = delay_duration_mapper - sub_delay = subscription_delay - else: - mapper = subscription_delay - - def subscribe( - observer: abc.ObserverBase[_T], - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - delays = CompositeDisposable() - at_end = [False] - - def done(): - if at_end[0] and delays.length == 0: - observer.on_completed() - - subscription = SerialDisposable() - - def start(): - def on_next(x: _T) -> None: - try: - assert mapper - delay = mapper(x) - except Exception as error: # pylint: disable=broad-except - observer.on_error(error) - return - - d = SingleAssignmentDisposable() - delays.add(d) - - def on_next(_: Any) -> None: - observer.on_next(x) - delays.remove(d) - done() - - def on_completed() -> None: - observer.on_next(x) - delays.remove(d) - done() - - d.disposable = delay.subscribe( - on_next, observer.on_error, on_completed, scheduler=scheduler - ) - - def on_completed() -> None: - at_end[0] = True - subscription.dispose() - done() - - subscription.disposable = source.subscribe( - on_next, observer.on_error, on_completed, scheduler=scheduler - ) - - if not sub_delay: - start() - else: - subscription.disposable = sub_delay.subscribe( - lambda _: start(), observer.on_error, start - ) - - return CompositeDisposable(subscription, delays) - - return Observable(subscribe) - - return delay_with_mapper - - -__all__ = ["delay_with_mapper_"] diff --git a/frogpilot/third_party/reactivex/operators/_dematerialize.py b/frogpilot/third_party/reactivex/operators/_dematerialize.py deleted file mode 100644 index a2bf1c4b..00000000 --- a/frogpilot/third_party/reactivex/operators/_dematerialize.py +++ /dev/null @@ -1,36 +0,0 @@ -from typing import Callable, Optional, TypeVar - -from reactivex import Notification, Observable, abc - -_T = TypeVar("_T") - - -def dematerialize_() -> Callable[[Observable[Notification[_T]]], Observable[_T]]: - def dematerialize(source: Observable[Notification[_T]]) -> Observable[_T]: - """Partially applied dematerialize operator. - - Dematerializes the explicit notification values of an - observable sequence as implicit notifications. - - Returns: - An observable sequence exhibiting the behavior - corresponding to the source sequence's notification values. - """ - - def subscribe( - observer: abc.ObserverBase[_T], - scheduler: Optional[abc.SchedulerBase] = None, - ): - def on_next(value: Notification[_T]) -> None: - return value.accept(observer) - - return source.subscribe( - on_next, observer.on_error, observer.on_completed, scheduler=scheduler - ) - - return Observable(subscribe) - - return dematerialize - - -__all__ = ["dematerialize_"] diff --git a/frogpilot/third_party/reactivex/operators/_distinct.py b/frogpilot/third_party/reactivex/operators/_distinct.py deleted file mode 100644 index 918d0ee7..00000000 --- a/frogpilot/third_party/reactivex/operators/_distinct.py +++ /dev/null @@ -1,84 +0,0 @@ -from typing import Callable, Generic, List, Optional, TypeVar, cast - -from reactivex import Observable, abc, typing -from reactivex.internal.basic import default_comparer - -_T = TypeVar("_T") -_TKey = TypeVar("_TKey") - - -def array_index_of_comparer( - array: List[_TKey], item: _TKey, comparer: typing.Comparer[_TKey] -): - for i, a in enumerate(array): - if comparer(a, item): - return i - return -1 - - -class HashSet(Generic[_TKey]): - def __init__(self, comparer: typing.Comparer[_TKey]): - self.comparer = comparer - self.set: List[_TKey] = [] - - def push(self, value: _TKey): - ret_value = array_index_of_comparer(self.set, value, self.comparer) == -1 - if ret_value: - self.set.append(value) - return ret_value - - -def distinct_( - key_mapper: Optional[typing.Mapper[_T, _TKey]] = None, - comparer: Optional[typing.Comparer[_TKey]] = None, -) -> Callable[[Observable[_T]], Observable[_T]]: - comparer_ = comparer or cast(typing.Comparer[_TKey], default_comparer) - - def distinct(source: Observable[_T]) -> Observable[_T]: - """Returns an observable sequence that contains only distinct - elements according to the key_mapper and the comparer. Usage of - this operator should be considered carefully due to the - maintenance of an internal lookup structure which can grow - large. - - Examples: - >>> res = obs = distinct(source) - - Args: - source: Source observable to return distinct items from. - - Returns: - An observable sequence only containing the distinct - elements, based on a computed key value, from the source - sequence. - """ - - def subscribe( - observer: abc.ObserverBase[_T], - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - hashset = HashSet(comparer_) - - def on_next(x: _T) -> None: - key = cast(_TKey, x) - - if key_mapper: - try: - key = key_mapper(x) - except Exception as ex: - observer.on_error(ex) - return - - if hashset.push(key): - observer.on_next(x) - - return source.subscribe( - on_next, observer.on_error, observer.on_completed, scheduler=scheduler - ) - - return Observable(subscribe) - - return distinct - - -__all__ = ["distinct_"] diff --git a/frogpilot/third_party/reactivex/operators/_distinctuntilchanged.py b/frogpilot/third_party/reactivex/operators/_distinctuntilchanged.py deleted file mode 100644 index 3d9de569..00000000 --- a/frogpilot/third_party/reactivex/operators/_distinctuntilchanged.py +++ /dev/null @@ -1,80 +0,0 @@ -from typing import Callable, Optional, TypeVar, cast - -from reactivex import Observable, abc -from reactivex.internal.basic import default_comparer, identity -from reactivex.typing import Comparer, Mapper - -_T = TypeVar("_T") -_TKey = TypeVar("_TKey") - - -def distinct_until_changed_( - key_mapper: Optional[Mapper[_T, _TKey]] = None, - comparer: Optional[Comparer[_TKey]] = None, -) -> Callable[[Observable[_T]], Observable[_T]]: - - key_mapper_ = key_mapper or cast(Callable[[_T], _TKey], identity) - comparer_ = comparer or default_comparer - - def distinct_until_changed(source: Observable[_T]) -> Observable[_T]: - """Returns an observable sequence that contains only distinct - contiguous elements according to the key_mapper and the - comparer. - - Examples: - >>> op = distinct_until_changed(); - >>> op = distinct_until_changed(lambda x: x.id) - >>> op = distinct_until_changed(lambda x: x.id, lambda x, y: x == y) - - Args: - key_mapper: [Optional] A function to compute the comparison - key for each element. If not provided, it projects the - value. - comparer: [Optional] Equality comparer for computed key - values. If not provided, defaults to an equality - comparer function. - - Returns: - An observable sequence only containing the distinct - contiguous elements, based on a computed key value, from - the source sequence. - """ - - def subscribe( - observer: abc.ObserverBase[_T], - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - has_current_key = False - current_key: _TKey = cast(_TKey, None) - - def on_next(value: _T) -> None: - nonlocal has_current_key, current_key - comparer_equals = False - try: - key = key_mapper_(value) - except Exception as exception: # pylint: disable=broad-except - observer.on_error(exception) - return - - if has_current_key: - try: - comparer_equals = comparer_(current_key, key) - except Exception as exception: # pylint: disable=broad-except - observer.on_error(exception) - return - - if not has_current_key or not comparer_equals: - has_current_key = True - current_key = key - observer.on_next(value) - - return source.subscribe( - on_next, observer.on_error, observer.on_completed, scheduler=scheduler - ) - - return Observable(subscribe) - - return distinct_until_changed - - -__all__ = ["distinct_until_changed_"] diff --git a/frogpilot/third_party/reactivex/operators/_do.py b/frogpilot/third_party/reactivex/operators/_do.py deleted file mode 100644 index f287cffc..00000000 --- a/frogpilot/third_party/reactivex/operators/_do.py +++ /dev/null @@ -1,328 +0,0 @@ -from typing import Any, Callable, List, Optional, TypeVar - -from reactivex import Observable, abc, typing -from reactivex.disposable import CompositeDisposable - -_T = TypeVar("_T") - - -def do_action_( - on_next: Optional[typing.OnNext[_T]] = None, - on_error: Optional[typing.OnError] = None, - on_completed: Optional[typing.OnCompleted] = None, -) -> Callable[[Observable[_T]], Observable[_T]]: - def do_action(source: Observable[_T]) -> Observable[_T]: - """Invokes an action for each element in the observable - sequence and invokes an action on graceful or exceptional - termination of the observable sequence. This method can be used - for debugging, logging, etc. of query behavior by intercepting - the message stream to run arbitrary actions for messages on the - pipeline. - - Examples: - >>> do_action(send)(observable) - >>> do_action(on_next, on_error)(observable) - >>> do_action(on_next, on_error, on_completed)(observable) - - Args: - on_next: [Optional] Action to invoke for each element in - the observable sequence. - on_error: [Optional] Action to invoke on exceptional - termination of the observable sequence. - on_completed: [Optional] Action to invoke on graceful - termination of the observable sequence. - - Returns: - An observable source sequence with the side-effecting - behavior applied. - """ - - def subscribe( - observer: abc.ObserverBase[_T], - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - def _on_next(x: _T) -> None: - if not on_next: - observer.on_next(x) - else: - try: - on_next(x) - except Exception as e: # pylint: disable=broad-except - observer.on_error(e) - - observer.on_next(x) - - def _on_error(exception: Exception) -> None: - if not on_error: - observer.on_error(exception) - else: - try: - on_error(exception) - except Exception as e: # pylint: disable=broad-except - observer.on_error(e) - - observer.on_error(exception) - - def _on_completed() -> None: - if not on_completed: - observer.on_completed() - else: - try: - on_completed() - except Exception as e: # pylint: disable=broad-except - observer.on_error(e) - - observer.on_completed() - - return source.subscribe( - _on_next, _on_error, _on_completed, scheduler=scheduler - ) - - return Observable(subscribe) - - return do_action - - -def do_(observer: abc.ObserverBase[_T]) -> Callable[[Observable[_T]], Observable[_T]]: - """Invokes an action for each element in the observable sequence and - invokes an action on graceful or exceptional termination of the - observable sequence. This method can be used for debugging, logging, - etc. of query behavior by intercepting the message stream to run - arbitrary actions for messages on the pipeline. - - >>> do(observer) - - Args: - observer: Observer - - Returns: - An operator function that takes the source observable and - returns the source sequence with the side-effecting behavior - applied. - """ - - return do_action_(observer.on_next, observer.on_error, observer.on_completed) - - -def do_after_next( - source: Observable[_T], after_next: typing.OnNext[_T] -) -> Observable[_T]: - """Invokes an action with each element after it has been emitted downstream. - This can be helpful for debugging, logging, and other side effects. - - after_next -- Action to invoke on each element after it has been emitted - """ - - def subscribe( - observer: abc.ObserverBase[_T], scheduler: Optional[abc.SchedulerBase] = None - ) -> abc.DisposableBase: - def on_next(value: _T): - try: - observer.on_next(value) - after_next(value) - except Exception as e: # pylint: disable=broad-except - observer.on_error(e) - - return source.subscribe(on_next, observer.on_error, observer.on_completed) - - return Observable(subscribe) - - -def do_on_subscribe(source: Observable[Any], on_subscribe: typing.Action): - """Invokes an action on subscription. - - This can be helpful for debugging, logging, and other side effects - on the start of an operation. - - Args: - on_subscribe: Action to invoke on subscription - """ - - def subscribe( - observer: abc.ObserverBase[Any], scheduler: Optional[abc.SchedulerBase] = None - ) -> abc.DisposableBase: - on_subscribe() - return source.subscribe( - observer.on_next, - observer.on_error, - observer.on_completed, - scheduler=scheduler, - ) - - return Observable(subscribe) - - -def do_on_dispose(source: Observable[Any], on_dispose: typing.Action): - """Invokes an action on disposal. - - This can be helpful for debugging, logging, and other side effects - on the disposal of an operation. - - Args: - on_dispose: Action to invoke on disposal - """ - - class OnDispose(abc.DisposableBase): - def dispose(self) -> None: - on_dispose() - - def subscribe( - observer: abc.ObserverBase[Any], scheduler: Optional[abc.SchedulerBase] = None - ) -> abc.DisposableBase: - composite_disposable = CompositeDisposable() - composite_disposable.add(OnDispose()) - subscription = source.subscribe( - observer.on_next, - observer.on_error, - observer.on_completed, - scheduler=scheduler, - ) - composite_disposable.add(subscription) - return composite_disposable - - return Observable(subscribe) - - -def do_on_terminate(source: Observable[Any], on_terminate: typing.Action): - """Invokes an action on an on_complete() or on_error() event. - This can be helpful for debugging, logging, and other side effects - when completion or an error terminates an operation. - - - on_terminate -- Action to invoke when on_complete or throw is called - """ - - def subscribe( - observer: abc.ObserverBase[Any], scheduler: Optional[abc.SchedulerBase] = None - ) -> abc.DisposableBase: - def on_completed(): - try: - on_terminate() - except Exception as err: # pylint: disable=broad-except - observer.on_error(err) - else: - observer.on_completed() - - def on_error(exception: Exception): - try: - on_terminate() - except Exception as err: # pylint: disable=broad-except - observer.on_error(err) - else: - observer.on_error(exception) - - return source.subscribe( - observer.on_next, on_error, on_completed, scheduler=scheduler - ) - - return Observable(subscribe) - - -def do_after_terminate(source: Observable[Any], after_terminate: typing.Action): - """Invokes an action after an on_complete() or on_error() event. - This can be helpful for debugging, logging, and other side effects - when completion or an error terminates an operation - - - on_terminate -- Action to invoke after on_complete or throw is called - """ - - def subscribe( - observer: abc.ObserverBase[Any], scheduler: Optional[abc.SchedulerBase] = None - ) -> abc.DisposableBase: - def on_completed(): - observer.on_completed() - try: - after_terminate() - except Exception as err: # pylint: disable=broad-except - observer.on_error(err) - - def on_error(exception: Exception) -> None: - observer.on_error(exception) - try: - after_terminate() - except Exception as err: # pylint: disable=broad-except - observer.on_error(err) - - return source.subscribe( - observer.on_next, on_error, on_completed, scheduler=scheduler - ) - - return Observable(subscribe) - - -def do_finally( - finally_action: typing.Action, -) -> Callable[[Observable[_T]], Observable[_T]]: - """Invokes an action after an on_complete(), on_error(), or disposal - event occurs. - - This can be helpful for debugging, logging, and other side effects - when completion, an error, or disposal terminates an operation. - - Note this operator will strive to execute the finally_action once, - and prevent any redudant calls - - Args: - finally_action -- Action to invoke after on_complete, on_error, - or disposal is called - """ - - class OnDispose(abc.DisposableBase): - def __init__(self, was_invoked: List[bool]): - self.was_invoked = was_invoked - - def dispose(self) -> None: - if not self.was_invoked[0]: - finally_action() - self.was_invoked[0] = True - - def partial(source: Observable[_T]) -> Observable[_T]: - def subscribe( - observer: abc.ObserverBase[_T], - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - was_invoked = [False] - - def on_completed(): - observer.on_completed() - try: - if not was_invoked[0]: - finally_action() - was_invoked[0] = True - except Exception as err: # pylint: disable=broad-except - observer.on_error(err) - - def on_error(exception: Exception): - observer.on_error(exception) - try: - if not was_invoked[0]: - finally_action() - was_invoked[0] = True - except Exception as err: # pylint: disable=broad-except - observer.on_error(err) - - composite_disposable = CompositeDisposable() - composite_disposable.add(OnDispose(was_invoked)) - subscription = source.subscribe( - observer.on_next, on_error, on_completed, scheduler=scheduler - ) - composite_disposable.add(subscription) - - return composite_disposable - - return Observable(subscribe) - - return partial - - -__all__ = [ - "do_", - "do_action_", - "do_after_next", - "do_finally", - "do_on_dispose", - "do_on_subscribe", - "do_on_terminate", - "do_after_terminate", -] diff --git a/frogpilot/third_party/reactivex/operators/_dowhile.py b/frogpilot/third_party/reactivex/operators/_dowhile.py deleted file mode 100644 index 09a48b96..00000000 --- a/frogpilot/third_party/reactivex/operators/_dowhile.py +++ /dev/null @@ -1,36 +0,0 @@ -from typing import Callable, TypeVar - -from reactivex import Observable -from reactivex import operators as ops - -_T = TypeVar("_T") - - -def do_while_( - condition: Callable[[Observable[_T]], bool] -) -> Callable[[Observable[_T]], Observable[_T]]: - """Repeats source as long as condition holds emulating a do while - loop. - - Args: - condition: The condition which determines if the source will be - repeated. - - Returns: - An observable sequence which is repeated as long - as the condition holds. - """ - - def do_while(source: Observable[_T]) -> Observable[_T]: - return source.pipe( - ops.concat( - source.pipe( - ops.while_do(condition), - ), - ) - ) - - return do_while - - -__all__ = ["do_while_"] diff --git a/frogpilot/third_party/reactivex/operators/_elementatordefault.py b/frogpilot/third_party/reactivex/operators/_elementatordefault.py deleted file mode 100644 index 08010bcb..00000000 --- a/frogpilot/third_party/reactivex/operators/_elementatordefault.py +++ /dev/null @@ -1,51 +0,0 @@ -from typing import Callable, Optional, TypeVar, cast - -from reactivex import Observable, abc -from reactivex.internal.exceptions import ArgumentOutOfRangeException - -_T = TypeVar("_T") - - -def element_at_or_default_( - index: int, has_default: bool = False, default_value: Optional[_T] = None -) -> Callable[[Observable[_T]], Observable[_T]]: - if index < 0: - raise ArgumentOutOfRangeException() - - def element_at_or_default(source: Observable[_T]) -> Observable[_T]: - def subscribe( - observer: abc.ObserverBase[_T], - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - index_ = index - - def on_next(x: _T) -> None: - nonlocal index_ - found = False - with source.lock: - if index_: - index_ -= 1 - else: - found = True - - if found: - observer.on_next(x) - observer.on_completed() - - def on_completed(): - if not has_default: - observer.on_error(ArgumentOutOfRangeException()) - else: - observer.on_next(cast(_T, default_value)) - observer.on_completed() - - return source.subscribe( - on_next, observer.on_error, on_completed, scheduler=scheduler - ) - - return Observable(subscribe) - - return element_at_or_default - - -__all__ = ["element_at_or_default_"] diff --git a/frogpilot/third_party/reactivex/operators/_exclusive.py b/frogpilot/third_party/reactivex/operators/_exclusive.py deleted file mode 100644 index b6402e27..00000000 --- a/frogpilot/third_party/reactivex/operators/_exclusive.py +++ /dev/null @@ -1,74 +0,0 @@ -from asyncio import Future -from typing import Callable, Optional, TypeVar, Union - -import reactivex -from reactivex import Observable, abc -from reactivex.disposable import CompositeDisposable, SingleAssignmentDisposable - -_T = TypeVar("_T") - - -def exclusive_() -> Callable[[Observable[Observable[_T]]], Observable[_T]]: - """Performs a exclusive waiting for the first to finish before - subscribing to another observable. Observables that come in between - subscriptions will be dropped on the floor. - - Returns: - An exclusive observable with only the results that - happen when subscribed. - """ - - def exclusive(source: Observable[Observable[_T]]) -> Observable[_T]: - def subscribe( - observer: abc.ObserverBase[_T], - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - has_current = [False] - is_stopped = [False] - m = SingleAssignmentDisposable() - g = CompositeDisposable() - - g.add(m) - - def on_next(inner_source: Union[Observable[_T], "Future[_T]"]) -> None: - if not has_current[0]: - has_current[0] = True - - inner_source = ( - reactivex.from_future(inner_source) - if isinstance(inner_source, Future) - else inner_source - ) - - inner_subscription = SingleAssignmentDisposable() - g.add(inner_subscription) - - def on_completed_inner(): - g.remove(inner_subscription) - has_current[0] = False - if is_stopped[0] and len(g) == 1: - observer.on_completed() - - inner_subscription.disposable = inner_source.subscribe( - observer.on_next, - observer.on_error, - on_completed_inner, - scheduler=scheduler, - ) - - def on_completed() -> None: - is_stopped[0] = True - if not has_current[0] and len(g) == 1: - observer.on_completed() - - m.disposable = source.subscribe( - on_next, observer.on_error, on_completed, scheduler=scheduler - ) - return g - - return Observable(subscribe) - - return exclusive - - -__all__ = ["exclusive_"] diff --git a/frogpilot/third_party/reactivex/operators/_expand.py b/frogpilot/third_party/reactivex/operators/_expand.py deleted file mode 100644 index 5f744762..00000000 --- a/frogpilot/third_party/reactivex/operators/_expand.py +++ /dev/null @@ -1,102 +0,0 @@ -from typing import Any, Callable, List, Optional, TypeVar - -from reactivex import Observable, abc, typing -from reactivex.disposable import ( - CompositeDisposable, - SerialDisposable, - SingleAssignmentDisposable, -) -from reactivex.scheduler import ImmediateScheduler - -_T = TypeVar("_T") - - -def expand_( - mapper: typing.Mapper[_T, Observable[_T]] -) -> Callable[[Observable[_T]], Observable[_T]]: - def expand(source: Observable[_T]) -> Observable[_T]: - """Expands an observable sequence by recursively invoking - mapper. - - Args: - source: Source obserable to expand. - - Returns: - An observable sequence containing all the elements produced - by the recursive expansion. - """ - - def subscribe( - observer: abc.ObserverBase[_T], - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - scheduler = scheduler or ImmediateScheduler.singleton() - - queue: List[Observable[_T]] = [] - m = SerialDisposable() - d = CompositeDisposable(m) - active_count = 0 - is_acquired = False - - def ensure_active(): - nonlocal is_acquired - - is_owner = False - if queue: - is_owner = not is_acquired - is_acquired = True - - def action(scheduler: abc.SchedulerBase, state: Any = None): - nonlocal is_acquired, active_count - - if queue: - work = queue.pop(0) - else: - is_acquired = False - return - - sad = SingleAssignmentDisposable() - d.add(sad) - - def on_next(value: _T) -> None: - nonlocal active_count - - observer.on_next(value) - result = None - try: - result = mapper(value) - except Exception as ex: - observer.on_error(ex) - return - - queue.append(result) - active_count += 1 - ensure_active() - - def on_complete() -> None: - nonlocal active_count - - d.remove(sad) - active_count -= 1 - if active_count == 0: - observer.on_completed() - - sad.disposable = work.subscribe( - on_next, observer.on_error, on_complete, scheduler=scheduler - ) - m.disposable = scheduler.schedule(action) - - if is_owner: - m.disposable = scheduler.schedule(action) - - queue.append(source) - active_count += 1 - ensure_active() - return d - - return Observable(subscribe) - - return expand - - -__all__ = ["expand_"] diff --git a/frogpilot/third_party/reactivex/operators/_filter.py b/frogpilot/third_party/reactivex/operators/_filter.py deleted file mode 100644 index 12939565..00000000 --- a/frogpilot/third_party/reactivex/operators/_filter.py +++ /dev/null @@ -1,98 +0,0 @@ -from typing import Callable, Optional, TypeVar - -from reactivex import Observable, abc -from reactivex.typing import Predicate, PredicateIndexed - -_T = TypeVar("_T") - - -# pylint: disable=redefined-builtin -def filter_(predicate: Predicate[_T]) -> Callable[[Observable[_T]], Observable[_T]]: - def filter(source: Observable[_T]) -> Observable[_T]: - """Partially applied filter operator. - - Filters the elements of an observable sequence based on a - predicate. - - Example: - >>> filter(source) - - Args: - source: Source observable to filter. - - Returns: - A filtered observable sequence. - """ - - def subscribe( - observer: abc.ObserverBase[_T], scheduler: Optional[abc.SchedulerBase] - ) -> abc.DisposableBase: - def on_next(value: _T): - try: - should_run = predicate(value) - except Exception as ex: # pylint: disable=broad-except - observer.on_error(ex) - return - - if should_run: - observer.on_next(value) - - return source.subscribe( - on_next, observer.on_error, observer.on_completed, scheduler=scheduler - ) - - return Observable(subscribe) - - return filter - - -def filter_indexed_( - predicate_indexed: Optional[PredicateIndexed[_T]] = None, -) -> Callable[[Observable[_T]], Observable[_T]]: - def filter_indexed(source: Observable[_T]) -> Observable[_T]: - """Partially applied indexed filter operator. - - Filters the elements of an observable sequence based on a - predicate by incorporating the element's index. - - Example: - >>> filter_indexed(source) - - Args: - source: Source observable to filter. - - Returns: - A filtered observable sequence. - """ - - def subscribe( - observer: abc.ObserverBase[_T], scheduler: Optional[abc.SchedulerBase] - ): - count = 0 - - def on_next(value: _T): - nonlocal count - should_run = True - - if predicate_indexed: - try: - should_run = predicate_indexed(value, count) - except Exception as ex: # pylint: disable=broad-except - observer.on_error(ex) - return - else: - count += 1 - - if should_run: - observer.on_next(value) - - return source.subscribe( - on_next, observer.on_error, observer.on_completed, scheduler=scheduler - ) - - return Observable(subscribe) - - return filter_indexed - - -__all__ = ["filter_", "filter_indexed_"] diff --git a/frogpilot/third_party/reactivex/operators/_finallyaction.py b/frogpilot/third_party/reactivex/operators/_finallyaction.py deleted file mode 100644 index 3e5f396a..00000000 --- a/frogpilot/third_party/reactivex/operators/_finallyaction.py +++ /dev/null @@ -1,50 +0,0 @@ -from typing import Callable, Optional, TypeVar - -from reactivex import Observable, abc, typing -from reactivex.disposable import Disposable - -_T = TypeVar("_T") - - -def finally_action_( - action: typing.Action, -) -> Callable[[Observable[_T]], Observable[_T]]: - def finally_action(source: Observable[_T]) -> Observable[_T]: - """Invokes a specified action after the source observable - sequence terminates gracefully or exceptionally. - - Example: - res = finally(source) - - Args: - source: Observable sequence. - - Returns: - An observable sequence with the action-invoking termination - behavior applied. - """ - - def subscribe( - observer: abc.ObserverBase[_T], - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - try: - subscription = source.subscribe(observer, scheduler=scheduler) - except Exception: - action() - raise - - def dispose(): - try: - subscription.dispose() - finally: - action() - - return Disposable(dispose) - - return Observable(subscribe) - - return finally_action - - -__all__ = ["finally_action_"] diff --git a/frogpilot/third_party/reactivex/operators/_find.py b/frogpilot/third_party/reactivex/operators/_find.py deleted file mode 100644 index d4ee2d51..00000000 --- a/frogpilot/third_party/reactivex/operators/_find.py +++ /dev/null @@ -1,46 +0,0 @@ -from typing import Callable, Optional, TypeVar, Union - -from reactivex import Observable, abc - -_T = TypeVar("_T") - - -def find_value_( - predicate: Callable[[_T, int, Observable[_T]], bool], yield_index: bool -) -> Callable[[Observable[_T]], Observable[Union[_T, int, None]]]: - def find_value(source: Observable[_T]) -> Observable[Union[_T, int, None]]: - def subscribe( - observer: abc.ObserverBase[Union[_T, int, None]], - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - index = 0 - - def on_next(x: _T) -> None: - nonlocal index - should_run = False - try: - should_run = predicate(x, index, source) - except Exception as ex: # pylint: disable=broad-except - observer.on_error(ex) - return - - if should_run: - observer.on_next(index if yield_index else x) - observer.on_completed() - else: - index += 1 - - def on_completed(): - observer.on_next(-1 if yield_index else None) - observer.on_completed() - - return source.subscribe( - on_next, observer.on_error, on_completed, scheduler=scheduler - ) - - return Observable(subscribe) - - return find_value - - -__all__ = ["find_value_"] diff --git a/frogpilot/third_party/reactivex/operators/_first.py b/frogpilot/third_party/reactivex/operators/_first.py deleted file mode 100644 index a19cc4d6..00000000 --- a/frogpilot/third_party/reactivex/operators/_first.py +++ /dev/null @@ -1,40 +0,0 @@ -from typing import Callable, Optional, TypeVar - -from reactivex import Observable, compose -from reactivex import operators as ops -from reactivex.typing import Predicate - -from ._firstordefault import first_or_default_async_ - -_T = TypeVar("_T") - - -def first_( - predicate: Optional[Predicate[_T]] = None, -) -> Callable[[Observable[_T]], Observable[_T]]: - """Returns the first element of an observable sequence that - satisfies the condition in the predicate if present else the first - item in the sequence. - - Examples: - >>> res = res = first()(source) - >>> res = res = first(lambda x: x > 3)(source) - - Args: - predicate -- [Optional] A predicate function to evaluate for - elements in the source sequence. - - Returns: - A function that takes an observable source and returns an - observable sequence containing the first element in the - observable sequence that satisfies the condition in the predicate if - provided, else the first item in the sequence. - """ - - if predicate: - return compose(ops.filter(predicate), ops.first()) - - return first_or_default_async_(False) - - -__all__ = ["first_"] diff --git a/frogpilot/third_party/reactivex/operators/_firstordefault.py b/frogpilot/third_party/reactivex/operators/_firstordefault.py deleted file mode 100644 index 32082ccb..00000000 --- a/frogpilot/third_party/reactivex/operators/_firstordefault.py +++ /dev/null @@ -1,71 +0,0 @@ -from typing import Callable, Optional, TypeVar, cast - -from reactivex import Observable, abc, compose -from reactivex import operators as ops -from reactivex.internal.exceptions import SequenceContainsNoElementsError -from reactivex.typing import Predicate - -_T = TypeVar("_T") - - -def first_or_default_async_( - has_default: bool = False, default_value: Optional[_T] = None -) -> Callable[[Observable[_T]], Observable[_T]]: - def first_or_default_async(source: Observable[_T]) -> Observable[_T]: - def subscribe( - observer: abc.ObserverBase[_T], - scheduler: Optional[abc.SchedulerBase] = None, - ): - def on_next(x: _T): - observer.on_next(x) - observer.on_completed() - - def on_completed(): - if not has_default: - observer.on_error(SequenceContainsNoElementsError()) - else: - observer.on_next(cast(_T, default_value)) - observer.on_completed() - - return source.subscribe( - on_next, observer.on_error, on_completed, scheduler=scheduler - ) - - return Observable(subscribe) - - return first_or_default_async - - -def first_or_default_( - predicate: Optional[Predicate[_T]] = None, default_value: Optional[_T] = None -) -> Callable[[Observable[_T]], Observable[_T]]: - """Returns the first element of an observable sequence that - satisfies the condition in the predicate, or a default value if no - such element exists. - - Examples: - >>> res = source.first_or_default() - >>> res = source.first_or_default(lambda x: x > 3) - >>> res = source.first_or_default(lambda x: x > 3, 0) - >>> res = source.first_or_default(None, 0) - - Args: - source -- Observable sequence. - predicate -- [optional] A predicate function to evaluate for - elements in the source sequence. - default_value -- [Optional] The default value if no such element - exists. If not specified, defaults to None. - - Returns: - A function that takes an observable source and reutrn an - observable sequence containing the first element in the - observable sequence that satisfies the condition in the - predicate, or a default value if no such element exists. - """ - - if predicate: - return compose(ops.filter(predicate), ops.first_or_default(None, default_value)) - return first_or_default_async_(True, default_value) - - -__all__ = ["first_or_default_", "first_or_default_async_"] diff --git a/frogpilot/third_party/reactivex/operators/_flatmap.py b/frogpilot/third_party/reactivex/operators/_flatmap.py deleted file mode 100644 index f7ca0195..00000000 --- a/frogpilot/third_party/reactivex/operators/_flatmap.py +++ /dev/null @@ -1,129 +0,0 @@ -from asyncio import Future -from typing import Any, Callable, Optional, TypeVar, Union, cast - -from reactivex import Observable, from_, from_future -from reactivex import operators as ops -from reactivex.internal.basic import identity -from reactivex.typing import Mapper, MapperIndexed - -_T1 = TypeVar("_T1") -_T2 = TypeVar("_T2") - - -def _flat_map_internal( - source: Observable[_T1], - mapper: Optional[Mapper[_T1, Any]] = None, - mapper_indexed: Optional[MapperIndexed[_T1, Any]] = None, -) -> Observable[Any]: - def projection(x: _T1, i: int) -> Observable[Any]: - mapper_result: Any = ( - mapper(x) - if mapper - else mapper_indexed(x, i) if mapper_indexed else identity - ) - if isinstance(mapper_result, Future): - result: Observable[Any] = from_future(cast("Future[Any]", mapper_result)) - elif isinstance(mapper_result, Observable): - result = mapper_result - else: - result = from_(mapper_result) - return result - - return source.pipe( - ops.map_indexed(projection), - ops.merge_all(), - ) - - -def flat_map_( - mapper: Optional[Mapper[_T1, Observable[_T2]]] = None -) -> Callable[[Observable[_T1]], Observable[_T2]]: - def flat_map(source: Observable[_T1]) -> Observable[_T2]: - """One of the Following: - Projects each element of an observable sequence to an observable - sequence and merges the resulting observable sequences into one - observable sequence. - - Example: - >>> flat_map(source) - - Args: - source: Source observable to flat map. - - Returns: - An operator function that takes a source observable and returns - an observable sequence whose elements are the result of invoking - the one-to-many transform function on each element of the - input sequence . - """ - - if callable(mapper): - ret = _flat_map_internal(source, mapper=mapper) - else: - ret = _flat_map_internal(source, mapper=lambda _: mapper) - - return ret - - return flat_map - - -def flat_map_indexed_( - mapper_indexed: Optional[Any] = None, -) -> Callable[[Observable[Any]], Observable[Any]]: - def flat_map_indexed(source: Observable[Any]) -> Observable[Any]: - """One of the Following: - Projects each element of an observable sequence to an observable - sequence and merges the resulting observable sequences into one - observable sequence. - - Example: - >>> flat_map_indexed(source) - - Args: - source: Source observable to flat map. - - Returns: - An observable sequence whose elements are the result of invoking - the one-to-many transform function on each element of the input - sequence. - """ - - if callable(mapper_indexed): - ret = _flat_map_internal(source, mapper_indexed=mapper_indexed) - else: - ret = _flat_map_internal(source, mapper=lambda _: mapper_indexed) - return ret - - return flat_map_indexed - - -def flat_map_latest_( - mapper: Mapper[_T1, Union[Observable[_T2], "Future[_T2]"]] -) -> Callable[[Observable[_T1]], Observable[_T2]]: - def flat_map_latest(source: Observable[_T1]) -> Observable[_T2]: - """Projects each element of an observable sequence into a new - sequence of observable sequences by incorporating the element's - index and then transforms an observable sequence of observable - sequences into an observable sequence producing values only - from the most recent observable sequence. - - Args: - source: Source observable to flat map latest. - - Returns: - An observable sequence whose elements are the result of - invoking the transform function on each element of source - producing an observable of Observable sequences and that at - any point in time produces the elements of the most recent - inner observable sequence that has been received. - """ - - return source.pipe( - ops.map(mapper), - ops.switch_latest(), - ) - - return flat_map_latest - - -__all__ = ["flat_map_", "flat_map_latest_", "flat_map_indexed_"] diff --git a/frogpilot/third_party/reactivex/operators/_forkjoin.py b/frogpilot/third_party/reactivex/operators/_forkjoin.py deleted file mode 100644 index 9d92be84..00000000 --- a/frogpilot/third_party/reactivex/operators/_forkjoin.py +++ /dev/null @@ -1,28 +0,0 @@ -from typing import Any, Callable, Tuple - -import reactivex -from reactivex import Observable - - -def fork_join_( - *args: Observable[Any], -) -> Callable[[Observable[Any]], Observable[Tuple[Any, ...]]]: - def fork_join(source: Observable[Any]) -> Observable[Tuple[Any, ...]]: - """Wait for observables to complete and then combine last values - they emitted into a tuple. Whenever any of that observables - completes without emitting any value, result sequence will - complete at that moment as well. - - Examples: - >>> obs = fork_join(source) - - Returns: - An observable sequence containing the result of combining - last element from each source in given sequence. - """ - return reactivex.fork_join(source, *args) - - return fork_join - - -__all__ = ["fork_join_"] diff --git a/frogpilot/third_party/reactivex/operators/_groupby.py b/frogpilot/third_party/reactivex/operators/_groupby.py deleted file mode 100644 index f34a6525..00000000 --- a/frogpilot/third_party/reactivex/operators/_groupby.py +++ /dev/null @@ -1,30 +0,0 @@ -from typing import Any, Callable, Optional, TypeVar - -from reactivex import GroupedObservable, Observable, typing -from reactivex.subject import Subject - -_T = TypeVar("_T") -_TKey = TypeVar("_TKey") -_TValue = TypeVar("_TValue") - -# pylint: disable=import-outside-toplevel - - -def group_by_( - key_mapper: typing.Mapper[_T, _TKey], - element_mapper: Optional[typing.Mapper[_T, _TValue]] = None, - subject_mapper: Optional[Callable[[], Subject[_TValue]]] = None, -) -> Callable[[Observable[_T]], Observable[GroupedObservable[_TKey, _TValue]]]: - from reactivex import operators as ops - - def duration_mapper(_: GroupedObservable[Any, Any]) -> Observable[Any]: - import reactivex - - return reactivex.never() - - return ops.group_by_until( - key_mapper, element_mapper, duration_mapper, subject_mapper - ) - - -__all__ = ["group_by_"] diff --git a/frogpilot/third_party/reactivex/operators/_groupbyuntil.py b/frogpilot/third_party/reactivex/operators/_groupbyuntil.py deleted file mode 100644 index 39100c0f..00000000 --- a/frogpilot/third_party/reactivex/operators/_groupbyuntil.py +++ /dev/null @@ -1,177 +0,0 @@ -from collections import OrderedDict -from typing import Any, Callable, Optional, TypeVar, cast - -from reactivex import GroupedObservable, Observable, abc -from reactivex import operators as ops -from reactivex.disposable import ( - CompositeDisposable, - RefCountDisposable, - SingleAssignmentDisposable, -) -from reactivex.internal.basic import identity -from reactivex.subject import Subject -from reactivex.typing import Mapper - -_T = TypeVar("_T") -_TKey = TypeVar("_TKey") -_TValue = TypeVar("_TValue") - - -def group_by_until_( - key_mapper: Mapper[_T, _TKey], - element_mapper: Optional[Mapper[_T, _TValue]], - duration_mapper: Callable[[GroupedObservable[_TKey, _TValue]], Observable[Any]], - subject_mapper: Optional[Callable[[], Subject[_TValue]]] = None, -) -> Callable[[Observable[_T]], Observable[GroupedObservable[_TKey, _TValue]]]: - """Groups the elements of an observable sequence according to a - specified key mapper function. A duration mapper function is used - to control the lifetime of groups. When a group expires, it receives - an OnCompleted notification. When a new element with the same key - value as a reclaimed group occurs, the group will be reborn with a - new lifetime request. - - Examples: - >>> group_by_until(lambda x: x.id, None, lambda : reactivex.never()) - >>> group_by_until( - lambda x: x.id,lambda x: x.name, lambda grp: reactivex.never() - ) - >>> group_by_until( - lambda x: x.id, - lambda x: x.name, - lambda grp: reactivex.never(), - lambda: ReplaySubject() - ) - - Args: - key_mapper: A function to extract the key for each element. - duration_mapper: A function to signal the expiration of a group. - subject_mapper: A function that returns a subject used to initiate - a grouped observable. Default mapper returns a Subject object. - - Returns: a sequence of observable groups, each of which corresponds to - a unique key value, containing all elements that share that same key - value. If a group's lifetime expires, a new group with the same key - value can be created once an element with such a key value is - encountered. - """ - - element_mapper_ = element_mapper or cast(Mapper[_T, _TValue], identity) - - default_subject_mapper: Callable[[], Subject[_TValue]] = lambda: Subject() - subject_mapper_ = subject_mapper or default_subject_mapper - - def group_by_until( - source: Observable[_T], - ) -> Observable[GroupedObservable[_TKey, _TValue]]: - def subscribe( - observer: abc.ObserverBase[GroupedObservable[_TKey, _TValue]], - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - writers: OrderedDict[_TKey, Subject[_TValue]] = OrderedDict() - group_disposable = CompositeDisposable() - ref_count_disposable = RefCountDisposable(group_disposable) - - def on_next(x: _T) -> None: - writer = None - key = None - - try: - key = key_mapper(x) - except Exception as e: - for wrt in writers.values(): - wrt.on_error(e) - - observer.on_error(e) - return - - fire_new_map_entry = False - writer = writers.get(key) - if not writer: - try: - writer = subject_mapper_() - except Exception as e: - for wrt in writers.values(): - wrt.on_error(e) - - observer.on_error(e) - return - - writers[key] = writer - fire_new_map_entry = True - - if fire_new_map_entry: - group: GroupedObservable[_TKey, _TValue] = GroupedObservable( - key, writer, ref_count_disposable - ) - duration_group: GroupedObservable[_TKey, Any] = GroupedObservable( - key, writer - ) - try: - duration = duration_mapper(duration_group) - except Exception as e: - for wrt in writers.values(): - wrt.on_error(e) - - observer.on_error(e) - return - - observer.on_next(group) - sad = SingleAssignmentDisposable() - group_disposable.add(sad) - - def expire() -> None: - if writers[key]: - del writers[key] - writer.on_completed() - - group_disposable.remove(sad) - - def on_next(value: Any) -> None: - pass - - def on_error(exn: Exception) -> None: - for wrt in writers.values(): - wrt.on_error(exn) - observer.on_error(exn) - - def on_completed() -> None: - expire() - - sad.disposable = duration.pipe( - ops.take(1), - ).subscribe(on_next, on_error, on_completed, scheduler=scheduler) - - try: - element = element_mapper_(x) - except Exception as error: - for wrt in writers.values(): - wrt.on_error(error) - - observer.on_error(error) - return - - writer.on_next(element) - - def on_error(ex: Exception) -> None: - for wrt in writers.values(): - wrt.on_error(ex) - - observer.on_error(ex) - - def on_completed() -> None: - for wrt in writers.values(): - wrt.on_completed() - - observer.on_completed() - - group_disposable.add( - source.subscribe(on_next, on_error, on_completed, scheduler=scheduler) - ) - return ref_count_disposable - - return Observable(subscribe) - - return group_by_until - - -__all__ = ["group_by_until_"] diff --git a/frogpilot/third_party/reactivex/operators/_groupjoin.py b/frogpilot/third_party/reactivex/operators/_groupjoin.py deleted file mode 100644 index 0e4ce00c..00000000 --- a/frogpilot/third_party/reactivex/operators/_groupjoin.py +++ /dev/null @@ -1,178 +0,0 @@ -import logging -from collections import OrderedDict -from typing import Any, Callable, Optional, Tuple, TypeVar - -from reactivex import Observable, abc -from reactivex import operators as ops -from reactivex.disposable import ( - CompositeDisposable, - RefCountDisposable, - SingleAssignmentDisposable, -) -from reactivex.internal import add_ref -from reactivex.subject import Subject - -_TLeft = TypeVar("_TLeft") -_TRight = TypeVar("_TRight") - -log = logging.getLogger("Rx") - - -def group_join_( - right: Observable[_TRight], - left_duration_mapper: Callable[[_TLeft], Observable[Any]], - right_duration_mapper: Callable[[_TRight], Observable[Any]], -) -> Callable[[Observable[_TLeft]], Observable[Tuple[_TLeft, Observable[_TRight]]]]: - """Correlates the elements of two sequences based on overlapping - durations, and groups the results. - - Args: - right: The right observable sequence to join elements for. - left_duration_mapper: A function to select the duration (expressed - as an observable sequence) of each element of the left observable - sequence, used to determine overlap. - right_duration_mapper: A function to select the duration (expressed - as an observable sequence) of each element of the right observable - sequence, used to determine overlap. - - Returns: - An observable sequence that contains elements combined into a tuple - from source elements that have an overlapping duration. - """ - - def nothing(_: Any) -> None: - return None - - def group_join( - left: Observable[_TLeft], - ) -> Observable[Tuple[_TLeft, Observable[_TRight]]]: - def subscribe( - observer: abc.ObserverBase[Tuple[_TLeft, Observable[_TRight]]], - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - group = CompositeDisposable() - rcd = RefCountDisposable(group) - left_map: OrderedDict[int, Subject[_TRight]] = OrderedDict() - right_map: OrderedDict[int, _TRight] = OrderedDict() - left_id = [0] - right_id = [0] - - def on_next_left(value: _TLeft) -> None: - subject: Subject[_TRight] = Subject() - - with left.lock: - _id = left_id[0] - left_id[0] += 1 - left_map[_id] = subject - - try: - result = (value, add_ref(subject, rcd)) - except Exception as e: - log.error("*** Exception: %s" % e) - for left_value in left_map.values(): - left_value.on_error(e) - - observer.on_error(e) - return - - observer.on_next(result) - - for right_value in right_map.values(): - subject.on_next(right_value) - - md = SingleAssignmentDisposable() - group.add(md) - - def expire(): - if _id in left_map: - del left_map[_id] - subject.on_completed() - - group.remove(md) - - try: - duration = left_duration_mapper(value) - except Exception as e: - for left_value in left_map.values(): - left_value.on_error(e) - - observer.on_error(e) - return - - def on_error(error: Exception) -> Any: - for left_value in left_map.values(): - left_value.on_error(error) - - observer.on_error(error) - - md.disposable = duration.pipe(ops.take(1)).subscribe( - nothing, on_error, expire, scheduler=scheduler - ) - - def on_error_left(error: Exception) -> None: - for left_value in left_map.values(): - left_value.on_error(error) - - observer.on_error(error) - - group.add( - left.subscribe( - on_next_left, - on_error_left, - observer.on_completed, - scheduler=scheduler, - ) - ) - - def send_right(value: _TRight) -> None: - with left.lock: - _id = right_id[0] - right_id[0] += 1 - right_map[_id] = value - - md = SingleAssignmentDisposable() - group.add(md) - - def expire(): - del right_map[_id] - group.remove(md) - - try: - duration = right_duration_mapper(value) - except Exception as e: - for left_value in left_map.values(): - left_value.on_error(e) - - observer.on_error(e) - return - - def on_error(error: Exception): - with left.lock: - for left_value in left_map.values(): - left_value.on_error(error) - - observer.on_error(error) - - md.disposable = duration.pipe(ops.take(1)).subscribe( - nothing, on_error, expire, scheduler=scheduler - ) - - with left.lock: - for left_value in left_map.values(): - left_value.on_next(value) - - def on_error_right(error: Exception) -> None: - for left_value in left_map.values(): - left_value.on_error(error) - - observer.on_error(error) - - group.add(right.subscribe(send_right, on_error_right, scheduler=scheduler)) - return rcd - - return Observable(subscribe) - - return group_join - - -__all__ = ["group_join_"] diff --git a/frogpilot/third_party/reactivex/operators/_ignoreelements.py b/frogpilot/third_party/reactivex/operators/_ignoreelements.py deleted file mode 100644 index 16320528..00000000 --- a/frogpilot/third_party/reactivex/operators/_ignoreelements.py +++ /dev/null @@ -1,32 +0,0 @@ -from typing import Callable, Optional, TypeVar - -from reactivex import Observable, abc -from reactivex.internal import noop - -_T = TypeVar("_T") - - -def ignore_elements_() -> Callable[[Observable[_T]], Observable[_T]]: - """Ignores all elements in an observable sequence leaving only the - termination messages. - - Returns: - An empty observable {Observable} sequence that signals - termination, successful or exceptional, of the source sequence. - """ - - def ignore_elements(source: Observable[_T]) -> Observable[_T]: - def subscribe( - observer: abc.ObserverBase[_T], - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - return source.subscribe( - noop, observer.on_error, observer.on_completed, scheduler=scheduler - ) - - return Observable(subscribe) - - return ignore_elements - - -__all__ = ["ignore_elements_"] diff --git a/frogpilot/third_party/reactivex/operators/_isempty.py b/frogpilot/third_party/reactivex/operators/_isempty.py deleted file mode 100644 index 3f5c0153..00000000 --- a/frogpilot/third_party/reactivex/operators/_isempty.py +++ /dev/null @@ -1,24 +0,0 @@ -from typing import Any, Callable - -from reactivex import Observable, compose -from reactivex import operators as ops - - -def is_empty_() -> Callable[[Observable[Any]], Observable[bool]]: - """Determines whether an observable sequence is empty. - - Returns: - An observable sequence containing a single element - determining whether the source sequence is empty. - """ - - def mapper(b: bool) -> bool: - return not b - - return compose( - ops.some(), - ops.map(mapper), - ) - - -__all__ = ["is_empty_"] diff --git a/frogpilot/third_party/reactivex/operators/_join.py b/frogpilot/third_party/reactivex/operators/_join.py deleted file mode 100644 index 05945725..00000000 --- a/frogpilot/third_party/reactivex/operators/_join.py +++ /dev/null @@ -1,144 +0,0 @@ -from collections import OrderedDict -from typing import Any, Callable, Optional, Tuple, TypeVar - -from reactivex import Observable, abc -from reactivex.disposable import CompositeDisposable, SingleAssignmentDisposable -from reactivex.internal import noop -from reactivex.operators import take - -_T1 = TypeVar("_T1") -_T2 = TypeVar("_T2") - - -def join_( - right: Observable[_T2], - left_duration_mapper: Callable[[Any], Observable[Any]], - right_duration_mapper: Callable[[Any], Observable[Any]], -) -> Callable[[Observable[_T1]], Observable[Tuple[_T1, _T2]]]: - def join(source: Observable[_T1]) -> Observable[Tuple[_T1, _T2]]: - """Correlates the elements of two sequences based on - overlapping durations. - - Args: - source: Source observable. - - Return: - An observable sequence that contains elements - combined into a tuple from source elements that have an overlapping - duration. - """ - - left = source - - def subscribe( - observer: abc.ObserverBase[Tuple[_T1, _T2]], - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - group = CompositeDisposable() - left_done = False - left_map: OrderedDict[int, _T1] = OrderedDict() - left_id = 0 - right_done = False - right_map: OrderedDict[int, _T2] = OrderedDict() - right_id = 0 - - def on_next_left(value: _T1): - nonlocal left_id - duration = None - current_id = left_id - left_id += 1 - md = SingleAssignmentDisposable() - - left_map[current_id] = value - group.add(md) - - def expire(): - if current_id in left_map: - del left_map[current_id] - if not len(left_map) and left_done: - observer.on_completed() - - group.remove(md) - - try: - duration = left_duration_mapper(value) - except Exception as exception: - observer.on_error(exception) - return - - md.disposable = duration.pipe(take(1)).subscribe( - noop, observer.on_error, lambda: expire(), scheduler=scheduler - ) - - for val in right_map.values(): - result = (value, val) - observer.on_next(result) - - def on_completed_left() -> None: - nonlocal left_done - left_done = True - if right_done or not len(left_map): - observer.on_completed() - - group.add( - left.subscribe( - on_next_left, - observer.on_error, - on_completed_left, - scheduler=scheduler, - ) - ) - - def on_next_right(value: _T2): - nonlocal right_id - duration = None - current_id = right_id - right_id += 1 - md = SingleAssignmentDisposable() - right_map[current_id] = value - group.add(md) - - def expire(): - if current_id in right_map: - del right_map[current_id] - if not len(right_map) and right_done: - observer.on_completed() - - group.remove(md) - - try: - duration = right_duration_mapper(value) - except Exception as exception: - observer.on_error(exception) - return - - md.disposable = duration.pipe(take(1)).subscribe( - noop, observer.on_error, lambda: expire(), scheduler=scheduler - ) - - for val in left_map.values(): - result = (val, value) - observer.on_next(result) - - def on_completed_right(): - nonlocal right_done - right_done = True - if left_done or not len(right_map): - observer.on_completed() - - group.add( - right.subscribe( - on_next_right, - observer.on_error, - on_completed_right, - scheduler=scheduler, - ) - ) - return group - - return Observable(subscribe) - - return join - - -__all__ = ["join_"] diff --git a/frogpilot/third_party/reactivex/operators/_last.py b/frogpilot/third_party/reactivex/operators/_last.py deleted file mode 100644 index e5441cf7..00000000 --- a/frogpilot/third_party/reactivex/operators/_last.py +++ /dev/null @@ -1,44 +0,0 @@ -from typing import Any, Callable, Optional, TypeVar - -from reactivex import Observable, operators -from reactivex.typing import Predicate - -from ._lastordefault import last_or_default_async - -_T = TypeVar("_T") - - -def last_( - predicate: Optional[Predicate[_T]] = None, -) -> Callable[[Observable[_T]], Observable[Any]]: - def last(source: Observable[_T]) -> Observable[Any]: - """Partially applied last operator. - - Returns the last element of an observable sequence that - satisfies the condition in the predicate if specified, else - the last element. - - Examples: - >>> res = last(source) - - Args: - source: Source observable to get last item from. - - Returns: - An observable sequence containing the last element in the - observable sequence that satisfies the condition in the - predicate. - """ - - if predicate: - return source.pipe( - operators.filter(predicate), - operators.last(), - ) - - return last_or_default_async(source, False) - - return last - - -__all__ = ["last_"] diff --git a/frogpilot/third_party/reactivex/operators/_lastordefault.py b/frogpilot/third_party/reactivex/operators/_lastordefault.py deleted file mode 100644 index 2b3886f8..00000000 --- a/frogpilot/third_party/reactivex/operators/_lastordefault.py +++ /dev/null @@ -1,69 +0,0 @@ -from typing import Any, Callable, Optional, TypeVar - -from reactivex import Observable, abc -from reactivex import operators as ops -from reactivex import typing -from reactivex.internal.exceptions import SequenceContainsNoElementsError - -_T = TypeVar("_T") - - -def last_or_default_async( - source: Observable[_T], - has_default: bool = False, - default_value: Optional[_T] = None, -) -> Observable[Optional[_T]]: - def subscribe( - observer: abc.ObserverBase[Optional[_T]], - scheduler: Optional[abc.SchedulerBase] = None, - ): - value = [default_value] - seen_value = [False] - - def on_next(x: _T) -> None: - value[0] = x - seen_value[0] = True - - def on_completed(): - if not seen_value[0] and not has_default: - observer.on_error(SequenceContainsNoElementsError()) - else: - observer.on_next(value[0]) - observer.on_completed() - - return source.subscribe( - on_next, observer.on_error, on_completed, scheduler=scheduler - ) - - return Observable(subscribe) - - -def last_or_default( - default_value: Optional[_T] = None, predicate: Optional[typing.Predicate[_T]] = None -) -> Callable[[Observable[_T]], Observable[Any]]: - def last_or_default(source: Observable[Any]) -> Observable[Any]: - """Return last or default element. - - Examples: - >>> res = _last_or_default(source) - - Args: - source: Observable sequence to get the last item from. - - Returns: - Observable sequence containing the last element in the - observable sequence. - """ - - if predicate: - return source.pipe( - ops.filter(predicate), - ops.last_or_default(default_value), - ) - - return last_or_default_async(source, True, default_value) - - return last_or_default - - -__all__ = ["last_or_default", "last_or_default_async"] diff --git a/frogpilot/third_party/reactivex/operators/_map.py b/frogpilot/third_party/reactivex/operators/_map.py deleted file mode 100644 index 681a9d10..00000000 --- a/frogpilot/third_party/reactivex/operators/_map.py +++ /dev/null @@ -1,71 +0,0 @@ -from typing import Callable, Optional, TypeVar, cast - -from reactivex import Observable, abc, compose -from reactivex import operators as ops -from reactivex import typing -from reactivex.internal.basic import identity -from reactivex.internal.utils import infinite -from reactivex.typing import Mapper, MapperIndexed - -_T1 = TypeVar("_T1") -_T2 = TypeVar("_T2") - - -def map_( - mapper: Optional[Mapper[_T1, _T2]] = None, -) -> Callable[[Observable[_T1]], Observable[_T2]]: - _mapper = mapper or cast(Mapper[_T1, _T2], identity) - - def map(source: Observable[_T1]) -> Observable[_T2]: - """Partially applied map operator. - - Project each element of an observable sequence into a new form - by incorporating the element's index. - - Example: - >>> map(source) - - Args: - source: The observable source to transform. - - Returns: - Returns an observable sequence whose elements are the - result of invoking the transform function on each element - of the source. - """ - - def subscribe( - obv: abc.ObserverBase[_T2], scheduler: Optional[abc.SchedulerBase] = None - ) -> abc.DisposableBase: - def on_next(value: _T1) -> None: - try: - result = _mapper(value) - except Exception as err: # pylint: disable=broad-except - obv.on_error(err) - else: - obv.on_next(result) - - return source.subscribe( - on_next, obv.on_error, obv.on_completed, scheduler=scheduler - ) - - return Observable(subscribe) - - return map - - -def map_indexed_( - mapper_indexed: Optional[MapperIndexed[_T1, _T2]] = None, -) -> Callable[[Observable[_T1]], Observable[_T2]]: - def _identity(value: _T1, _: int) -> _T2: - return cast(_T2, value) - - _mapper_indexed = mapper_indexed or cast(typing.MapperIndexed[_T1, _T2], _identity) - - return compose( - ops.zip_with_iterable(infinite()), - ops.starmap_indexed(_mapper_indexed), # type: ignore - ) - - -__all__ = ["map_", "map_indexed_"] diff --git a/frogpilot/third_party/reactivex/operators/_materialize.py b/frogpilot/third_party/reactivex/operators/_materialize.py deleted file mode 100644 index 97ad1af3..00000000 --- a/frogpilot/third_party/reactivex/operators/_materialize.py +++ /dev/null @@ -1,48 +0,0 @@ -from typing import Callable, Optional, TypeVar - -from reactivex import Observable, abc -from reactivex.notification import Notification, OnCompleted, OnError, OnNext - -_T = TypeVar("_T") - - -def materialize() -> Callable[[Observable[_T]], Observable[Notification[_T]]]: - def materialize(source: Observable[_T]) -> Observable[Notification[_T]]: - """Partially applied materialize operator. - - Materializes the implicit notifications of an observable - sequence as explicit notification values. - - Args: - source: Source observable to materialize. - - Returns: - An observable sequence containing the materialized - notification values from the source sequence. - """ - - def subscribe( - observer: abc.ObserverBase[Notification[_T]], - scheduler: Optional[abc.SchedulerBase] = None, - ): - def on_next(value: _T) -> None: - observer.on_next(OnNext(value)) - - def on_error(error: Exception) -> None: - observer.on_next(OnError(error)) - observer.on_completed() - - def on_completed() -> None: - observer.on_next(OnCompleted()) - observer.on_completed() - - return source.subscribe( - on_next, on_error, on_completed, scheduler=scheduler - ) - - return Observable(subscribe) - - return materialize - - -__all__ = ["materialize"] diff --git a/frogpilot/third_party/reactivex/operators/_max.py b/frogpilot/third_party/reactivex/operators/_max.py deleted file mode 100644 index 287d5fb7..00000000 --- a/frogpilot/third_party/reactivex/operators/_max.py +++ /dev/null @@ -1,37 +0,0 @@ -from typing import Callable, Optional, TypeVar, cast - -from reactivex import Observable, compose -from reactivex import operators as ops -from reactivex.internal.basic import identity -from reactivex.typing import Comparer - -from ._min import first_only - -_T = TypeVar("_T") - - -def max_( - comparer: Optional[Comparer[_T]] = None, -) -> Callable[[Observable[_T]], Observable[_T]]: - """Returns the maximum value in an observable sequence according to - the specified comparer. - - Examples: - >>> op = max() - >>> op = max(lambda x, y: x.value - y.value) - - Args: - comparer: [Optional] Comparer used to compare elements. - - Returns: - An operator function that takes an observable source and returns - an observable sequence containing a single element with the - maximum element in the source sequence. - """ - return compose( - ops.max_by(cast(Callable[[_T], _T], identity), comparer), - ops.map(first_only), - ) - - -__all__ = ["max_"] diff --git a/frogpilot/third_party/reactivex/operators/_maxby.py b/frogpilot/third_party/reactivex/operators/_maxby.py deleted file mode 100644 index c83ad849..00000000 --- a/frogpilot/third_party/reactivex/operators/_maxby.py +++ /dev/null @@ -1,40 +0,0 @@ -from typing import Callable, List, Optional, TypeVar - -from reactivex import Observable, typing -from reactivex.internal.basic import default_sub_comparer - -from ._minby import extrema_by - -_T = TypeVar("_T") -_TKey = TypeVar("_TKey") - - -def max_by_( - key_mapper: typing.Mapper[_T, _TKey], - comparer: Optional[typing.SubComparer[_TKey]] = None, -) -> Callable[[Observable[_T]], Observable[List[_T]]]: - - cmp = comparer or default_sub_comparer - - def max_by(source: Observable[_T]) -> Observable[List[_T]]: - """Partially applied max_by operator. - - Returns the elements in an observable sequence with the maximum - key value. - - Examples: - >>> res = max_by(source) - - Args: - source: The source observable sequence to. - - Returns: - An observable sequence containing a list of zero or more - elements that have a maximum key value. - """ - return extrema_by(source, key_mapper, cmp) - - return max_by - - -__all__ = ["max_by_"] diff --git a/frogpilot/third_party/reactivex/operators/_merge.py b/frogpilot/third_party/reactivex/operators/_merge.py deleted file mode 100644 index 30ecf061..00000000 --- a/frogpilot/third_party/reactivex/operators/_merge.py +++ /dev/null @@ -1,153 +0,0 @@ -from asyncio import Future -from typing import Callable, List, Optional, TypeVar, Union - -import reactivex -from reactivex import Observable, abc, from_future, typing -from reactivex.disposable import CompositeDisposable, SingleAssignmentDisposable -from reactivex.internal import synchronized - -_T = TypeVar("_T") - - -def merge_( - *sources: Observable[_T], max_concurrent: Optional[int] = None -) -> Callable[[Observable[Observable[_T]]], Observable[_T]]: - def merge(source: Observable[Observable[_T]]) -> Observable[_T]: - """Merges an observable sequence of observable sequences into - an observable sequence, limiting the number of concurrent - subscriptions to inner sequences. Or merges two observable - sequences into a single observable sequence. - - Examples: - >>> res = merge(sources) - - Args: - source: Source observable. - - Returns: - The observable sequence that merges the elements of the - inner sequences. - """ - - if max_concurrent is None: - sources_ = tuple([source]) + sources - return reactivex.merge(*sources_) - - def subscribe( - observer: abc.ObserverBase[_T], - scheduler: Optional[abc.SchedulerBase] = None, - ): - active_count = [0] - group = CompositeDisposable() - is_stopped = [False] - queue: List[Observable[_T]] = [] - - def subscribe(xs: Observable[_T]): - subscription = SingleAssignmentDisposable() - group.add(subscription) - - @synchronized(source.lock) - def on_completed(): - group.remove(subscription) - if queue: - s = queue.pop(0) - subscribe(s) - else: - active_count[0] -= 1 - if is_stopped[0] and active_count[0] == 0: - observer.on_completed() - - on_next = synchronized(source.lock)(observer.on_next) - on_error = synchronized(source.lock)(observer.on_error) - subscription.disposable = xs.subscribe( - on_next, on_error, on_completed, scheduler=scheduler - ) - - def on_next(inner_source: Observable[_T]) -> None: - assert max_concurrent - if active_count[0] < max_concurrent: - active_count[0] += 1 - subscribe(inner_source) - else: - queue.append(inner_source) - - def on_completed(): - is_stopped[0] = True - if active_count[0] == 0: - observer.on_completed() - - group.add( - source.subscribe( - on_next, observer.on_error, on_completed, scheduler=scheduler - ) - ) - return group - - return Observable(subscribe) - - return merge - - -def merge_all_() -> Callable[[Observable[Observable[_T]]], Observable[_T]]: - def merge_all(source: Observable[Observable[_T]]) -> Observable[_T]: - """Partially applied merge_all operator. - - Merges an observable sequence of observable sequences into an - observable sequence. - - Args: - source: Source observable to merge. - - Returns: - The observable sequence that merges the elements of the inner - sequences. - """ - - def subscribe( - observer: abc.ObserverBase[_T], - scheduler: Optional[abc.SchedulerBase] = None, - ): - group = CompositeDisposable() - is_stopped = [False] - m = SingleAssignmentDisposable() - group.add(m) - - def on_next(inner_source: Union[Observable[_T], "Future[_T]"]): - inner_subscription = SingleAssignmentDisposable() - group.add(inner_subscription) - - inner_source = ( - from_future(inner_source) - if isinstance(inner_source, Future) - else inner_source - ) - - @synchronized(source.lock) - def on_completed(): - group.remove(inner_subscription) - if is_stopped[0] and len(group) == 1: - observer.on_completed() - - on_next: typing.OnNext[_T] = synchronized(source.lock)(observer.on_next) - on_error = synchronized(source.lock)(observer.on_error) - subscription = inner_source.subscribe( - on_next, on_error, on_completed, scheduler=scheduler - ) - inner_subscription.disposable = subscription - - def on_completed(): - is_stopped[0] = True - if len(group) == 1: - observer.on_completed() - - m.disposable = source.subscribe( - on_next, observer.on_error, on_completed, scheduler=scheduler - ) - return group - - return Observable(subscribe) - - return merge_all - - -__all__ = ["merge_", "merge_all_"] diff --git a/frogpilot/third_party/reactivex/operators/_min.py b/frogpilot/third_party/reactivex/operators/_min.py deleted file mode 100644 index 85a89c8d..00000000 --- a/frogpilot/third_party/reactivex/operators/_min.py +++ /dev/null @@ -1,44 +0,0 @@ -from typing import Callable, List, Optional, TypeVar, cast - -from reactivex import Observable, compose -from reactivex import operators as ops -from reactivex.internal.basic import identity -from reactivex.internal.exceptions import SequenceContainsNoElementsError -from reactivex.typing import Comparer - -_T = TypeVar("_T") - - -def first_only(x: List[_T]) -> _T: - if not x: - raise SequenceContainsNoElementsError() - - return x[0] - - -def min_( - comparer: Optional[Comparer[_T]] = None, -) -> Callable[[Observable[_T]], Observable[_T]]: - """The `min` operator. - - Returns the minimum element in an observable sequence according to - the optional comparer else a default greater than less than check. - - Examples: - >>> res = source.min() - >>> res = source.min(lambda x, y: x.value - y.value) - - Args: - comparer: [Optional] Comparer used to compare elements. - - Returns: - An observable sequence containing a single element - with the minimum element in the source sequence. - """ - return compose( - ops.min_by(cast(Callable[[_T], _T], identity), comparer), - ops.map(first_only), - ) - - -__all__ = ["min_"] diff --git a/frogpilot/third_party/reactivex/operators/_minby.py b/frogpilot/third_party/reactivex/operators/_minby.py deleted file mode 100644 index ff07d4e9..00000000 --- a/frogpilot/third_party/reactivex/operators/_minby.py +++ /dev/null @@ -1,91 +0,0 @@ -from typing import Callable, List, Optional, TypeVar, cast - -from reactivex import Observable, abc, typing -from reactivex.internal.basic import default_sub_comparer - -_T = TypeVar("_T") -_TKey = TypeVar("_TKey") - - -def extrema_by( - source: Observable[_T], - key_mapper: typing.Mapper[_T, _TKey], - comparer: typing.SubComparer[_TKey], -) -> Observable[List[_T]]: - def subscribe( - observer: abc.ObserverBase[List[_T]], - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - has_value = False - last_key: _TKey = cast(_TKey, None) - items: List[_T] = [] - - def on_next(x: _T) -> None: - nonlocal has_value, last_key - try: - key = key_mapper(x) - except Exception as ex: - observer.on_error(ex) - return - - comparison = 0 - - if not has_value: - has_value = True - last_key = key - else: - try: - comparison = comparer(key, last_key) - except Exception as ex1: - observer.on_error(ex1) - return - - if comparison > 0: - last_key = key - items[:] = [] - - if comparison >= 0: - items.append(x) - - def on_completed(): - observer.on_next(items) - observer.on_completed() - - return source.subscribe( - on_next, observer.on_error, on_completed, scheduler=scheduler - ) - - return Observable(subscribe) - - -def min_by_( - key_mapper: typing.Mapper[_T, _TKey], - comparer: Optional[typing.SubComparer[_TKey]] = None, -) -> Callable[[Observable[_T]], Observable[List[_T]]]: - """The `min_by` operator. - - Returns the elements in an observable sequence with the minimum key - value according to the specified comparer. - - Examples: - >>> res = min_by(lambda x: x.value) - >>> res = min_by(lambda x: x.value, lambda x, y: x - y) - - Args: - key_mapper: Key mapper function. - comparer: [Optional] Comparer used to compare key values. - - Returns: - An observable sequence containing a list of zero or more - elements that have a minimum key value. - """ - - cmp = comparer or default_sub_comparer - - def min_by(source: Observable[_T]) -> Observable[List[_T]]: - return extrema_by(source, key_mapper, lambda x, y: -cmp(x, y)) - - return min_by - - -__all__ = ["min_by_"] diff --git a/frogpilot/third_party/reactivex/operators/_multicast.py b/frogpilot/third_party/reactivex/operators/_multicast.py deleted file mode 100644 index ebae2c0b..00000000 --- a/frogpilot/third_party/reactivex/operators/_multicast.py +++ /dev/null @@ -1,78 +0,0 @@ -from typing import Callable, Optional, TypeVar, Union - -from reactivex import ConnectableObservable, Observable, abc -from reactivex import operators as ops -from reactivex.disposable import CompositeDisposable - -_TSource = TypeVar("_TSource") -_TResult = TypeVar("_TResult") - - -def multicast_( - subject: Optional[abc.SubjectBase[_TSource]] = None, - *, - subject_factory: Optional[ - Callable[[Optional[abc.SchedulerBase]], abc.SubjectBase[_TSource]] - ] = None, - mapper: Optional[Callable[[Observable[_TSource]], Observable[_TResult]]] = None, -) -> Callable[ - [Observable[_TSource]], Union[Observable[_TResult], ConnectableObservable[_TSource]] -]: - """Multicasts the source sequence notifications through an - instantiated subject into all uses of the sequence within a mapper - function. Each subscription to the resulting sequence causes a - separate multicast invocation, exposing the sequence resulting from - the mapper function's invocation. For specializations with fixed - subject types, see Publish, PublishLast, and Replay. - - Examples: - >>> res = multicast(observable) - >>> res = multicast( - subject_factory=lambda scheduler: Subject(), - mapper=lambda x: x - ) - - Args: - subject_factory: Factory function to create an intermediate - subject through which the source sequence's elements will be - multicast to the mapper function. - subject: Subject to push source elements into. - mapper: [Optional] Mapper function which can use the - multicasted source sequence subject to the policies enforced - by the created subject. Specified only if subject_factory" - is a factory function. - - Returns: - An observable sequence that contains the elements of a sequence - produced by multicasting the source sequence within a mapper - function. - """ - - def multicast( - source: Observable[_TSource], - ) -> Union[Observable[_TResult], ConnectableObservable[_TSource]]: - if subject_factory: - - def subscribe( - observer: abc.ObserverBase[_TResult], - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - assert subject_factory - connectable = source.pipe( - ops.multicast(subject=subject_factory(scheduler)) - ) - assert mapper - subscription = mapper(connectable).subscribe( - observer, scheduler=scheduler - ) - - return CompositeDisposable(subscription, connectable.connect(scheduler)) - - return Observable(subscribe) - - if not subject: - raise ValueError("multicast: Subject cannot be None") - ret: ConnectableObservable[_TSource] = ConnectableObservable(source, subject) - return ret - - return multicast diff --git a/frogpilot/third_party/reactivex/operators/_observeon.py b/frogpilot/third_party/reactivex/operators/_observeon.py deleted file mode 100644 index 22362e6e..00000000 --- a/frogpilot/third_party/reactivex/operators/_observeon.py +++ /dev/null @@ -1,43 +0,0 @@ -from typing import Callable, Optional, TypeVar - -from reactivex import Observable, abc -from reactivex.observer import ObserveOnObserver - -_T = TypeVar("_T") - - -def observe_on_( - scheduler: abc.SchedulerBase, -) -> Callable[[Observable[_T]], Observable[_T]]: - def observe_on(source: Observable[_T]) -> Observable[_T]: - """Wraps the source sequence in order to run its observer - callbacks on the specified scheduler. - - This only invokes observer callbacks on a scheduler. In case - the subscription and/or unsubscription actions have - side-effects that require to be run on a scheduler, use - subscribe_on. - - Args: - source: Source observable. - - - Returns: - Returns the source sequence whose observations happen on - the specified scheduler. - """ - - def subscribe( - observer: abc.ObserverBase[_T], - subscribe_scheduler: Optional[abc.SchedulerBase] = None, - ): - return source.subscribe( - ObserveOnObserver(scheduler, observer), scheduler=subscribe_scheduler - ) - - return Observable(subscribe) - - return observe_on - - -__all__ = ["observe_on_"] diff --git a/frogpilot/third_party/reactivex/operators/_onerrorresumenext.py b/frogpilot/third_party/reactivex/operators/_onerrorresumenext.py deleted file mode 100644 index bafcd714..00000000 --- a/frogpilot/third_party/reactivex/operators/_onerrorresumenext.py +++ /dev/null @@ -1,18 +0,0 @@ -from typing import Callable, TypeVar - -import reactivex -from reactivex import Observable - -_T = TypeVar("_T") - - -def on_error_resume_next_( - second: Observable[_T], -) -> Callable[[Observable[_T]], Observable[_T]]: - def on_error_resume_next(source: Observable[_T]) -> Observable[_T]: - return reactivex.on_error_resume_next(source, second) - - return on_error_resume_next - - -__all__ = ["on_error_resume_next_"] diff --git a/frogpilot/third_party/reactivex/operators/_pairwise.py b/frogpilot/third_party/reactivex/operators/_pairwise.py deleted file mode 100644 index a5b3af93..00000000 --- a/frogpilot/third_party/reactivex/operators/_pairwise.py +++ /dev/null @@ -1,53 +0,0 @@ -from typing import Callable, Optional, Tuple, TypeVar, cast - -from reactivex import Observable, abc - -_T = TypeVar("_T") - - -def pairwise_() -> Callable[[Observable[_T]], Observable[Tuple[_T, _T]]]: - def pairwise(source: Observable[_T]) -> Observable[Tuple[_T, _T]]: - """Partially applied pairwise operator. - - Returns a new observable that triggers on the second and - subsequent triggerings of the input observable. The Nth - triggering of the input observable passes the arguments from - the N-1th and Nth triggering as a pair. The argument passed to - the N-1th triggering is held in hidden internal state until the - Nth triggering occurs. - - Returns: - An observable that triggers on successive pairs of - observations from the input observable as an array. - """ - - def subscribe( - observer: abc.ObserverBase[Tuple[_T, _T]], - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - has_previous = False - previous: _T = cast(_T, None) - - def on_next(x: _T) -> None: - nonlocal has_previous, previous - pair = None - - with source.lock: - if has_previous: - pair = (previous, x) - else: - has_previous = True - - previous = x - - if pair: - observer.on_next(pair) - - return source.subscribe(on_next, observer.on_error, observer.on_completed) - - return Observable(subscribe) - - return pairwise - - -__all__ = ["pairwise_"] diff --git a/frogpilot/third_party/reactivex/operators/_partition.py b/frogpilot/third_party/reactivex/operators/_partition.py deleted file mode 100644 index 26b03296..00000000 --- a/frogpilot/third_party/reactivex/operators/_partition.py +++ /dev/null @@ -1,88 +0,0 @@ -from typing import Callable, List, TypeVar - -from reactivex import Observable -from reactivex import operators as ops -from reactivex.typing import Predicate, PredicateIndexed - -_T = TypeVar("_T") - - -def partition_( - predicate: Predicate[_T], -) -> Callable[[Observable[_T]], List[Observable[_T]]]: - def partition(source: Observable[_T]) -> List[Observable[_T]]: - """The partially applied `partition` operator. - - Returns two observables which partition the observations of the - source by the given function. The first will trigger - observations for those values for which the predicate returns - true. The second will trigger observations for those values - where the predicate returns false. The predicate is executed - once for each subscribed observer. Both also propagate all - error observations arising from the source and each completes - when the source completes. - - Args: - source: Source observable to partition. - - Returns: - A list of observables. The first triggers when the - predicate returns True, and the second triggers when the - predicate returns False. - """ - - def not_predicate(x: _T) -> bool: - return not predicate(x) - - published = source.pipe( - ops.publish(), - ops.ref_count(), - ) - return [ - published.pipe(ops.filter(predicate)), - published.pipe(ops.filter(not_predicate)), - ] - - return partition - - -def partition_indexed_( - predicate_indexed: PredicateIndexed[_T], -) -> Callable[[Observable[_T]], List[Observable[_T]]]: - def partition_indexed(source: Observable[_T]) -> List[Observable[_T]]: - """The partially applied indexed partition operator. - - Returns two observables which partition the observations of the - source by the given function. The first will trigger - observations for those values for which the predicate returns - true. The second will trigger observations for those values - where the predicate returns false. The predicate is executed - once for each subscribed observer. Both also propagate all - error observations arising from the source and each completes - when the source completes. - - Args: - source: Source observable to partition. - - Returns: - A list of observables. The first triggers when the - predicate returns True, and the second triggers when the - predicate returns False. - """ - - def not_predicate_indexed(x: _T, i: int) -> bool: - return not predicate_indexed(x, i) - - published = source.pipe( - ops.publish(), - ops.ref_count(), - ) - return [ - published.pipe(ops.filter_indexed(predicate_indexed)), - published.pipe(ops.filter_indexed(not_predicate_indexed)), - ] - - return partition_indexed - - -__all__ = ["partition_", "partition_indexed_"] diff --git a/frogpilot/third_party/reactivex/operators/_pluck.py b/frogpilot/third_party/reactivex/operators/_pluck.py deleted file mode 100644 index 04cf7b66..00000000 --- a/frogpilot/third_party/reactivex/operators/_pluck.py +++ /dev/null @@ -1,46 +0,0 @@ -from typing import Any, Callable, Dict, TypeVar - -from reactivex import Observable -from reactivex import operators as ops - -_TKey = TypeVar("_TKey") -_TValue = TypeVar("_TValue") - - -def pluck_( - key: _TKey, -) -> Callable[[Observable[Dict[_TKey, _TValue]]], Observable[_TValue]]: - """Retrieves the value of a specified key using dict-like access (as in - element[key]) from all elements in the Observable sequence. - - Args: - key: The key to pluck. - - Returns a new Observable {Observable} sequence of key values. - - To pluck an attribute of each element, use pluck_attr. - """ - - def mapper(x: Dict[_TKey, _TValue]) -> _TValue: - return x[key] - - return ops.map(mapper) - - -def pluck_attr_(prop: str) -> Callable[[Observable[Any]], Observable[Any]]: - """Retrieves the value of a specified property (using getattr) from - all elements in the Observable sequence. - - Args: - property: The property to pluck. - - Returns a new Observable {Observable} sequence of property values. - - To pluck values using dict-like access (as in element[key]) on each - element, use pluck. - """ - - return ops.map(lambda x: getattr(x, prop)) - - -__all__ = ["pluck_", "pluck_attr_"] diff --git a/frogpilot/third_party/reactivex/operators/_publish.py b/frogpilot/third_party/reactivex/operators/_publish.py deleted file mode 100644 index 4a99adfb..00000000 --- a/frogpilot/third_party/reactivex/operators/_publish.py +++ /dev/null @@ -1,66 +0,0 @@ -from typing import Callable, Optional, TypeVar, Union - -from reactivex import ConnectableObservable, Observable, abc, compose -from reactivex import operators as ops -from reactivex.subject import Subject -from reactivex.typing import Mapper - -_TSource = TypeVar("_TSource") -_TResult = TypeVar("_TResult") - - -def publish_( - mapper: Optional[Mapper[Observable[_TSource], Observable[_TResult]]] = None, -) -> Callable[ - [Observable[_TSource]], Union[Observable[_TResult], ConnectableObservable[_TSource]] -]: - """Returns an observable sequence that is the result of invoking the - mapper on a connectable observable sequence that shares a single - subscription to the underlying sequence. This operator is a - specialization of Multicast using a regular Subject. - - Example: - >>> res = publish() - >>> res = publish(lambda x: x) - - mapper: [Optional] Selector function which can use the - multicasted source sequence as many times as needed, without causing - multiple subscriptions to the source sequence. Subscribers to the - given source will receive all notifications of the source from the - time of the subscription on. - - Returns: - An observable sequence that contains the elements of a sequence - produced by multicasting the source sequence within a mapper - function. - """ - - if mapper: - - def factory(scheduler: Optional[abc.SchedulerBase] = None) -> Subject[_TSource]: - return Subject() - - return ops.multicast(subject_factory=factory, mapper=mapper) - - subject: Subject[_TSource] = Subject() - return ops.multicast(subject=subject) - - -def share_() -> Callable[[Observable[_TSource]], Observable[_TSource]]: - """Share a single subscription among multple observers. - - Returns a new Observable that multicasts (shares) the original - Observable. As long as there is at least one Subscriber this - Observable will be subscribed and emitting data. When all - subscribers have unsubscribed it will unsubscribe from the source - Observable. - - This is an alias for a composed publish() and ref_count(). - """ - return compose( - ops.publish(), - ops.ref_count(), - ) - - -__all__ = ["publish_", "share_"] diff --git a/frogpilot/third_party/reactivex/operators/_publishvalue.py b/frogpilot/third_party/reactivex/operators/_publishvalue.py deleted file mode 100644 index 8ade6542..00000000 --- a/frogpilot/third_party/reactivex/operators/_publishvalue.py +++ /dev/null @@ -1,32 +0,0 @@ -from typing import Callable, Optional, TypeVar, Union - -from reactivex import ConnectableObservable, Observable, abc -from reactivex import operators as ops -from reactivex.subject import BehaviorSubject -from reactivex.typing import Mapper - -_T1 = TypeVar("_T1") -_T2 = TypeVar("_T2") - - -def publish_value_( - initial_value: _T1, - mapper: Optional[Mapper[Observable[_T1], Observable[_T2]]] = None, -) -> Union[ - Callable[[Observable[_T1]], ConnectableObservable[_T1]], - Callable[[Observable[_T1]], Observable[_T2]], -]: - if mapper: - - def subject_factory( - scheduler: Optional[abc.SchedulerBase] = None, - ) -> BehaviorSubject[_T1]: - return BehaviorSubject(initial_value) - - return ops.multicast(subject_factory=subject_factory, mapper=mapper) - - subject = BehaviorSubject(initial_value) - return ops.multicast(subject) - - -__all__ = ["publish_value_"] diff --git a/frogpilot/third_party/reactivex/operators/_reduce.py b/frogpilot/third_party/reactivex/operators/_reduce.py deleted file mode 100644 index 8238ea96..00000000 --- a/frogpilot/third_party/reactivex/operators/_reduce.py +++ /dev/null @@ -1,51 +0,0 @@ -from typing import Any, Callable, Type, TypeVar, Union, cast - -from reactivex import Observable, compose -from reactivex import operators as ops -from reactivex.internal.utils import NotSet -from reactivex.typing import Accumulator - -_T = TypeVar("_T") -_TState = TypeVar("_TState") - - -def reduce_( - accumulator: Accumulator[_TState, _T], seed: Union[_TState, Type[NotSet]] = NotSet -) -> Callable[[Observable[_T]], Observable[Any]]: - """Applies an accumulator function over an observable sequence, - returning the result of the aggregation as a single element in the - result sequence. The specified seed value is used as the initial - accumulator value. - - For aggregation behavior with incremental intermediate results, see - `scan()`. - - Examples: - >>> res = reduce(lambda acc, x: acc + x) - >>> res = reduce(lambda acc, x: acc + x, 0) - - Args: - accumulator: An accumulator function to be - invoked on each element. - seed: Optional initial accumulator value. - - Returns: - An operator function that takes an observable source and returns - an observable sequence containing a single element with the - final accumulator value. - """ - if seed is not NotSet: - seed_: _TState = cast(_TState, seed) - scanner = ops.scan(accumulator, seed=seed_) - return compose( - scanner, - ops.last_or_default(default_value=seed_), - ) - - return compose( - ops.scan(cast(Accumulator[_T, _T], accumulator)), - ops.last(), - ) - - -__all__ = ["reduce_"] diff --git a/frogpilot/third_party/reactivex/operators/_repeat.py b/frogpilot/third_party/reactivex/operators/_repeat.py deleted file mode 100644 index 9d1ff8bd..00000000 --- a/frogpilot/third_party/reactivex/operators/_repeat.py +++ /dev/null @@ -1,42 +0,0 @@ -from typing import Callable, Optional, TypeVar - -import reactivex -from reactivex import Observable -from reactivex.internal.utils import infinite - -_T = TypeVar("_T") - - -def repeat_( - repeat_count: Optional[int] = None, -) -> Callable[[Observable[_T]], Observable[_T]]: - def repeat(source: Observable[_T]) -> Observable[_T]: - """Repeats the observable sequence a specified number of times. - If the repeat count is not specified, the sequence repeats - indefinitely. - - Examples: - >>> repeated = source.repeat() - >>> repeated = source.repeat(42) - - Args: - source: The observable source to repeat. - - Returns: - The observable sequence producing the elements of the given - sequence repeatedly. - """ - - if repeat_count is None: - gen = infinite() - else: - gen = range(repeat_count) - - return reactivex.defer( - lambda _: reactivex.concat_with_iterable(source for _ in gen) - ) - - return repeat - - -__all = ["repeat"] diff --git a/frogpilot/third_party/reactivex/operators/_replay.py b/frogpilot/third_party/reactivex/operators/_replay.py deleted file mode 100644 index 67a271fa..00000000 --- a/frogpilot/third_party/reactivex/operators/_replay.py +++ /dev/null @@ -1,64 +0,0 @@ -from typing import Callable, Optional, TypeVar, Union - -from reactivex import ConnectableObservable, Observable, abc -from reactivex import operators as ops -from reactivex import typing -from reactivex.subject import ReplaySubject -from reactivex.typing import Mapper - -_TSource = TypeVar("_TSource") -_TResult = TypeVar("_TResult") - - -def replay_( - mapper: Optional[Mapper[Observable[_TSource], Observable[_TResult]]] = None, - buffer_size: Optional[int] = None, - window: Optional[typing.RelativeTime] = None, - scheduler: Optional[abc.SchedulerBase] = None, -) -> Callable[ - [Observable[_TSource]], Union[Observable[_TResult], ConnectableObservable[_TSource]] -]: - """Returns an observable sequence that is the result of invoking the - mapper on a connectable observable sequence that shares a single - subscription to the underlying sequence replaying notifications - subject to a maximum time length for the replay buffer. - - This operator is a specialization of Multicast using a - ReplaySubject. - - Examples: - >>> res = replay(buffer_size=3) - >>> res = replay(buffer_size=3, window=500) - >>> res = replay(None, 3, 500) - >>> res = replay(lambda x: x.take(6).repeat(), 3, 500) - - Args: - mapper: [Optional] Selector function which can use the multicasted - source sequence as many times as needed, without causing - multiple subscriptions to the source sequence. Subscribers to - the given source will receive all the notifications of the - source subject to the specified replay buffer trimming policy. - buffer_size: [Optional] Maximum element count of the replay - buffer. - window: [Optional] Maximum time length of the replay buffer. - scheduler: [Optional] Scheduler the observers are invoked on. - - Returns: - An observable sequence that contains the elements of a - sequence produced by multicasting the source sequence within a - mapper function. - """ - - if mapper: - - def subject_factory( - scheduler: Optional[abc.SchedulerBase] = None, - ) -> ReplaySubject[_TSource]: - return ReplaySubject(buffer_size, window, scheduler) - - return ops.multicast(subject_factory=subject_factory, mapper=mapper) - rs: ReplaySubject[_TSource] = ReplaySubject(buffer_size, window, scheduler) - return ops.multicast(subject=rs) - - -__all__ = ["replay_"] diff --git a/frogpilot/third_party/reactivex/operators/_retry.py b/frogpilot/third_party/reactivex/operators/_retry.py deleted file mode 100644 index 8cc50605..00000000 --- a/frogpilot/third_party/reactivex/operators/_retry.py +++ /dev/null @@ -1,41 +0,0 @@ -from typing import Callable, Optional, TypeVar - -import reactivex -from reactivex import Observable -from reactivex.internal.utils import infinite - -_T = TypeVar("_T") - - -def retry_( - retry_count: Optional[int] = None, -) -> Callable[[Observable[_T]], Observable[_T]]: - """Repeats the source observable sequence the specified number of - times or until it successfully terminates. If the retry count is - not specified, it retries indefinitely. - - Examples: - >>> retried = retry() - >>> retried = retry(42) - - Args: - retry_count: [Optional] Number of times to retry the sequence. - If not provided, retry the sequence indefinitely. - - Returns: - An observable sequence producing the elements of the given - sequence repeatedly until it terminates successfully. - """ - - if retry_count is None: - gen = infinite() - else: - gen = range(retry_count) - - def retry(source: Observable[_T]) -> Observable[_T]: - return reactivex.catch_with_iterable(source for _ in gen) - - return retry - - -__all__ = ["retry_"] diff --git a/frogpilot/third_party/reactivex/operators/_sample.py b/frogpilot/third_party/reactivex/operators/_sample.py deleted file mode 100644 index 07dc259c..00000000 --- a/frogpilot/third_party/reactivex/operators/_sample.py +++ /dev/null @@ -1,80 +0,0 @@ -from typing import Any, Callable, Optional, TypeVar, Union, cast - -import reactivex -from reactivex import Observable, abc, typing -from reactivex.disposable import CompositeDisposable - -_T = TypeVar("_T") - - -def sample_observable( - source: Observable[_T], sampler: Observable[Any] -) -> Observable[_T]: - def subscribe( - observer: abc.ObserverBase[_T], scheduler: Optional[abc.SchedulerBase] = None - ): - at_end = False - has_value = False - value: _T = cast(_T, None) - - def sample_subscribe(_: Any = None) -> None: - nonlocal has_value - if has_value: - has_value = False - observer.on_next(value) - - if at_end: - observer.on_completed() - - def on_next(new_value: _T): - nonlocal has_value, value - has_value = True - value = new_value - - def on_completed(): - nonlocal at_end - at_end = True - - return CompositeDisposable( - source.subscribe( - on_next, observer.on_error, on_completed, scheduler=scheduler - ), - sampler.subscribe( - sample_subscribe, - observer.on_error, - sample_subscribe, - scheduler=scheduler, - ), - ) - - return Observable(subscribe) - - -def sample_( - sampler: Union[typing.RelativeTime, Observable[Any]], - scheduler: Optional[abc.SchedulerBase] = None, -) -> Callable[[Observable[_T]], Observable[_T]]: - def sample(source: Observable[_T]) -> Observable[_T]: - """Samples the observable sequence at each interval. - - Examples: - >>> res = sample(source) - - Args: - source: Source sequence to sample. - - Returns: - Sampled observable sequence. - """ - - if isinstance(sampler, abc.ObservableBase): - return sample_observable(source, sampler) - else: - return sample_observable( - source, reactivex.interval(sampler, scheduler=scheduler) - ) - - return sample - - -__all__ = ["sample_"] diff --git a/frogpilot/third_party/reactivex/operators/_scan.py b/frogpilot/third_party/reactivex/operators/_scan.py deleted file mode 100644 index bcf067f0..00000000 --- a/frogpilot/third_party/reactivex/operators/_scan.py +++ /dev/null @@ -1,60 +0,0 @@ -from typing import Callable, Type, TypeVar, Union, cast - -from reactivex import Observable, abc, defer -from reactivex import operators as ops -from reactivex.internal.utils import NotSet -from reactivex.typing import Accumulator - -_T = TypeVar("_T") -_TState = TypeVar("_TState") - - -def scan_( - accumulator: Accumulator[_TState, _T], seed: Union[_TState, Type[NotSet]] = NotSet -) -> Callable[[Observable[_T]], Observable[_TState]]: - has_seed = seed is not NotSet - - def scan(source: Observable[_T]) -> Observable[_TState]: - """Partially applied scan operator. - - Applies an accumulator function over an observable sequence and - returns each intermediate result. - - Examples: - >>> scanned = scan(source) - - Args: - source: The observable source to scan. - - Returns: - An observable sequence containing the accumulated values. - """ - - def factory(scheduler: abc.SchedulerBase) -> Observable[_TState]: - has_accumulation = False - accumulation: _TState = cast(_TState, None) - - def projection(x: _T) -> _TState: - nonlocal has_accumulation - nonlocal accumulation - - if has_accumulation: - accumulation = accumulator(accumulation, x) - else: - accumulation = ( - accumulator(cast(_TState, seed), x) - if has_seed - else cast(_TState, x) - ) - has_accumulation = True - - return accumulation - - return source.pipe(ops.map(projection)) - - return defer(factory) - - return scan - - -__all__ = ["scan_"] diff --git a/frogpilot/third_party/reactivex/operators/_sequenceequal.py b/frogpilot/third_party/reactivex/operators/_sequenceequal.py deleted file mode 100644 index a3019d6a..00000000 --- a/frogpilot/third_party/reactivex/operators/_sequenceequal.py +++ /dev/null @@ -1,124 +0,0 @@ -from typing import Callable, Iterable, List, Optional, TypeVar, Union - -import reactivex -from reactivex import Observable, abc, typing -from reactivex.disposable import CompositeDisposable -from reactivex.internal import default_comparer - -_T = TypeVar("_T") - - -def sequence_equal_( - second: Union[Observable[_T], Iterable[_T]], - comparer: Optional[typing.Comparer[_T]] = None, -) -> Callable[[Observable[_T]], Observable[bool]]: - comparer_ = comparer or default_comparer - second_ = ( - reactivex.from_iterable(second) if isinstance(second, Iterable) else second - ) - - def sequence_equal(source: Observable[_T]) -> Observable[bool]: - """Determines whether two sequences are equal by comparing the - elements pairwise using a specified equality comparer. - - Examples: - >>> res = sequence_equal([1,2,3]) - >>> res = sequence_equal([{ "value": 42 }], lambda x, y: x.value == y.value) - >>> res = sequence_equal(reactivex.return_value(42)) - >>> res = sequence_equal( - reactivex.return_value({ "value": 42 }), - lambda x, y: x.value == y.value - ) - - Args: - source: Source observable to compare. - - Returns: - An observable sequence that contains a single element which - indicates whether both sequences are of equal length and their - corresponding elements are equal according to the specified - equality comparer. - """ - first = source - - def subscribe( - observer: abc.ObserverBase[bool], - scheduler: Optional[abc.SchedulerBase] = None, - ): - donel = [False] - doner = [False] - ql: List[_T] = [] - qr: List[_T] = [] - - def on_next1(x: _T) -> None: - if len(qr) > 0: - v = qr.pop(0) - try: - equal = comparer_(v, x) - except Exception as e: - observer.on_error(e) - return - - if not equal: - observer.on_next(False) - observer.on_completed() - - elif doner[0]: - observer.on_next(False) - observer.on_completed() - else: - ql.append(x) - - def on_completed1() -> None: - donel[0] = True - if not ql: - if qr: - observer.on_next(False) - observer.on_completed() - elif doner[0]: - observer.on_next(True) - observer.on_completed() - - def on_next2(x: _T): - if len(ql) > 0: - v = ql.pop(0) - try: - equal = comparer_(v, x) - except Exception as exception: - observer.on_error(exception) - return - - if not equal: - observer.on_next(False) - observer.on_completed() - - elif donel[0]: - observer.on_next(False) - observer.on_completed() - else: - qr.append(x) - - def on_completed2(): - doner[0] = True - if not qr: - if len(ql) > 0: - observer.on_next(False) - observer.on_completed() - elif donel[0]: - observer.on_next(True) - observer.on_completed() - - subscription1 = first.subscribe( - on_next1, observer.on_error, on_completed1, scheduler=scheduler - ) - subscription2 = second_.subscribe( - on_next2, observer.on_error, on_completed2, scheduler=scheduler - ) - return CompositeDisposable(subscription1, subscription2) - - return Observable(subscribe) - - return sequence_equal - - -__all__ = ["sequence_equal_"] diff --git a/frogpilot/third_party/reactivex/operators/_single.py b/frogpilot/third_party/reactivex/operators/_single.py deleted file mode 100644 index e37d4f94..00000000 --- a/frogpilot/third_party/reactivex/operators/_single.py +++ /dev/null @@ -1,39 +0,0 @@ -from typing import Callable, Optional, TypeVar, cast - -from reactivex import Observable, compose -from reactivex import operators as ops -from reactivex.typing import Predicate - -_T = TypeVar("_T") - - -def single_( - predicate: Optional[Predicate[_T]] = None, -) -> Callable[[Observable[_T]], Observable[_T]]: - """Returns the only element of an observable sequence that satisfies the - condition in the optional predicate, and reports an exception if there - is not exactly one element in the observable sequence. - - Example: - >>> res = single() - >>> res = single(lambda x: x == 42) - - Args: - predicate -- [Optional] A predicate function to evaluate for - elements in the source sequence. - - Returns: - An observable sequence containing the single element in the - observable sequence that satisfies the condition in the predicate. - """ - - if predicate: - return compose(ops.filter(predicate), ops.single()) - else: - return cast( - Callable[[Observable[_T]], Observable[_T]], - ops.single_or_default_async(False), - ) - - -__all__ = ["single_"] diff --git a/frogpilot/third_party/reactivex/operators/_singleordefault.py b/frogpilot/third_party/reactivex/operators/_singleordefault.py deleted file mode 100644 index ca2ba251..00000000 --- a/frogpilot/third_party/reactivex/operators/_singleordefault.py +++ /dev/null @@ -1,83 +0,0 @@ -from typing import Callable, Optional, TypeVar, cast - -from reactivex import Observable, abc, compose -from reactivex import operators as ops -from reactivex.internal.exceptions import SequenceContainsNoElementsError -from reactivex.typing import Predicate - -_T = TypeVar("_T") - - -def single_or_default_async_( - has_default: bool = False, default_value: Optional[_T] = None -) -> Callable[[Observable[_T]], Observable[_T]]: - def single_or_default_async(source: Observable[_T]) -> Observable[_T]: - def subscribe( - observer: abc.ObserverBase[_T], - scheduler: Optional[abc.SchedulerBase] = None, - ): - value = cast(_T, default_value) - seen_value = False - - def on_next(x: _T): - nonlocal value, seen_value - - if seen_value: - observer.on_error( - Exception("Sequence contains more than one element") - ) - else: - value = x - seen_value = True - - def on_completed(): - if not seen_value and not has_default: - observer.on_error(SequenceContainsNoElementsError()) - else: - observer.on_next(value) - observer.on_completed() - - return source.subscribe( - on_next, observer.on_error, on_completed, scheduler=scheduler - ) - - return Observable(subscribe) - - return single_or_default_async - - -def single_or_default_( - predicate: Optional[Predicate[_T]] = None, default_value: _T = None -) -> Callable[[Observable[_T]], Observable[_T]]: - """Returns the only element of an observable sequence that matches - the predicate, or a default value if no such element exists this - method reports an exception if there is more than one element in the - observable sequence. - - Examples: - >>> res = single_or_default() - >>> res = single_or_default(lambda x: x == 42) - >>> res = single_or_default(lambda x: x == 42, 0) - >>> res = single_or_default(None, 0) - - Args: - predicate -- [Optional] A predicate function to evaluate for - elements in the source sequence. - default_value -- [Optional] The default value if the index is - outside the bounds of the source sequence. - - Returns: - An observable Sequence containing the single element in the - observable sequence that satisfies the condition in the predicate, - or a default value if no such element exists. - """ - - if predicate: - return compose( - ops.filter(predicate), ops.single_or_default(None, default_value) - ) - else: - return single_or_default_async_(True, default_value) - - -__all__ = ["single_or_default_", "single_or_default_async_"] diff --git a/frogpilot/third_party/reactivex/operators/_skip.py b/frogpilot/third_party/reactivex/operators/_skip.py deleted file mode 100644 index 1cd77f3f..00000000 --- a/frogpilot/third_party/reactivex/operators/_skip.py +++ /dev/null @@ -1,50 +0,0 @@ -from typing import Callable, Optional, TypeVar - -from reactivex import Observable, abc -from reactivex.internal import ArgumentOutOfRangeException - -_T = TypeVar("_T") - - -def skip_(count: int) -> Callable[[Observable[_T]], Observable[_T]]: - if count < 0: - raise ArgumentOutOfRangeException() - - def skip(source: Observable[_T]) -> Observable[_T]: - """The skip operator. - - Bypasses a specified number of elements in an observable sequence - and then returns the remaining elements. - - Args: - source: The source observable. - - Returns: - An observable sequence that contains the elements that occur - after the specified index in the input sequence. - """ - - def subscribe( - observer: abc.ObserverBase[_T], - scheduler: Optional[abc.SchedulerBase] = None, - ): - remaining = count - - def on_next(value: _T) -> None: - nonlocal remaining - - if remaining <= 0: - observer.on_next(value) - else: - remaining -= 1 - - return source.subscribe( - on_next, observer.on_error, observer.on_completed, scheduler=scheduler - ) - - return Observable(subscribe) - - return skip - - -__all__ = ["skip_"] diff --git a/frogpilot/third_party/reactivex/operators/_skiplast.py b/frogpilot/third_party/reactivex/operators/_skiplast.py deleted file mode 100644 index 779266fd..00000000 --- a/frogpilot/third_party/reactivex/operators/_skiplast.py +++ /dev/null @@ -1,52 +0,0 @@ -from typing import Callable, List, Optional, TypeVar - -from reactivex import Observable, abc - -_T = TypeVar("_T") - - -def skip_last_(count: int) -> Callable[[Observable[_T]], Observable[_T]]: - def skip_last(source: Observable[_T]) -> Observable[_T]: - """Bypasses a specified number of elements at the end of an - observable sequence. - - This operator accumulates a queue with a length enough to store - the first `count` elements. As more elements are received, - elements are taken from the front of the queue and produced on - the result sequence. This causes elements to be delayed. - - Args: - count: Number of elements to bypass at the end of the - source sequence. - - Returns: - An observable sequence containing the source sequence - elements except for the bypassed ones at the end. - """ - - def subscribe( - observer: abc.ObserverBase[_T], - scheduler: Optional[abc.SchedulerBase] = None, - ): - q: List[_T] = [] - - def on_next(value: _T) -> None: - front = None - with source.lock: - q.append(value) - if len(q) > count: - front = q.pop(0) - - if front is not None: - observer.on_next(front) - - return source.subscribe( - on_next, observer.on_error, observer.on_completed, scheduler=scheduler - ) - - return Observable(subscribe) - - return skip_last - - -__all__ = ["skip_last_"] diff --git a/frogpilot/third_party/reactivex/operators/_skiplastwithtime.py b/frogpilot/third_party/reactivex/operators/_skiplastwithtime.py deleted file mode 100644 index f5c5d4b8..00000000 --- a/frogpilot/third_party/reactivex/operators/_skiplastwithtime.py +++ /dev/null @@ -1,69 +0,0 @@ -from typing import Any, Callable, Dict, List, Optional, TypeVar - -from reactivex import Observable, abc, typing -from reactivex.scheduler import TimeoutScheduler - -_T = TypeVar("_T") - - -def skip_last_with_time_( - duration: typing.RelativeTime, scheduler: Optional[abc.SchedulerBase] = None -) -> Callable[[Observable[_T]], Observable[_T]]: - """Skips elements for the specified duration from the end of the - observable source sequence. - - Example: - >>> res = skip_last_with_time(5.0) - - This operator accumulates a queue with a length enough to store - elements received during the initial duration window. As more - elements are received, elements older than the specified duration - are taken from the queue and produced on the result sequence. This - causes elements to be delayed with duration. - - Args: - duration: Duration for skipping elements from the end of the - sequence. - scheduler: Scheduler to use for time handling. - - Returns: - An observable sequence with the elements skipped during the - specified duration from the end of the source sequence. - """ - - def skip_last_with_time(source: Observable[_T]) -> Observable[_T]: - def subscribe( - observer: abc.ObserverBase[_T], - scheduler_: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - nonlocal duration - - _scheduler: abc.SchedulerBase = ( - scheduler or scheduler_ or TimeoutScheduler.singleton() - ) - duration = _scheduler.to_timedelta(duration) - q: List[Dict[str, Any]] = [] - - def on_next(x: _T) -> None: - now = _scheduler.now - q.append({"interval": now, "value": x}) - while q and now - q[0]["interval"] >= duration: - observer.on_next(q.pop(0)["value"]) - - def on_completed() -> None: - now = _scheduler.now - while q and now - q[0]["interval"] >= duration: - observer.on_next(q.pop(0)["value"]) - - observer.on_completed() - - return source.subscribe( - on_next, observer.on_error, on_completed, scheduler=_scheduler - ) - - return Observable(subscribe) - - return skip_last_with_time - - -__all__ = ["skip_last_with_time_"] diff --git a/frogpilot/third_party/reactivex/operators/_skipuntil.py b/frogpilot/third_party/reactivex/operators/_skipuntil.py deleted file mode 100644 index 5dfc98fa..00000000 --- a/frogpilot/third_party/reactivex/operators/_skipuntil.py +++ /dev/null @@ -1,72 +0,0 @@ -from asyncio import Future -from typing import Any, Callable, Optional, TypeVar, Union - -from reactivex import Observable, abc, from_future -from reactivex.disposable import CompositeDisposable, SingleAssignmentDisposable - -_T = TypeVar("_T") - - -def skip_until_( - other: Union[Observable[Any], "Future[Any]"] -) -> Callable[[Observable[_T]], Observable[_T]]: - """Returns the values from the source observable sequence only after - the other observable sequence produces a value. - - Args: - other: The observable sequence that triggers propagation of - elements of the source sequence. - - Returns: - An observable sequence containing the elements of the source - sequence starting from the point the other sequence triggered - propagation. - """ - - if isinstance(other, Future): - obs: Observable[Any] = from_future(other) - else: - obs = other - - def skip_until(source: Observable[_T]) -> Observable[_T]: - def subscribe( - observer: abc.ObserverBase[_T], - scheduler: Optional[abc.SchedulerBase] = None, - ): - is_open = [False] - - def on_next(left: _T) -> None: - if is_open[0]: - observer.on_next(left) - - def on_completed() -> None: - if is_open[0]: - observer.on_completed() - - subs = source.subscribe( - on_next, observer.on_error, on_completed, scheduler=scheduler - ) - subscriptions = CompositeDisposable(subs) - - right_subscription = SingleAssignmentDisposable() - subscriptions.add(right_subscription) - - def on_next2(x: Any) -> None: - is_open[0] = True - right_subscription.dispose() - - def on_completed2(): - right_subscription.dispose() - - right_subscription.disposable = obs.subscribe( - on_next2, observer.on_error, on_completed2, scheduler=scheduler - ) - - return subscriptions - - return Observable(subscribe) - - return skip_until - - -__all__ = ["skip_until_"] diff --git a/frogpilot/third_party/reactivex/operators/_skipuntilwithtime.py b/frogpilot/third_party/reactivex/operators/_skipuntilwithtime.py deleted file mode 100644 index 05d6afc4..00000000 --- a/frogpilot/third_party/reactivex/operators/_skipuntilwithtime.py +++ /dev/null @@ -1,69 +0,0 @@ -from datetime import datetime -from typing import Any, Callable, Optional, TypeVar - -from reactivex import Observable, abc, typing -from reactivex.disposable import CompositeDisposable -from reactivex.scheduler import TimeoutScheduler - -_T = TypeVar("_T") - - -def skip_until_with_time_( - start_time: typing.AbsoluteOrRelativeTime, - scheduler: Optional[abc.SchedulerBase] = None, -) -> Callable[[Observable[_T]], Observable[_T]]: - def skip_until_with_time(source: Observable[_T]) -> Observable[_T]: - """Skips elements from the observable source sequence until the - specified start time. - - Errors produced by the source sequence are always forwarded to - the result sequence, even if the error occurs before the start - time. - - Examples: - >>> res = source.skip_until_with_time(datetime) - >>> res = source.skip_until_with_time(5.0) - - Args: - start_time: Time to start taking elements from the source - sequence. If this value is less than or equal to - `datetime.utcnow`, no elements will be skipped. - - Returns: - An observable sequence with the elements skipped until the - specified start time. - """ - - if isinstance(start_time, datetime): - scheduler_method = "schedule_absolute" - else: - scheduler_method = "schedule_relative" - - def subscribe( - observer: abc.ObserverBase[_T], - scheduler_: Optional[abc.SchedulerBase] = None, - ): - _scheduler = scheduler or scheduler_ or TimeoutScheduler.singleton() - - open = [False] - - def on_next(x: _T) -> None: - if open[0]: - observer.on_next(x) - - subscription = source.subscribe( - on_next, observer.on_error, observer.on_completed, scheduler=scheduler_ - ) - - def action(scheduler: abc.SchedulerBase, state: Any): - open[0] = True - - disp = getattr(_scheduler, scheduler_method)(start_time, action) - return CompositeDisposable(disp, subscription) - - return Observable(subscribe) - - return skip_until_with_time - - -__all__ = ["skip_until_with_time_"] diff --git a/frogpilot/third_party/reactivex/operators/_skipwhile.py b/frogpilot/third_party/reactivex/operators/_skipwhile.py deleted file mode 100644 index accf1d40..00000000 --- a/frogpilot/third_party/reactivex/operators/_skipwhile.py +++ /dev/null @@ -1,78 +0,0 @@ -from typing import Callable, Optional, Tuple, TypeVar - -from reactivex import Observable, abc, compose -from reactivex import operators as ops -from reactivex import typing - -_T = TypeVar("_T") - - -def skip_while_( - predicate: typing.Predicate[_T], -) -> Callable[[Observable[_T]], Observable[_T]]: - def skip_while(source: Observable[_T]) -> Observable[_T]: - """Bypasses elements in an observable sequence as long as a - specified condition is true and then returns the remaining - elements. The element's index is used in the logic of the - predicate function. - - Example: - >>> skip_while(source) - - Args: - source: The source observable to skip elements from. - - Returns: - An observable sequence that contains the elements from the - input sequence starting at the first element in the linear - series that does not pass the test specified by predicate. - """ - - def subscribe( - observer: abc.ObserverBase[_T], - scheduler: Optional[abc.SchedulerBase] = None, - ): - running = False - - def on_next(value: _T): - nonlocal running - - if not running: - try: - running = not predicate(value) - except Exception as exn: - observer.on_error(exn) - return - - if running: - observer.on_next(value) - - return source.subscribe( - on_next, observer.on_error, observer.on_completed, scheduler=scheduler - ) - - return Observable(subscribe) - - return skip_while - - -def skip_while_indexed_( - predicate: typing.PredicateIndexed[_T], -) -> Callable[[Observable[_T]], Observable[_T]]: - def indexer(x: _T, i: int) -> Tuple[_T, int]: - return (x, i) - - def skipper(x: Tuple[_T, int]) -> bool: - return predicate(*x) - - def mapper(x: Tuple[_T, int]) -> _T: - return x[0] - - return compose( - ops.map_indexed(indexer), - ops.skip_while(skipper), - ops.map(mapper), - ) - - -__all__ = ["skip_while_", "skip_while_indexed_"] diff --git a/frogpilot/third_party/reactivex/operators/_skipwithtime.py b/frogpilot/third_party/reactivex/operators/_skipwithtime.py deleted file mode 100644 index cc3b13e2..00000000 --- a/frogpilot/third_party/reactivex/operators/_skipwithtime.py +++ /dev/null @@ -1,66 +0,0 @@ -from typing import Any, Callable, Optional, TypeVar - -from reactivex import Observable, abc, typing -from reactivex.disposable import CompositeDisposable -from reactivex.scheduler import TimeoutScheduler - -_T = TypeVar("_T") - - -def skip_with_time_( - duration: typing.RelativeTime, scheduler: Optional[abc.SchedulerBase] = None -) -> Callable[[Observable[_T]], Observable[_T]]: - def skip_with_time(source: Observable[_T]) -> Observable[_T]: - """Skips elements for the specified duration from the start of - the observable source sequence. - - Args: - >>> res = skip_with_time(5.0) - - Specifying a zero value for duration doesn't guarantee no - elements will be dropped from the start of the source sequence. - This is a side-effect of the asynchrony introduced by the - scheduler, where the action that causes callbacks from the - source sequence to be forwarded may not execute immediately, - despite the zero due time. - - Errors produced by the source sequence are always forwarded to - the result sequence, even if the error occurs before the - duration. - - Args: - duration: Duration for skipping elements from the start of - the sequence. - - Returns: - An observable sequence with the elements skipped during the - specified duration from the start of the source sequence. - """ - - def subscribe( - observer: abc.ObserverBase[_T], - scheduler_: Optional[abc.SchedulerBase] = None, - ): - _scheduler = scheduler or scheduler_ or TimeoutScheduler.singleton() - open = [False] - - def action(scheduler: abc.SchedulerBase, state: Any) -> None: - open[0] = True - - t = _scheduler.schedule_relative(duration, action) - - def on_next(x: _T): - if open[0]: - observer.on_next(x) - - d = source.subscribe( - on_next, observer.on_error, observer.on_completed, scheduler=scheduler_ - ) - return CompositeDisposable(t, d) - - return Observable(subscribe) - - return skip_with_time - - -__all__ = ["skip_with_time_"] diff --git a/frogpilot/third_party/reactivex/operators/_slice.py b/frogpilot/third_party/reactivex/operators/_slice.py deleted file mode 100644 index f75a78cb..00000000 --- a/frogpilot/third_party/reactivex/operators/_slice.py +++ /dev/null @@ -1,75 +0,0 @@ -from sys import maxsize -from typing import Any, Callable, List, Optional, TypeVar - -from reactivex import Observable -from reactivex import operators as ops - -_T = TypeVar("_T") - - -# pylint: disable=redefined-builtin -def slice_( - start: Optional[int] = None, stop: Optional[int] = None, step: Optional[int] = None -) -> Callable[[Observable[_T]], Observable[_T]]: - _start: int = 0 if start is None else start - _stop: int = maxsize if stop is None else stop - _step: int = 1 if step is None else step - - pipeline: List[Callable[[Observable[Any]], Observable[Any]]] = [] - - def slice(source: Observable[_T]) -> Observable[_T]: - """The partially applied slice operator. - - Slices the given observable. It is basically a wrapper around the operators - :func:`skip `, - :func:`skip_last `, - :func:`take `, - :func:`take_last ` and - :func:`filter `. - - The following diagram helps you remember how slices works with streams. - - Positive numbers are relative to the start of the events, while negative - numbers are relative to the end (close) of the stream. - - .. code:: - - r---e---a---c---t---i---v---e---! - 0 1 2 3 4 5 6 7 8 - -8 -7 -6 -5 -4 -3 -2 -1 0 - - Examples: - >>> result = source.slice(1, 10) - >>> result = source.slice(1, -2) - >>> result = source.slice(1, -1, 2) - - Args: - source: Observable to slice - - Returns: - A sliced observable sequence. - """ - - if _stop >= 0: - pipeline.append(ops.take(_stop)) - - if _start > 0: - pipeline.append(ops.skip(_start)) - elif _start < 0: - pipeline.append(ops.take_last(-_start)) - - if _stop < 0: - pipeline.append(ops.skip_last(-_stop)) - - if _step > 1: - pipeline.append(ops.filter_indexed(lambda x, i: i % _step == 0)) - elif _step < 0: - # Reversing events is not supported - raise TypeError("Negative step not supported.") - - return source.pipe(*pipeline) - - return slice - - -__all__ = ["slice_"] diff --git a/frogpilot/third_party/reactivex/operators/_some.py b/frogpilot/third_party/reactivex/operators/_some.py deleted file mode 100644 index a687e40a..00000000 --- a/frogpilot/third_party/reactivex/operators/_some.py +++ /dev/null @@ -1,59 +0,0 @@ -from typing import Callable, Optional, TypeVar - -from reactivex import Observable, abc -from reactivex import operators as ops -from reactivex.typing import Predicate - -_T = TypeVar("_T") - - -def some_( - predicate: Optional[Predicate[_T]] = None, -) -> Callable[[Observable[_T]], Observable[bool]]: - def some(source: Observable[_T]) -> Observable[bool]: - """Partially applied operator. - - Determines whether some element of an observable sequence satisfies a - condition if present, else if some items are in the sequence. - - Example: - >>> obs = some(source) - - Args: - predicate -- A function to test each element for a condition. - - Returns: - An observable sequence containing a single element - determining whether some elements in the source sequence - pass the test in the specified predicate if given, else if - some items are in the sequence. - """ - - def subscribe( - observer: abc.ObserverBase[bool], - scheduler: Optional[abc.SchedulerBase] = None, - ): - def on_next(_: _T): - observer.on_next(True) - observer.on_completed() - - def on_error(): - observer.on_next(False) - observer.on_completed() - - return source.subscribe( - on_next, observer.on_error, on_error, scheduler=scheduler - ) - - if predicate: - return source.pipe( - ops.filter(predicate), - some_(), - ) - - return Observable(subscribe) - - return some - - -__all__ = ["some_"] diff --git a/frogpilot/third_party/reactivex/operators/_startswith.py b/frogpilot/third_party/reactivex/operators/_startswith.py deleted file mode 100644 index 79c15a3b..00000000 --- a/frogpilot/third_party/reactivex/operators/_startswith.py +++ /dev/null @@ -1,28 +0,0 @@ -from typing import Callable, TypeVar - -import reactivex -from reactivex import Observable - -_T = TypeVar("_T") - - -def start_with_(*args: _T) -> Callable[[Observable[_T]], Observable[_T]]: - def start_with(source: Observable[_T]) -> Observable[_T]: - """Partially applied start_with operator. - - Prepends a sequence of values to an observable sequence. - - Example: - >>> start_with(source) - - Returns: - The source sequence prepended with the specified values. - """ - start = reactivex.from_iterable(args) - sequence = [start, source] - return reactivex.concat(*sequence) - - return start_with - - -__all__ = ["start_with_"] diff --git a/frogpilot/third_party/reactivex/operators/_subscribeon.py b/frogpilot/third_party/reactivex/operators/_subscribeon.py deleted file mode 100644 index f1191007..00000000 --- a/frogpilot/third_party/reactivex/operators/_subscribeon.py +++ /dev/null @@ -1,57 +0,0 @@ -from typing import Any, Callable, Optional, TypeVar - -from reactivex import Observable, abc -from reactivex.disposable import ( - ScheduledDisposable, - SerialDisposable, - SingleAssignmentDisposable, -) - -_T = TypeVar("_T") - - -def subscribe_on_( - scheduler: abc.SchedulerBase, -) -> Callable[[Observable[_T]], Observable[_T]]: - def subscribe_on(source: Observable[_T]) -> Observable[_T]: - """Subscribe on the specified scheduler. - - Wrap the source sequence in order to run its subscription and - unsubscription logic on the specified scheduler. This operation - is not commonly used; see the remarks section for more - information on the distinction between subscribe_on and - observe_on. - - This only performs the side-effects of subscription and - unsubscription on the specified scheduler. In order to invoke - observer callbacks on a scheduler, use observe_on. - - Args: - source: The source observable.. - - Returns: - The source sequence whose subscriptions and - un-subscriptions happen on the specified scheduler. - """ - - def subscribe( - observer: abc.ObserverBase[_T], _: Optional[abc.SchedulerBase] = None - ): - m = SingleAssignmentDisposable() - d = SerialDisposable() - d.disposable = m - - def action(scheduler: abc.SchedulerBase, state: Optional[Any] = None): - d.disposable = ScheduledDisposable( - scheduler, source.subscribe(observer) - ) - - m.disposable = scheduler.schedule(action) - return d - - return Observable(subscribe) - - return subscribe_on - - -__all__ = ["subscribe_on_"] diff --git a/frogpilot/third_party/reactivex/operators/_sum.py b/frogpilot/third_party/reactivex/operators/_sum.py deleted file mode 100644 index ee6e0774..00000000 --- a/frogpilot/third_party/reactivex/operators/_sum.py +++ /dev/null @@ -1,20 +0,0 @@ -from typing import Any, Callable, Optional - -from reactivex import Observable, compose -from reactivex import operators as ops -from reactivex.typing import Mapper - - -def sum_( - key_mapper: Optional[Mapper[Any, float]] = None -) -> Callable[[Observable[Any]], Observable[float]]: - if key_mapper: - return compose(ops.map(key_mapper), ops.sum()) - - def accumulator(prev: float, cur: float) -> float: - return prev + cur - - return ops.reduce(seed=0, accumulator=accumulator) - - -__all__ = ["sum_"] diff --git a/frogpilot/third_party/reactivex/operators/_switchlatest.py b/frogpilot/third_party/reactivex/operators/_switchlatest.py deleted file mode 100644 index 30b8d632..00000000 --- a/frogpilot/third_party/reactivex/operators/_switchlatest.py +++ /dev/null @@ -1,90 +0,0 @@ -from asyncio import Future -from typing import Any, Callable, Optional, TypeVar, Union - -from reactivex import Observable, abc, from_future -from reactivex.disposable import ( - CompositeDisposable, - SerialDisposable, - SingleAssignmentDisposable, -) - -_T = TypeVar("_T") - - -def switch_latest_() -> ( - Callable[[Observable[Union[Observable[_T], "Future[_T]"]]], Observable[_T]] -): - def switch_latest( - source: Observable[Union[Observable[_T], "Future[_T]"]] - ) -> Observable[_T]: - """Partially applied switch_latest operator. - - Transforms an observable sequence of observable sequences into - an observable sequence producing values only from the most - recent observable sequence. - - Returns: - An observable sequence that at any point in time produces - the elements of the most recent inner observable sequence - that has been received. - """ - - def subscribe( - observer: abc.ObserverBase[_T], - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - inner_subscription = SerialDisposable() - has_latest = [False] - is_stopped = [False] - latest = [0] - - def on_next(inner_source: Union[Observable[_T], "Future[_T]"]) -> None: - nonlocal source - - d = SingleAssignmentDisposable() - with source.lock: - latest[0] += 1 - _id = latest[0] - has_latest[0] = True - inner_subscription.disposable = d - - # Check if Future or Observable - if isinstance(inner_source, Future): - obs = from_future(inner_source) - else: - obs = inner_source - - def on_next(x: Any) -> None: - if latest[0] == _id: - observer.on_next(x) - - def on_error(e: Exception) -> None: - if latest[0] == _id: - observer.on_error(e) - - def on_completed() -> None: - if latest[0] == _id: - has_latest[0] = False - if is_stopped[0]: - observer.on_completed() - - d.disposable = obs.subscribe( - on_next, on_error, on_completed, scheduler=scheduler - ) - - def on_completed() -> None: - is_stopped[0] = True - if not has_latest[0]: - observer.on_completed() - - subscription = source.subscribe( - on_next, observer.on_error, on_completed, scheduler=scheduler - ) - return CompositeDisposable(subscription, inner_subscription) - - return Observable(subscribe) - - return switch_latest - - -__all__ = ["switch_latest_"] diff --git a/frogpilot/third_party/reactivex/operators/_take.py b/frogpilot/third_party/reactivex/operators/_take.py deleted file mode 100644 index 744d7492..00000000 --- a/frogpilot/third_party/reactivex/operators/_take.py +++ /dev/null @@ -1,53 +0,0 @@ -from typing import Callable, Optional, TypeVar - -from reactivex import Observable, abc, empty -from reactivex.internal import ArgumentOutOfRangeException - -_T = TypeVar("_T") - - -def take_(count: int) -> Callable[[Observable[_T]], Observable[_T]]: - if count < 0: - raise ArgumentOutOfRangeException() - - def take(source: Observable[_T]) -> Observable[_T]: - """Returns a specified number of contiguous elements from the start of - an observable sequence. - - >>> take(source) - - Keyword arguments: - count -- The number of elements to return. - - Returns an observable sequence that contains the specified number of - elements from the start of the input sequence. - """ - - if not count: - return empty() - - def subscribe( - observer: abc.ObserverBase[_T], - scheduler: Optional[abc.SchedulerBase] = None, - ): - remaining = count - - def on_next(value: _T) -> None: - nonlocal remaining - - if remaining > 0: - remaining -= 1 - observer.on_next(value) - if not remaining: - observer.on_completed() - - return source.subscribe( - on_next, observer.on_error, observer.on_completed, scheduler=scheduler - ) - - return Observable(subscribe) - - return take - - -__all__ = ["take_"] diff --git a/frogpilot/third_party/reactivex/operators/_takelast.py b/frogpilot/third_party/reactivex/operators/_takelast.py deleted file mode 100644 index fac22f56..00000000 --- a/frogpilot/third_party/reactivex/operators/_takelast.py +++ /dev/null @@ -1,55 +0,0 @@ -from typing import Callable, List, Optional, TypeVar - -from reactivex import Observable, abc - -_T = TypeVar("_T") - - -def take_last_(count: int) -> Callable[[Observable[_T]], Observable[_T]]: - def take_last(source: Observable[_T]) -> Observable[_T]: - """Returns a specified number of contiguous elements from the end of an - observable sequence. - - Example: - >>> res = take_last(source) - - This operator accumulates a buffer with a length enough to store - elements count elements. Upon completion of the source sequence, this - buffer is drained on the result sequence. This causes the elements to be - delayed. - - Args: - source: Number of elements to take from the end of the source - sequence. - - Returns: - An observable sequence containing the specified number of elements - from the end of the source sequence. - """ - - def subscribe( - observer: abc.ObserverBase[_T], - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - q: List[_T] = [] - - def on_next(x: _T) -> None: - q.append(x) - if len(q) > count: - q.pop(0) - - def on_completed(): - while q: - observer.on_next(q.pop(0)) - observer.on_completed() - - return source.subscribe( - on_next, observer.on_error, on_completed, scheduler=scheduler - ) - - return Observable(subscribe) - - return take_last - - -__all__ = ["take_last_"] diff --git a/frogpilot/third_party/reactivex/operators/_takelastbuffer.py b/frogpilot/third_party/reactivex/operators/_takelastbuffer.py deleted file mode 100644 index 6a1d8728..00000000 --- a/frogpilot/third_party/reactivex/operators/_takelastbuffer.py +++ /dev/null @@ -1,55 +0,0 @@ -from typing import Callable, List, Optional, TypeVar - -from reactivex import Observable, abc - -_T = TypeVar("_T") - - -def take_last_buffer_(count: int) -> Callable[[Observable[_T]], Observable[List[_T]]]: - def take_last_buffer(source: Observable[_T]) -> Observable[List[_T]]: - """Returns an array with the specified number of contiguous - elements from the end of an observable sequence. - - Example: - >>> res = take_last(source) - - This operator accumulates a buffer with a length enough to - store elements count elements. Upon completion of the source - sequence, this buffer is drained on the result sequence. This - causes the elements to be delayed. - - Args: - source: Source observable to take elements from. - - Returns: - An observable sequence containing a single list with the - specified number of elements from the end of the source - sequence. - """ - - def subscribe( - observer: abc.ObserverBase[List[_T]], - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - q: List[_T] = [] - - def on_next(x: _T) -> None: - with source.lock: - q.append(x) - if len(q) > count: - q.pop(0) - - def on_completed() -> None: - observer.on_next(q) - observer.on_completed() - - return source.subscribe( - on_next, observer.on_error, on_completed, scheduler=scheduler - ) - - return Observable(subscribe) - - return take_last_buffer - - -__all__ = ["take_last_buffer_"] diff --git a/frogpilot/third_party/reactivex/operators/_takelastwithtime.py b/frogpilot/third_party/reactivex/operators/_takelastwithtime.py deleted file mode 100644 index 438ecf94..00000000 --- a/frogpilot/third_party/reactivex/operators/_takelastwithtime.py +++ /dev/null @@ -1,68 +0,0 @@ -from typing import Any, Callable, Dict, List, Optional, TypeVar - -from reactivex import Observable, abc, typing -from reactivex.scheduler import TimeoutScheduler - -_T = TypeVar("_T") - - -def take_last_with_time_( - duration: typing.RelativeTime, scheduler: Optional[abc.SchedulerBase] = None -) -> Callable[[Observable[_T]], Observable[_T]]: - def take_last_with_time(source: Observable[_T]) -> Observable[_T]: - """Returns elements within the specified duration from the end - of the observable source sequence. - - Example: - >>> res = take_last_with_time(source) - - This operator accumulates a queue with a length enough to store - elements received during the initial duration window. As more - elements are received, elements older than the specified - duration are taken from the queue and produced on the result - sequence. This causes elements to be delayed with duration. - - Args: - duration: Duration for taking elements from the end of the - sequence. - - Returns: - An observable sequence with the elements taken during the - specified duration from the end of the source sequence. - """ - - def subscribe( - observer: abc.ObserverBase[_T], - scheduler_: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - nonlocal duration - - _scheduler = scheduler or scheduler_ or TimeoutScheduler.singleton() - duration = _scheduler.to_timedelta(duration) - q: List[Dict[str, Any]] = [] - - def on_next(x: _T) -> None: - now = _scheduler.now - q.append({"interval": now, "value": x}) - while q and now - q[0]["interval"] >= duration: - q.pop(0) - - def on_completed(): - now = _scheduler.now - while q: - _next = q.pop(0) - if now - _next["interval"] <= duration: - observer.on_next(_next["value"]) - - observer.on_completed() - - return source.subscribe( - on_next, observer.on_error, on_completed, scheduler=scheduler_ - ) - - return Observable(subscribe) - - return take_last_with_time - - -__all__ = ["take_last_with_time_"] diff --git a/frogpilot/third_party/reactivex/operators/_takeuntil.py b/frogpilot/third_party/reactivex/operators/_takeuntil.py deleted file mode 100644 index 5372e059..00000000 --- a/frogpilot/third_party/reactivex/operators/_takeuntil.py +++ /dev/null @@ -1,51 +0,0 @@ -from asyncio import Future -from typing import Callable, Optional, TypeVar, Union - -from reactivex import Observable, abc, from_future -from reactivex.disposable import CompositeDisposable -from reactivex.internal import noop - -_T = TypeVar("_T") - - -def take_until_( - other: Union[Observable[_T], "Future[_T]"] -) -> Callable[[Observable[_T]], Observable[_T]]: - if isinstance(other, Future): - obs: Observable[_T] = from_future(other) - else: - obs = other - - def take_until(source: Observable[_T]) -> Observable[_T]: - """Returns the values from the source observable sequence until - the other observable sequence produces a value. - - Args: - source: The source observable sequence. - - Returns: - An observable sequence containing the elements of the source - sequence up to the point the other sequence interrupted - further propagation. - """ - - def subscribe( - observer: abc.ObserverBase[_T], - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - def on_completed(_: _T) -> None: - observer.on_completed() - - return CompositeDisposable( - source.subscribe(observer, scheduler=scheduler), - obs.subscribe( - on_completed, observer.on_error, noop, scheduler=scheduler - ), - ) - - return Observable(subscribe) - - return take_until - - -__all__ = ["take_until_"] diff --git a/frogpilot/third_party/reactivex/operators/_takeuntilwithtime.py b/frogpilot/third_party/reactivex/operators/_takeuntilwithtime.py deleted file mode 100644 index 8855c1df..00000000 --- a/frogpilot/third_party/reactivex/operators/_takeuntilwithtime.py +++ /dev/null @@ -1,53 +0,0 @@ -from datetime import datetime -from typing import Any, Callable, Optional, TypeVar - -from reactivex import Observable, abc, typing -from reactivex.disposable import CompositeDisposable -from reactivex.scheduler import TimeoutScheduler - -_T = TypeVar("_T") - - -def take_until_with_time_( - end_time: typing.AbsoluteOrRelativeTime, - scheduler: Optional[abc.SchedulerBase] = None, -) -> Callable[[Observable[_T]], Observable[_T]]: - def take_until_with_time(source: Observable[_T]) -> Observable[_T]: - """Takes elements for the specified duration until the specified end - time, using the specified scheduler to run timers. - - Examples: - >>> res = take_until_with_time(source) - - Args: - source: Source observale to take elements from. - - Returns: - An observable sequence with the elements taken - until the specified end time. - """ - - def subscribe( - observer: abc.ObserverBase[_T], - scheduler_: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - _scheduler = scheduler or scheduler_ or TimeoutScheduler.singleton() - - def action(scheduler: abc.SchedulerBase, state: Any = None): - observer.on_completed() - - if isinstance(end_time, datetime): - task = _scheduler.schedule_absolute(end_time, action) - else: - task = _scheduler.schedule_relative(end_time, action) - - return CompositeDisposable( - task, source.subscribe(observer, scheduler=scheduler_) - ) - - return Observable(subscribe) - - return take_until_with_time - - -__all__ = ["take_until_with_time_"] diff --git a/frogpilot/third_party/reactivex/operators/_takewhile.py b/frogpilot/third_party/reactivex/operators/_takewhile.py deleted file mode 100644 index 1b395d03..00000000 --- a/frogpilot/third_party/reactivex/operators/_takewhile.py +++ /dev/null @@ -1,121 +0,0 @@ -from typing import Any, Callable, Optional, TypeVar - -from reactivex import Observable, abc -from reactivex.typing import Predicate, PredicateIndexed - -_T = TypeVar("_T") - - -def take_while_( - predicate: Predicate[_T], inclusive: bool = False -) -> Callable[[Observable[_T]], Observable[_T]]: - def take_while(source: Observable[_T]) -> Observable[_T]: - """Returns elements from an observable sequence as long as a - specified condition is true. - - Example: - >>> take_while(source) - - Args: - source: The source observable to take from. - - Returns: - An observable sequence that contains the elements from the - input sequence that occur before the element at which the - test no longer passes. - """ - - def subscribe( - observer: abc.ObserverBase[_T], - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - running = True - - def on_next(value: _T): - nonlocal running - - with source.lock: - if not running: - return - - try: - running = predicate(value) - except Exception as exn: - observer.on_error(exn) - return - - if running: - observer.on_next(value) - else: - if inclusive: - observer.on_next(value) - observer.on_completed() - - return source.subscribe( - on_next, observer.on_error, observer.on_completed, scheduler=scheduler - ) - - return Observable(subscribe) - - return take_while - - -def take_while_indexed_( - predicate: PredicateIndexed[_T], inclusive: bool = False -) -> Callable[[Observable[_T]], Observable[_T]]: - def take_while_indexed(source: Observable[_T]) -> Observable[_T]: - """Returns elements from an observable sequence as long as a - specified condition is true. The element's index is used in the - logic of the predicate function. - - Example: - >>> take_while(source) - - Args: - source: Source observable to take from. - - Returns: - An observable sequence that contains the elements from the - input sequence that occur before the element at which the - test no longer passes. - """ - - def subscribe( - observer: abc.ObserverBase[_T], - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - running = True - i = 0 - - def on_next(value: Any) -> None: - nonlocal running, i - - with source.lock: - if not running: - return - - try: - running = predicate(value, i) - except Exception as exn: - observer.on_error(exn) - return - else: - i += 1 - - if running: - observer.on_next(value) - else: - if inclusive: - observer.on_next(value) - observer.on_completed() - - return source.subscribe( - on_next, observer.on_error, observer.on_completed, scheduler=scheduler - ) - - return Observable(subscribe) - - return take_while_indexed - - -__all__ = ["take_while_", "take_while_indexed_"] diff --git a/frogpilot/third_party/reactivex/operators/_takewithtime.py b/frogpilot/third_party/reactivex/operators/_takewithtime.py deleted file mode 100644 index 1473c3e6..00000000 --- a/frogpilot/third_party/reactivex/operators/_takewithtime.py +++ /dev/null @@ -1,53 +0,0 @@ -from typing import Any, Callable, Optional, TypeVar - -from reactivex import Observable, abc, typing -from reactivex.disposable import CompositeDisposable -from reactivex.scheduler import TimeoutScheduler - -_T = TypeVar("_T") - - -def take_with_time_( - duration: typing.RelativeTime, scheduler: Optional[abc.SchedulerBase] = None -) -> Callable[[Observable[_T]], Observable[_T]]: - def take_with_time(source: Observable[_T]) -> Observable[_T]: - """Takes elements for the specified duration from the start of - the observable source sequence. - - Example: - >>> res = take_with_time(source) - - This operator accumulates a queue with a length enough to store - elements received during the initial duration window. As more - elements are received, elements older than the specified - duration are taken from the queue and produced on the result - sequence. This causes elements to be delayed with duration. - - Args: - source: Source observable to take elements from. - - Returns: - An observable sequence with the elements taken during the - specified duration from the start of the source sequence. - """ - - def subscribe( - observer: abc.ObserverBase[_T], - scheduler_: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - _scheduler = scheduler or scheduler_ or TimeoutScheduler.singleton() - - def action(scheduler: abc.SchedulerBase, state: Any = None): - observer.on_completed() - - disp = _scheduler.schedule_relative(duration, action) - return CompositeDisposable( - disp, source.subscribe(observer, scheduler=scheduler_) - ) - - return Observable(subscribe) - - return take_with_time - - -__all__ = ["take_with_time_"] diff --git a/frogpilot/third_party/reactivex/operators/_throttlefirst.py b/frogpilot/third_party/reactivex/operators/_throttlefirst.py deleted file mode 100644 index 58fec06a..00000000 --- a/frogpilot/third_party/reactivex/operators/_throttlefirst.py +++ /dev/null @@ -1,57 +0,0 @@ -from datetime import datetime -from typing import Callable, Optional, TypeVar - -from reactivex import Observable, abc, typing -from reactivex.scheduler import TimeoutScheduler - -_T = TypeVar("_T") - - -def throttle_first_( - window_duration: typing.RelativeTime, scheduler: Optional[abc.SchedulerBase] = None -) -> Callable[[Observable[_T]], Observable[_T]]: - def throttle_first(source: Observable[_T]) -> Observable[_T]: - """Returns an observable that emits only the first item emitted - by the source Observable during sequential time windows of a - specified duration. - - Args: - source: Source observable to throttle. - - Returns: - An Observable that performs the throttle operation. - """ - - def subscribe( - observer: abc.ObserverBase[_T], - scheduler_: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - _scheduler = scheduler or scheduler_ or TimeoutScheduler.singleton() - - duration = _scheduler.to_timedelta(window_duration or 0.0) - if duration <= _scheduler.to_timedelta(0): - raise ValueError("window_duration cannot be less or equal zero.") - last_on_next: Optional[datetime] = None - - def on_next(x: _T) -> None: - nonlocal last_on_next - emit = False - now = _scheduler.now - - with source.lock: - if not last_on_next or now - last_on_next >= duration: - last_on_next = now - emit = True - if emit: - observer.on_next(x) - - return source.subscribe( - on_next, observer.on_error, observer.on_completed, scheduler=_scheduler - ) - - return Observable(subscribe) - - return throttle_first - - -__all__ = ["throttle_first_"] diff --git a/frogpilot/third_party/reactivex/operators/_timeinterval.py b/frogpilot/third_party/reactivex/operators/_timeinterval.py deleted file mode 100644 index 7f38f813..00000000 --- a/frogpilot/third_party/reactivex/operators/_timeinterval.py +++ /dev/null @@ -1,53 +0,0 @@ -from dataclasses import dataclass -from datetime import timedelta -from typing import Callable, Generic, Optional, TypeVar - -from reactivex import Observable, abc -from reactivex import operators as ops -from reactivex.scheduler import TimeoutScheduler - -_T = TypeVar("_T") - - -@dataclass -class TimeInterval(Generic[_T]): - value: _T - interval: timedelta - - -def time_interval_( - scheduler: Optional[abc.SchedulerBase] = None, -) -> Callable[[Observable[_T]], Observable[TimeInterval[_T]]]: - def time_interval(source: Observable[_T]) -> Observable[TimeInterval[_T]]: - """Records the time interval between consecutive values in an - observable sequence. - - >>> res = time_interval(source) - - Return: - An observable sequence with time interval information on - values. - """ - - def subscribe( - observer: abc.ObserverBase[TimeInterval[_T]], - scheduler_: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - _scheduler = scheduler or scheduler_ or TimeoutScheduler.singleton() - last = _scheduler.now - - def mapper(value: _T) -> TimeInterval[_T]: - nonlocal last - - now = _scheduler.now - span = now - last - last = now - return TimeInterval(value=value, interval=span) - - return source.pipe(ops.map(mapper)).subscribe( - observer, scheduler=_scheduler - ) - - return Observable(subscribe) - - return time_interval diff --git a/frogpilot/third_party/reactivex/operators/_timeout.py b/frogpilot/third_party/reactivex/operators/_timeout.py deleted file mode 100644 index 585f0b7b..00000000 --- a/frogpilot/third_party/reactivex/operators/_timeout.py +++ /dev/null @@ -1,101 +0,0 @@ -from asyncio import Future -from datetime import datetime -from typing import Any, Callable, Optional, TypeVar, Union - -from reactivex import Observable, abc, from_future, throw, typing -from reactivex.disposable import ( - CompositeDisposable, - SerialDisposable, - SingleAssignmentDisposable, -) -from reactivex.scheduler import TimeoutScheduler - -_T = TypeVar("_T") - - -def timeout_( - duetime: typing.AbsoluteOrRelativeTime, - other: Optional[Union[Observable[_T], "Future[_T]"]] = None, - scheduler: Optional[abc.SchedulerBase] = None, -) -> Callable[[Observable[_T]], Observable[_T]]: - - other = other or throw(Exception("Timeout")) - if isinstance(other, Future): - obs = from_future(other) - else: - obs = other - - def timeout(source: Observable[_T]) -> Observable[_T]: - """Returns the source observable sequence or the other observable - sequence if duetime elapses. - - Examples: - >>> res = timeout(source) - - Args: - source: Source observable to timeout - - Returns: - An observable sequence switching to the other sequence in - case of a timeout. - """ - - def subscribe( - observer: abc.ObserverBase[_T], - scheduler_: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - _scheduler = scheduler or scheduler_ or TimeoutScheduler.singleton() - - switched = [False] - _id = [0] - - original = SingleAssignmentDisposable() - subscription = SerialDisposable() - timer = SerialDisposable() - subscription.disposable = original - - def create_timer() -> None: - my_id = _id[0] - - def action(scheduler: abc.SchedulerBase, state: Any = None): - switched[0] = _id[0] == my_id - timer_wins = switched[0] - if timer_wins: - subscription.disposable = obs.subscribe( - observer, scheduler=scheduler - ) - - if isinstance(duetime, datetime): - timer.disposable = _scheduler.schedule_absolute(duetime, action) - else: - timer.disposable = _scheduler.schedule_relative(duetime, action) - - create_timer() - - def on_next(value: _T) -> None: - send_wins = not switched[0] - if send_wins: - _id[0] += 1 - observer.on_next(value) - create_timer() - - def on_error(error: Exception) -> None: - on_error_wins = not switched[0] - if on_error_wins: - _id[0] += 1 - observer.on_error(error) - - def on_completed() -> None: - on_completed_wins = not switched[0] - if on_completed_wins: - _id[0] += 1 - observer.on_completed() - - original.disposable = source.subscribe( - on_next, on_error, on_completed, scheduler=scheduler_ - ) - return CompositeDisposable(subscription, timer) - - return Observable(subscribe) - - return timeout diff --git a/frogpilot/third_party/reactivex/operators/_timeoutwithmapper.py b/frogpilot/third_party/reactivex/operators/_timeoutwithmapper.py deleted file mode 100644 index 23b7a40e..00000000 --- a/frogpilot/third_party/reactivex/operators/_timeoutwithmapper.py +++ /dev/null @@ -1,134 +0,0 @@ -from typing import Any, Callable, Optional, TypeVar - -import reactivex -from reactivex import Observable, abc -from reactivex.disposable import ( - CompositeDisposable, - SerialDisposable, - SingleAssignmentDisposable, -) - -_T = TypeVar("_T") - - -def timeout_with_mapper_( - first_timeout: Optional[Observable[_T]] = None, - timeout_duration_mapper: Optional[Callable[[Any], Observable[Any]]] = None, - other: Optional[Observable[_T]] = None, -) -> Callable[[Observable[_T]], Observable[_T]]: - """Returns the source observable sequence, switching to the other - observable sequence if a timeout is signaled. - - res = timeout_with_mapper(reactivex.timer(500)) - res = timeout_with_mapper(reactivex.timer(500), lambda x: reactivex.timer(200)) - res = timeout_with_mapper( - reactivex.timer(500), - lambda x: reactivex.timer(200)), - reactivex.return_value(42) - ) - - Args: - first_timeout -- [Optional] Observable sequence that represents the - timeout for the first element. If not provided, this defaults to - reactivex.never(). - timeout_duration_mapper -- [Optional] Selector to retrieve an - observable sequence that represents the timeout between the - current element and the next element. - other -- [Optional] Sequence to return in case of a timeout. If not - provided, this is set to reactivex.throw(). - - Returns: - The source sequence switching to the other sequence in case - of a timeout. - """ - - first_timeout_ = first_timeout or reactivex.never() - other_ = other or reactivex.throw(Exception("Timeout")) - - def timeout_with_mapper(source: Observable[_T]) -> Observable[_T]: - def subscribe( - observer: abc.ObserverBase[_T], - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - subscription = SerialDisposable() - timer = SerialDisposable() - original = SingleAssignmentDisposable() - - subscription.disposable = original - - switched = False - _id = [0] - - def set_timer(timeout: Observable[Any]) -> None: - my_id = _id[0] - - def timer_wins(): - return _id[0] == my_id - - d = SingleAssignmentDisposable() - timer.disposable = d - - def on_next(x: Any) -> None: - if timer_wins(): - subscription.disposable = other_.subscribe( - observer, scheduler=scheduler - ) - - d.dispose() - - def on_error(e: Exception) -> None: - if timer_wins(): - observer.on_error(e) - - def on_completed() -> None: - if timer_wins(): - subscription.disposable = other_.subscribe(observer) - - d.disposable = timeout.subscribe( - on_next, on_error, on_completed, scheduler=scheduler - ) - - set_timer(first_timeout_) - - def observer_wins(): - res = not switched - if res: - _id[0] += 1 - - return res - - def on_next(x: _T) -> None: - if observer_wins(): - observer.on_next(x) - timeout = None - try: - timeout = ( - timeout_duration_mapper(x) - if timeout_duration_mapper - else reactivex.never() - ) - except Exception as e: - observer.on_error(e) - return - - set_timer(timeout) - - def on_error(error: Exception) -> None: - if observer_wins(): - observer.on_error(error) - - def on_completed() -> None: - if observer_wins(): - observer.on_completed() - - original.disposable = source.subscribe( - on_next, on_error, on_completed, scheduler=scheduler - ) - return CompositeDisposable(subscription, timer) - - return Observable(subscribe) - - return timeout_with_mapper - - -__all__ = ["timeout_with_mapper_"] diff --git a/frogpilot/third_party/reactivex/operators/_timestamp.py b/frogpilot/third_party/reactivex/operators/_timestamp.py deleted file mode 100644 index 2ae40607..00000000 --- a/frogpilot/third_party/reactivex/operators/_timestamp.py +++ /dev/null @@ -1,49 +0,0 @@ -from dataclasses import dataclass -from datetime import datetime -from typing import Callable, Generic, Optional, TypeVar - -from reactivex import Observable, abc, defer, operators -from reactivex.scheduler import TimeoutScheduler - -_T = TypeVar("_T") - - -@dataclass -class Timestamp(Generic[_T]): - value: _T - timestamp: datetime - - -def timestamp_( - scheduler: Optional[abc.SchedulerBase] = None, -) -> Callable[[Observable[_T]], Observable[Timestamp[_T]]]: - def timestamp(source: Observable[_T]) -> Observable[Timestamp[_T]]: - """Records the timestamp for each value in an observable sequence. - - Examples: - >>> timestamp(source) - - Produces objects with attributes `value` and `timestamp`, where - value is the original value. - - Args: - source: Observable source to timestamp. - - Returns: - An observable sequence with timestamp information on values. - """ - - def factory(scheduler_: Optional[abc.SchedulerBase] = None): - _scheduler = scheduler or scheduler_ or TimeoutScheduler.singleton() - - def mapper(value: _T) -> Timestamp[_T]: - return Timestamp(value=value, timestamp=_scheduler.now) - - return source.pipe(operators.map(mapper)) - - return defer(factory) - - return timestamp - - -__all__ = ["timestamp_"] diff --git a/frogpilot/third_party/reactivex/operators/_todict.py b/frogpilot/third_party/reactivex/operators/_todict.py deleted file mode 100644 index 27580bfb..00000000 --- a/frogpilot/third_party/reactivex/operators/_todict.py +++ /dev/null @@ -1,64 +0,0 @@ -from typing import Callable, Dict, Optional, TypeVar, cast - -from reactivex import Observable, abc -from reactivex.typing import Mapper - -_T = TypeVar("_T") -_TKey = TypeVar("_TKey") -_TValue = TypeVar("_TValue") - - -def to_dict_( - key_mapper: Mapper[_T, _TKey], element_mapper: Optional[Mapper[_T, _TValue]] = None -) -> Callable[[Observable[_T]], Observable[Dict[_TKey, _TValue]]]: - def to_dict(source: Observable[_T]) -> Observable[Dict[_TKey, _TValue]]: - """Converts the observable sequence to a Map if it exists. - - Args: - source: Source observable to convert. - - Returns: - An observable sequence with a single value of a dictionary - containing the values from the observable sequence. - """ - - def subscribe( - observer: abc.ObserverBase[Dict[_TKey, _TValue]], - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - m: Dict[_TKey, _TValue] = dict() - - def on_next(x: _T) -> None: - try: - key = key_mapper(x) - except Exception as ex: # pylint: disable=broad-except - observer.on_error(ex) - return - - if element_mapper: - try: - element = element_mapper(x) - except Exception as ex: # pylint: disable=broad-except - observer.on_error(ex) - return - else: - element = cast(_TValue, x) - - m[key] = element - - def on_completed() -> None: - nonlocal m - observer.on_next(m) - m = dict() - observer.on_completed() - - return source.subscribe( - on_next, observer.on_error, on_completed, scheduler=scheduler - ) - - return Observable(subscribe) - - return to_dict - - -__all__ = ["to_dict_"] diff --git a/frogpilot/third_party/reactivex/operators/_tofuture.py b/frogpilot/third_party/reactivex/operators/_tofuture.py deleted file mode 100644 index 8369aba5..00000000 --- a/frogpilot/third_party/reactivex/operators/_tofuture.py +++ /dev/null @@ -1,67 +0,0 @@ -import asyncio -from asyncio import Future -from typing import Callable, Optional, TypeVar, cast - -from reactivex import Observable, abc -from reactivex.internal.exceptions import SequenceContainsNoElementsError - -_T = TypeVar("_T") - - -def to_future_( - future_ctor: Optional[Callable[[], "Future[_T]"]] = None, - scheduler: Optional[abc.SchedulerBase] = None, -) -> Callable[[Observable[_T]], "Future[_T]"]: - future_ctor_: Callable[[], "Future[_T]"] = ( - future_ctor or asyncio.get_event_loop().create_future - ) - future: "Future[_T]" = future_ctor_() - - def to_future(source: Observable[_T]) -> "Future[_T]": - """Converts an existing observable sequence to a Future. - - If the observable emits a single item, then this item is set as the - result of the future. If the observable emits a sequence of items, then - the last emitted item is set as the result of the future. - - Example: - future = reactivex.return_value(42).pipe(ops.to_future(asyncio.Future)) - - Args: - future_ctor: [Optional] The constructor of the future. - - Returns: - A future with the last value from the observable sequence. - """ - - has_value = False - last_value = cast(_T, None) - - def on_next(value: _T): - nonlocal last_value - nonlocal has_value - last_value = value - has_value = True - - def on_error(err: Exception): - if not future.cancelled(): - future.set_exception(err) - - def on_completed(): - nonlocal last_value - if not future.cancelled(): - if has_value: - future.set_result(last_value) - else: - future.set_exception(SequenceContainsNoElementsError()) - last_value = None - - dis = source.subscribe(on_next, on_error, on_completed, scheduler=scheduler) - future.add_done_callback(lambda _: dis.dispose()) - - return future - - return to_future - - -__all__ = ["to_future_"] diff --git a/frogpilot/third_party/reactivex/operators/_toiterable.py b/frogpilot/third_party/reactivex/operators/_toiterable.py deleted file mode 100644 index 1c7399b4..00000000 --- a/frogpilot/third_party/reactivex/operators/_toiterable.py +++ /dev/null @@ -1,44 +0,0 @@ -from typing import Callable, List, Optional, TypeVar - -from reactivex import Observable, abc - -_T = TypeVar("_T") - - -def to_iterable_() -> Callable[[Observable[_T]], Observable[List[_T]]]: - def to_iterable(source: Observable[_T]) -> Observable[List[_T]]: - """Creates an iterable from an observable sequence. - - Returns: - An observable sequence containing a single element with an - iterable containing all the elements of the source - sequence. - """ - - def subscribe( - observer: abc.ObserverBase[List[_T]], - scheduler: Optional[abc.SchedulerBase] = None, - ): - nonlocal source - - queue: List[_T] = [] - - def on_next(item: _T): - queue.append(item) - - def on_completed(): - nonlocal queue - observer.on_next(queue) - queue = [] - observer.on_completed() - - return source.subscribe( - on_next, observer.on_error, on_completed, scheduler=scheduler - ) - - return Observable(subscribe) - - return to_iterable - - -__all__ = ["to_iterable_"] diff --git a/frogpilot/third_party/reactivex/operators/_tomarbles.py b/frogpilot/third_party/reactivex/operators/_tomarbles.py deleted file mode 100644 index 951fcedd..00000000 --- a/frogpilot/third_party/reactivex/operators/_tomarbles.py +++ /dev/null @@ -1,78 +0,0 @@ -from typing import Any, List, Optional - -from reactivex import Observable, abc -from reactivex.scheduler import NewThreadScheduler -from reactivex.typing import RelativeTime - -new_thread_scheduler = NewThreadScheduler() - - -def to_marbles( - timespan: RelativeTime = 0.1, scheduler: Optional[abc.SchedulerBase] = None -): - def to_marbles(source: Observable[Any]) -> Observable[str]: - """Convert an observable sequence into a marble diagram string. - - Args: - timespan: [Optional] duration of each character in second. - If not specified, defaults to 0.1s. - scheduler: [Optional] The scheduler used to run the the input - sequence on. - - Returns: - Observable stream. - """ - - def subscribe( - observer: abc.ObserverBase[str], - scheduler: Optional[abc.SchedulerBase] = None, - ): - scheduler = scheduler or new_thread_scheduler - - result: List[str] = [] - last = scheduler.now - - def add_timespan(): - nonlocal last - - now = scheduler.now - diff = now - last - last = now - secs = scheduler.to_seconds(diff) - timespan_ = scheduler.to_seconds(timespan) - dashes = "-" * int((secs + timespan_ / 2.0) * (1.0 / timespan_)) - result.append(dashes) - - def on_next(value: Any) -> None: - add_timespan() - result.append(stringify(value)) - - def on_error(exception: Exception) -> None: - add_timespan() - result.append(stringify(exception)) - observer.on_next("".join(n for n in result)) - observer.on_completed() - - def on_completed(): - add_timespan() - result.append("|") - observer.on_next("".join(n for n in result)) - observer.on_completed() - - return source.subscribe(on_next, on_error, on_completed) - - return Observable(subscribe) - - return to_marbles - - -def stringify(value: Any) -> str: - """Utility for stringifying an event.""" - string = str(value) - if len(string) > 1: - string = "(%s)" % string - - return string - - -__all__ = ["stringify"] diff --git a/frogpilot/third_party/reactivex/operators/_toset.py b/frogpilot/third_party/reactivex/operators/_toset.py deleted file mode 100644 index 2c522e42..00000000 --- a/frogpilot/third_party/reactivex/operators/_toset.py +++ /dev/null @@ -1,37 +0,0 @@ -from typing import Callable, Optional, Set, TypeVar - -from reactivex import Observable, abc - -_T = TypeVar("_T") - - -def to_set_() -> Callable[[Observable[_T]], Observable[Set[_T]]]: - """Converts the observable sequence to a set. - - Returns an observable sequence with a single value of a set - containing the values from the observable sequence. - """ - - def to_set(source: Observable[_T]) -> Observable[Set[_T]]: - def subscribe( - observer: abc.ObserverBase[Set[_T]], - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - s: Set[_T] = set() - - def on_completed() -> None: - nonlocal s - observer.on_next(s) - s = set() - observer.on_completed() - - return source.subscribe( - s.add, observer.on_error, on_completed, scheduler=scheduler - ) - - return Observable(subscribe) - - return to_set - - -__all__ = ["to_set_"] diff --git a/frogpilot/third_party/reactivex/operators/_whiledo.py b/frogpilot/third_party/reactivex/operators/_whiledo.py deleted file mode 100644 index 61e6d8a6..00000000 --- a/frogpilot/third_party/reactivex/operators/_whiledo.py +++ /dev/null @@ -1,38 +0,0 @@ -import itertools -from asyncio import Future -from typing import Callable, TypeVar, Union - -import reactivex -from reactivex import Observable -from reactivex.internal.utils import infinite -from reactivex.typing import Predicate - -_T = TypeVar("_T") - - -def while_do_( - condition: Predicate[Observable[_T]], -) -> Callable[[Observable[_T]], Observable[_T]]: - def while_do(source: Union[Observable[_T], "Future[_T]"]) -> Observable[_T]: - """Repeats source as long as condition holds emulating a while - loop. - - Args: - source: The observable sequence that will be run if the - condition function returns true. - - Returns: - An observable sequence which is repeated as long as the - condition holds. - """ - if isinstance(source, Future): - obs = reactivex.from_future(source) - else: - obs = source - it = itertools.takewhile(condition, (obs for _ in infinite())) - return reactivex.concat_with_iterable(it) - - return while_do - - -__all__ = ["while_do_"] diff --git a/frogpilot/third_party/reactivex/operators/_window.py b/frogpilot/third_party/reactivex/operators/_window.py deleted file mode 100644 index d5aea599..00000000 --- a/frogpilot/third_party/reactivex/operators/_window.py +++ /dev/null @@ -1,177 +0,0 @@ -import logging -from typing import Any, Callable, Optional, Tuple, TypeVar - -from reactivex import Observable, abc, empty -from reactivex import operators as ops -from reactivex.disposable import ( - CompositeDisposable, - RefCountDisposable, - SerialDisposable, - SingleAssignmentDisposable, -) -from reactivex.internal import add_ref, noop -from reactivex.subject import Subject - -log = logging.getLogger("Rx") - -_T = TypeVar("_T") - - -def window_toggle_( - openings: Observable[Any], closing_mapper: Callable[[Any], Observable[Any]] -) -> Callable[[Observable[_T]], Observable[Observable[_T]]]: - """Projects each element of an observable sequence into zero or - more windows. - - Args: - source: Source observable to project into windows. - - Returns: - An observable sequence of windows. - """ - - def window_toggle(source: Observable[_T]) -> Observable[Observable[_T]]: - def mapper(args: Tuple[Any, Observable[_T]]): - _, window = args - return window - - return openings.pipe( - ops.group_join( - source, - closing_mapper, - lambda _: empty(), - ), - ops.map(mapper), - ) - - return window_toggle - - -def window_( - boundaries: Observable[Any], -) -> Callable[[Observable[_T]], Observable[Observable[_T]]]: - """Projects each element of an observable sequence into zero or - more windows. - - Args: - source: Source observable to project into windows. - - Returns: - An observable sequence of windows. - """ - - def window(source: Observable[_T]) -> Observable[Observable[_T]]: - def subscribe( - observer: abc.ObserverBase[Observable[_T]], - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - window_subject: Subject[_T] = Subject() - d = CompositeDisposable() - r = RefCountDisposable(d) - - observer.on_next(add_ref(window_subject, r)) - - def on_next_window(x: _T) -> None: - window_subject.on_next(x) - - def on_error(err: Exception) -> None: - window_subject.on_error(err) - observer.on_error(err) - - def on_completed() -> None: - window_subject.on_completed() - observer.on_completed() - - d.add( - source.subscribe( - on_next_window, on_error, on_completed, scheduler=scheduler - ) - ) - - def on_next_observer(w: Observable[_T]): - nonlocal window_subject - window_subject.on_completed() - window_subject = Subject() - observer.on_next(add_ref(window_subject, r)) - - d.add( - boundaries.subscribe( - on_next_observer, on_error, on_completed, scheduler=scheduler - ) - ) - return r - - return Observable(subscribe) - - return window - - -def window_when_( - closing_mapper: Callable[[], Observable[Any]] -) -> Callable[[Observable[_T]], Observable[Observable[_T]]]: - """Projects each element of an observable sequence into zero or - more windows. - - Args: - source: Source observable to project into windows. - - Returns: - An observable sequence of windows. - """ - - def window_when(source: Observable[_T]) -> Observable[Observable[_T]]: - def subscribe( - observer: abc.ObserverBase[Observable[_T]], - scheduler: Optional[abc.SchedulerBase] = None, - ): - m = SerialDisposable() - d = CompositeDisposable(m) - r = RefCountDisposable(d) - window: Subject[_T] = Subject() - - observer.on_next(add_ref(window, r)) - - def on_next(value: _T) -> None: - window.on_next(value) - - def on_error(error: Exception) -> None: - window.on_error(error) - observer.on_error(error) - - def on_completed() -> None: - window.on_completed() - observer.on_completed() - - d.add( - source.subscribe(on_next, on_error, on_completed, scheduler=scheduler) - ) - - def create_window_on_completed(): - try: - window_close = closing_mapper() - except Exception as exception: - observer.on_error(exception) - return - - def on_completed(): - nonlocal window - window.on_completed() - window = Subject() - observer.on_next(add_ref(window, r)) - create_window_on_completed() - - m1 = SingleAssignmentDisposable() - m.disposable = m1 - m1.disposable = window_close.pipe(ops.take(1)).subscribe( - noop, on_error, on_completed, scheduler=scheduler - ) - - create_window_on_completed() - return r - - return Observable(subscribe) - - return window_when - - -__all__ = ["window_", "window_when_", "window_toggle_"] diff --git a/frogpilot/third_party/reactivex/operators/_windowwithcount.py b/frogpilot/third_party/reactivex/operators/_windowwithcount.py deleted file mode 100644 index 6710a28b..00000000 --- a/frogpilot/third_party/reactivex/operators/_windowwithcount.py +++ /dev/null @@ -1,92 +0,0 @@ -import logging -from typing import Callable, List, Optional, TypeVar - -from reactivex import Observable, abc -from reactivex.disposable import RefCountDisposable, SingleAssignmentDisposable -from reactivex.internal import ArgumentOutOfRangeException, add_ref -from reactivex.subject import Subject - -log = logging.getLogger("Rx") - -_T = TypeVar("_T") - - -def window_with_count_( - count: int, skip: Optional[int] = None -) -> Callable[[Observable[_T]], Observable[Observable[_T]]]: - """Projects each element of an observable sequence into zero or more - windows which are produced based on element count information. - - Examples: - >>> window_with_count(10) - >>> window_with_count(10, 1) - - Args: - count: Length of each window. - skip: [Optional] Number of elements to skip between creation of - consecutive windows. If not specified, defaults to the - count. - - Returns: - An observable sequence of windows. - """ - - if count <= 0: - raise ArgumentOutOfRangeException() - - skip_ = skip if skip is not None else count - - if skip_ <= 0: - raise ArgumentOutOfRangeException() - - def window_with_count(source: Observable[_T]) -> Observable[Observable[_T]]: - def subscribe( - observer: abc.ObserverBase[Observable[_T]], - scheduler: Optional[abc.SchedulerBase] = None, - ): - m = SingleAssignmentDisposable() - refCountDisposable = RefCountDisposable(m) - n = [0] - q: List[Subject[_T]] = [] - - def create_window(): - s: Subject[_T] = Subject() - q.append(s) - observer.on_next(add_ref(s, refCountDisposable)) - - create_window() - - def on_next(x: _T) -> None: - for item in q: - item.on_next(x) - - c = n[0] - count + 1 - if c >= 0 and c % skip_ == 0: - s = q.pop(0) - s.on_completed() - - n[0] += 1 - if (n[0] % skip_) == 0: - create_window() - - def on_error(exception: Exception) -> None: - while q: - q.pop(0).on_error(exception) - observer.on_error(exception) - - def on_completed() -> None: - while q: - q.pop(0).on_completed() - observer.on_completed() - - m.disposable = source.subscribe( - on_next, on_error, on_completed, scheduler=scheduler - ) - return refCountDisposable - - return Observable(subscribe) - - return window_with_count - - -__all__ = ["window_with_count_"] diff --git a/frogpilot/third_party/reactivex/operators/_windowwithtime.py b/frogpilot/third_party/reactivex/operators/_windowwithtime.py deleted file mode 100644 index 83038a06..00000000 --- a/frogpilot/third_party/reactivex/operators/_windowwithtime.py +++ /dev/null @@ -1,121 +0,0 @@ -from datetime import timedelta -from typing import Any, Callable, List, Optional, TypeVar - -from reactivex import Observable, abc, typing -from reactivex.disposable import ( - CompositeDisposable, - RefCountDisposable, - SerialDisposable, - SingleAssignmentDisposable, -) -from reactivex.internal import DELTA_ZERO, add_ref, synchronized -from reactivex.scheduler import TimeoutScheduler -from reactivex.subject import Subject - -_T = TypeVar("_T") - - -def window_with_time_( - timespan: typing.RelativeTime, - timeshift: Optional[typing.RelativeTime] = None, - scheduler: Optional[abc.SchedulerBase] = None, -) -> Callable[[Observable[_T]], Observable[Observable[_T]]]: - if timeshift is None: - timeshift = timespan - - if not isinstance(timespan, timedelta): - timespan = timedelta(seconds=timespan) - if not isinstance(timeshift, timedelta): - timeshift = timedelta(seconds=timeshift) - - def window_with_time(source: Observable[_T]) -> Observable[Observable[_T]]: - def subscribe( - observer: abc.ObserverBase[Observable[_T]], - scheduler_: Optional[abc.SchedulerBase] = None, - ): - _scheduler = scheduler or scheduler_ or TimeoutScheduler.singleton() - - timer_d = SerialDisposable() - next_shift = [timeshift] - next_span = [timespan] - total_time = [DELTA_ZERO] - queue: List[Subject[_T]] = [] - - group_disposable = CompositeDisposable(timer_d) - ref_count_disposable = RefCountDisposable(group_disposable) - - def create_timer(): - m = SingleAssignmentDisposable() - timer_d.disposable = m - is_span = False - is_shift = False - - if next_span[0] == next_shift[0]: - is_span = True - is_shift = True - elif next_span[0] < next_shift[0]: - is_span = True - else: - is_shift = True - - new_total_time = next_span[0] if is_span else next_shift[0] - - ts = new_total_time - total_time[0] - total_time[0] = new_total_time - if is_span: - next_span[0] += timeshift - - if is_shift: - next_shift[0] += timeshift - - @synchronized(source.lock) - def action(scheduler: abc.SchedulerBase, state: Any = None): - s: Optional[Subject[_T]] = None - - if is_shift: - s = Subject() - queue.append(s) - observer.on_next(add_ref(s, ref_count_disposable)) - - if is_span: - s = queue.pop(0) - s.on_completed() - - create_timer() - - m.disposable = _scheduler.schedule_relative(ts, action) - - queue.append(Subject()) - observer.on_next(add_ref(queue[0], ref_count_disposable)) - create_timer() - - def on_next(x: _T) -> None: - with source.lock: - for s in queue: - s.on_next(x) - - @synchronized(source.lock) - def on_error(e: Exception) -> None: - for s in queue: - s.on_error(e) - - observer.on_error(e) - - @synchronized(source.lock) - def on_completed() -> None: - for s in queue: - s.on_completed() - - observer.on_completed() - - group_disposable.add( - source.subscribe(on_next, on_error, on_completed, scheduler=scheduler_) - ) - return ref_count_disposable - - return Observable(subscribe) - - return window_with_time - - -__all__ = ["window_with_time_"] diff --git a/frogpilot/third_party/reactivex/operators/_windowwithtimeorcount.py b/frogpilot/third_party/reactivex/operators/_windowwithtimeorcount.py deleted file mode 100644 index 5dc9581c..00000000 --- a/frogpilot/third_party/reactivex/operators/_windowwithtimeorcount.py +++ /dev/null @@ -1,96 +0,0 @@ -from typing import Any, Callable, Optional, TypeVar - -from reactivex import Observable, abc, typing -from reactivex.disposable import ( - CompositeDisposable, - RefCountDisposable, - SerialDisposable, - SingleAssignmentDisposable, -) -from reactivex.internal import add_ref -from reactivex.scheduler import TimeoutScheduler -from reactivex.subject import Subject - -_T = TypeVar("_T") - - -def window_with_time_or_count_( - timespan: typing.RelativeTime, - count: int, - scheduler: Optional[abc.SchedulerBase] = None, -) -> Callable[[Observable[_T]], Observable[Observable[_T]]]: - def window_with_time_or_count(source: Observable[_T]) -> Observable[Observable[_T]]: - def subscribe( - observer: abc.ObserverBase[Observable[_T]], - scheduler_: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - _scheduler = scheduler or scheduler_ or TimeoutScheduler.singleton() - - n: int = 0 - s: Subject[_T] = Subject() - timer_d = SerialDisposable() - window_id = 0 - group_disposable = CompositeDisposable(timer_d) - ref_count_disposable = RefCountDisposable(group_disposable) - - def create_timer(_id: int): - nonlocal n, s, window_id - m = SingleAssignmentDisposable() - timer_d.disposable = m - - def action(scheduler: abc.SchedulerBase, state: Any = None): - nonlocal n, s, window_id - if _id != window_id: - return - - n = 0 - window_id += 1 - new_id = window_id - s.on_completed() - s = Subject() - observer.on_next(add_ref(s, ref_count_disposable)) - create_timer(new_id) - - m.disposable = _scheduler.schedule_relative(timespan, action) - - observer.on_next(add_ref(s, ref_count_disposable)) - create_timer(0) - - def on_next(x: _T) -> None: - nonlocal n, s, window_id - new_window = False - new_id = 0 - - s.on_next(x) - n += 1 - if n == count: - new_window = True - n = 0 - window_id += 1 - new_id = window_id - s.on_completed() - s = Subject() - observer.on_next(add_ref(s, ref_count_disposable)) - - if new_window: - create_timer(new_id) - - def on_error(e: Exception) -> None: - s.on_error(e) - observer.on_error(e) - - def on_completed() -> None: - s.on_completed() - observer.on_completed() - - group_disposable.add( - source.subscribe(on_next, on_error, on_completed, scheduler=scheduler_) - ) - return ref_count_disposable - - return Observable(subscribe) - - return window_with_time_or_count - - -__all__ = ["window_with_time_or_count_"] diff --git a/frogpilot/third_party/reactivex/operators/_withlatestfrom.py b/frogpilot/third_party/reactivex/operators/_withlatestfrom.py deleted file mode 100644 index b0309efc..00000000 --- a/frogpilot/third_party/reactivex/operators/_withlatestfrom.py +++ /dev/null @@ -1,32 +0,0 @@ -from typing import Any, Callable - -import reactivex -from reactivex import Observable - - -def with_latest_from_( - *sources: Observable[Any], -) -> Callable[[Observable[Any]], Observable[Any]]: - """With latest from operator. - - Merges the specified observable sequences into one observable - sequence by creating a tuple only when the first - observable sequence produces an element. The observables can be - passed either as seperate arguments or as a list. - - Examples: - >>> op = with_latest_from(obs1) - >>> op = with_latest_from(obs1, obs2, obs3) - - Returns: - An observable sequence containing the result of combining - elements of the sources into a tuple. - """ - - def with_latest_from(source: Observable[Any]) -> Observable[Any]: - return reactivex.with_latest_from(source, *sources) - - return with_latest_from - - -__all__ = ["with_latest_from_"] diff --git a/frogpilot/third_party/reactivex/operators/_zip.py b/frogpilot/third_party/reactivex/operators/_zip.py deleted file mode 100644 index f56a3d12..00000000 --- a/frogpilot/third_party/reactivex/operators/_zip.py +++ /dev/null @@ -1,83 +0,0 @@ -from typing import Any, Callable, Iterable, Optional, Tuple, TypeVar - -import reactivex -from reactivex import Observable, abc - -_T = TypeVar("_T") -_TOther = TypeVar("_TOther") - - -def zip_( - *args: Observable[Any], -) -> Callable[[Observable[Any]], Observable[Tuple[Any, ...]]]: - def _zip(source: Observable[Any]) -> Observable[Tuple[Any, ...]]: - """Merges the specified observable sequences into one observable - sequence by creating a tuple whenever all of the - observable sequences have produced an element at a corresponding - index. - - Example: - >>> res = zip(source) - - Args: - source: Source observable to zip. - - Returns: - An observable sequence containing the result of combining - elements of the sources as a tuple. - """ - return reactivex.zip(source, *args) - - return _zip - - -def zip_with_iterable_( - seq: Iterable[_TOther], -) -> Callable[[Observable[_T]], Observable[Tuple[_T, _TOther]]]: - def zip_with_iterable(source: Observable[_T]) -> Observable[Tuple[_T, _TOther]]: - """Merges the specified observable sequence and list into one - observable sequence by creating a tuple whenever all of - the observable sequences have produced an element at a - corresponding index. - - Example - >>> res = zip(source) - - Args: - source: Source observable to zip. - - Returns: - An observable sequence containing the result of combining - elements of the sources as a tuple. - """ - - first = source - second = iter(seq) - - def subscribe( - observer: abc.ObserverBase[Tuple[_T, _TOther]], - scheduler: Optional[abc.SchedulerBase] = None, - ): - index = 0 - - def on_next(left: _T) -> None: - nonlocal index - - try: - right = next(second) - except StopIteration: - observer.on_completed() - else: - result = (left, right) - observer.on_next(result) - - return first.subscribe( - on_next, observer.on_error, observer.on_completed, scheduler=scheduler - ) - - return Observable(subscribe) - - return zip_with_iterable - - -__all__ = ["zip_", "zip_with_iterable_"] diff --git a/frogpilot/third_party/reactivex/operators/connectable/__init__.py b/frogpilot/third_party/reactivex/operators/connectable/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/frogpilot/third_party/reactivex/operators/connectable/_refcount.py b/frogpilot/third_party/reactivex/operators/connectable/_refcount.py deleted file mode 100644 index 08224b35..00000000 --- a/frogpilot/third_party/reactivex/operators/connectable/_refcount.py +++ /dev/null @@ -1,46 +0,0 @@ -from typing import Callable, Optional, TypeVar - -from reactivex import ConnectableObservable, Observable, abc -from reactivex.disposable import Disposable - -_T = TypeVar("_T") - - -def ref_count_() -> Callable[[ConnectableObservable[_T]], Observable[_T]]: - """Returns an observable sequence that stays connected to the - source as long as there is at least one subscription to the - observable sequence. - """ - - connectable_subscription: Optional[abc.DisposableBase] = None - count = 0 - - def ref_count(source: ConnectableObservable[_T]) -> Observable[_T]: - def subscribe( - observer: abc.ObserverBase[_T], - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - nonlocal connectable_subscription, count - - count += 1 - should_connect = count == 1 - subscription = source.subscribe(observer, scheduler=scheduler) - if should_connect: - connectable_subscription = source.connect(scheduler) - - def dispose() -> None: - nonlocal connectable_subscription, count - - subscription.dispose() - count -= 1 - if not count and connectable_subscription: - connectable_subscription.dispose() - - return Disposable(dispose) - - return Observable(subscribe) - - return ref_count - - -__all__ = ["ref_count_"] diff --git a/frogpilot/third_party/reactivex/pipe.py b/frogpilot/third_party/reactivex/pipe.py deleted file mode 100644 index 82deb392..00000000 --- a/frogpilot/third_party/reactivex/pipe.py +++ /dev/null @@ -1,203 +0,0 @@ -from functools import reduce -from typing import Any, Callable, TypeVar, overload - -_A = TypeVar("_A") -_B = TypeVar("_B") -_C = TypeVar("_C") -_D = TypeVar("_D") -_E = TypeVar("_E") -_F = TypeVar("_F") -_G = TypeVar("_G") -_H = TypeVar("_H") -_T = TypeVar("_T") -_J = TypeVar("_J") - - -@overload -def compose(__op1: Callable[[_A], _B]) -> Callable[[_A], _B]: ... - - -@overload -def compose( - __op1: Callable[[_A], _B], __op2: Callable[[_B], _C] -) -> Callable[[_A], _C]: ... - - -@overload -def compose( - __op1: Callable[[_A], _B], - __op2: Callable[[_B], _C], - __op3: Callable[[_C], _D], -) -> Callable[[_A], _D]: ... - - -@overload -def compose( - __op1: Callable[[_A], _B], - __op2: Callable[[_B], _C], - __op3: Callable[[_C], _D], - __op4: Callable[[_D], _E], -) -> Callable[[_A], _E]: ... - - -@overload -def compose( - __op1: Callable[[_A], _B], - __op2: Callable[[_B], _C], - __op3: Callable[[_C], _D], - __op4: Callable[[_D], _E], - __op5: Callable[[_E], _F], -) -> Callable[[_A], _F]: ... - - -@overload -def compose( - __op1: Callable[[_A], _B], - __op2: Callable[[_B], _C], - __op3: Callable[[_C], _D], - __op4: Callable[[_D], _E], - __op5: Callable[[_E], _F], - __op6: Callable[[_F], _G], -) -> Callable[[_A], _G]: ... - - -def compose(*operators: Callable[[Any], Any]) -> Callable[[Any], Any]: - """Compose multiple operators left to right. - - Composes zero or more operators into a functional composition. The - operators are composed to left to right. A composition of zero - operators gives back the source. - - Examples: - >>> pipe()(source) == source - >>> pipe(f)(source) == f(source) - >>> pipe(f, g)(source) == g(f(source)) - >>> pipe(f, g, h)(source) == h(g(f(source))) - ... - - Returns: - The composed observable. - """ - - def _compose(source: Any) -> Any: - return reduce(lambda obs, op: op(obs), operators, source) - - return _compose - - -@overload -def pipe(__value: _A) -> _A: ... - - -@overload -def pipe(__value: _A, __fn1: Callable[[_A], _B]) -> _B: ... - - -@overload -def pipe( - __value: _A, - __fn1: Callable[[_A], _B], - __fn2: Callable[[_B], _C], -) -> _C: ... - - -@overload -def pipe( - __value: _A, - __fn1: Callable[[_A], _B], - __fn2: Callable[[_B], _C], - __fn3: Callable[[_C], _D], -) -> _D: ... - - -@overload -def pipe( - __value: _A, - __fn1: Callable[[_A], _B], - __fn2: Callable[[_B], _C], - __fn3: Callable[[_C], _D], - __fn4: Callable[[_D], _E], -) -> _E: ... - - -@overload -def pipe( - __value: _A, - __fn1: Callable[[_A], _B], - __fn2: Callable[[_B], _C], - __fn3: Callable[[_C], _D], - __fn4: Callable[[_D], _E], - __fn5: Callable[[_E], _F], -) -> _F: ... - - -@overload -def pipe( - __value: _A, - __fn1: Callable[[_A], _B], - __fn2: Callable[[_B], _C], - __fn3: Callable[[_C], _D], - __fn4: Callable[[_D], _E], - __fn5: Callable[[_E], _F], - __fn6: Callable[[_F], _G], -) -> _G: ... - - -@overload -def pipe( - __value: _A, - __fn1: Callable[[_A], _B], - __fn2: Callable[[_B], _C], - __fn3: Callable[[_C], _D], - __fn4: Callable[[_D], _E], - __fn5: Callable[[_E], _F], - __fn6: Callable[[_F], _G], - __fn7: Callable[[_G], _H], -) -> _H: ... - - -@overload -def pipe( - __value: _A, - __fn1: Callable[[_A], _B], - __fn2: Callable[[_B], _C], - __fn3: Callable[[_C], _D], - __fn4: Callable[[_D], _E], - __fn5: Callable[[_E], _F], - __fn6: Callable[[_F], _G], - __fn7: Callable[[_G], _H], - __fn8: Callable[[_H], _T], -) -> _T: ... - - -@overload -def pipe( - __value: _A, - __fn1: Callable[[_A], _B], - __fn2: Callable[[_B], _C], - __fn3: Callable[[_C], _D], - __fn4: Callable[[_D], _E], - __fn5: Callable[[_E], _F], - __fn6: Callable[[_F], _G], - __fn7: Callable[[_G], _H], - __fn8: Callable[[_H], _T], - __fn9: Callable[[_T], _J], -) -> _J: ... - - -def pipe(__value: Any, *fns: Callable[[Any], Any]) -> Any: - """Functional pipe (`|>`) - - Allows the use of function argument on the left side of the - function. - - Example: - >>> pipe(x, fn) == __fn(x) # Same as x |> fn - >>> pipe(x, fn, gn) == gn(fn(x)) # Same as x |> fn |> gn - ... - """ - - return compose(*fns)(__value) - - -__all__ = ["pipe", "compose"] diff --git a/frogpilot/third_party/reactivex/py.typed b/frogpilot/third_party/reactivex/py.typed deleted file mode 100644 index e69de29b..00000000 diff --git a/frogpilot/third_party/reactivex/run.py b/frogpilot/third_party/reactivex/run.py deleted file mode 100644 index 6e932b2e..00000000 --- a/frogpilot/third_party/reactivex/run.py +++ /dev/null @@ -1,69 +0,0 @@ -import threading -from typing import Optional, TypeVar, cast - -from reactivex.internal.exceptions import SequenceContainsNoElementsError -from reactivex.scheduler import NewThreadScheduler - -from .observable import Observable - -scheduler = NewThreadScheduler() - -_T = TypeVar("_T") - - -def run(source: Observable[_T]) -> _T: - """Run source synchronously. - - Subscribes to the observable source. Then blocks and waits for the - observable source to either complete or error. Returns the - last value emitted, or throws exception if any error occured. - - Examples: - >>> result = run(source) - - Args: - source: Observable source to run. - - Raises: - SequenceContainsNoElementsError: if observable completes - (on_completed) without any values being emitted. - Exception: raises exception if any error (on_error) occured. - - Returns: - The last element emitted from the observable. - """ - exception: Optional[Exception] = None - latch = threading.Event() - has_result = False - result: _T = cast(_T, None) - done = False - - def on_next(value: _T) -> None: - nonlocal result, has_result - result = value - has_result = True - - def on_error(error: Exception) -> None: - nonlocal exception, done - - exception = error - done = True - latch.set() - - def on_completed() -> None: - nonlocal done - done = True - latch.set() - - source.subscribe(on_next, on_error, on_completed, scheduler=scheduler) - - while not done: - latch.wait() - - if exception: - raise cast(Exception, exception) - - if not has_result: - raise SequenceContainsNoElementsError - - return result diff --git a/frogpilot/third_party/reactivex/scheduler/__init__.py b/frogpilot/third_party/reactivex/scheduler/__init__.py deleted file mode 100644 index 1205e829..00000000 --- a/frogpilot/third_party/reactivex/scheduler/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -from .catchscheduler import CatchScheduler -from .currentthreadscheduler import CurrentThreadScheduler -from .eventloopscheduler import EventLoopScheduler -from .historicalscheduler import HistoricalScheduler -from .immediatescheduler import ImmediateScheduler -from .newthreadscheduler import NewThreadScheduler -from .scheduleditem import ScheduledItem -from .threadpoolscheduler import ThreadPoolScheduler -from .timeoutscheduler import TimeoutScheduler -from .trampolinescheduler import TrampolineScheduler -from .virtualtimescheduler import VirtualTimeScheduler - -__all__ = [ - "CatchScheduler", - "CurrentThreadScheduler", - "EventLoopScheduler", - "HistoricalScheduler", - "ImmediateScheduler", - "NewThreadScheduler", - "ScheduledItem", - "ThreadPoolScheduler", - "TimeoutScheduler", - "TrampolineScheduler", - "VirtualTimeScheduler", -] diff --git a/frogpilot/third_party/reactivex/scheduler/catchscheduler.py b/frogpilot/third_party/reactivex/scheduler/catchscheduler.py deleted file mode 100644 index 787ac2d1..00000000 --- a/frogpilot/third_party/reactivex/scheduler/catchscheduler.py +++ /dev/null @@ -1,177 +0,0 @@ -from datetime import datetime -from typing import Callable, Optional, TypeVar, cast - -from reactivex import abc, typing -from reactivex.abc.scheduler import SchedulerBase -from reactivex.disposable import Disposable, SingleAssignmentDisposable - -from .periodicscheduler import PeriodicScheduler - -_TState = TypeVar("_TState") - - -class CatchScheduler(PeriodicScheduler): - def __init__( - self, scheduler: abc.SchedulerBase, handler: Callable[[Exception], bool] - ) -> None: - """Wraps a scheduler, passed as constructor argument, adding exception - handling for scheduled actions. The handler should return True to - indicate it handled the exception successfully. Falsy return values will - be taken to indicate that the exception should be escalated (raised by - this scheduler). - - Args: - scheduler: The scheduler to be wrapped. - handler: Callable to handle exceptions raised by wrapped scheduler. - """ - - super().__init__() - self._scheduler: abc.SchedulerBase = scheduler - self._handler: Callable[[Exception], bool] = handler - self._recursive_original: Optional[abc.SchedulerBase] = None - self._recursive_wrapper: Optional["CatchScheduler"] = None - - @property - def now(self) -> datetime: - """Represents a notion of time for this scheduler. Tasks being - scheduled on a scheduler will adhere to the time denoted by this - property. - - Returns: - The scheduler's current time, as a datetime instance. - """ - - return self._scheduler.now - - def schedule( - self, action: typing.ScheduledAction[_TState], state: Optional[_TState] = None - ) -> abc.DisposableBase: - """Schedules an action to be executed. - - Args: - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - action = self._wrap(action) - return self._scheduler.schedule(action, state=state) - - def schedule_relative( - self, - duetime: typing.RelativeTime, - action: typing.ScheduledAction[_TState], - state: Optional[_TState] = None, - ) -> abc.DisposableBase: - """Schedules an action to be executed after duetime. - - Args: - duetime: Relative time after which to execute the action. - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - action = self._wrap(action) - return self._scheduler.schedule_relative(duetime, action, state=state) - - def schedule_absolute( - self, - duetime: typing.AbsoluteTime, - action: typing.ScheduledAction[_TState], - state: Optional[_TState] = None, - ) -> abc.DisposableBase: - """Schedules an action to be executed at duetime. - - Args: - duetime: Absolute time at which to execute the action. - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - action = self._wrap(action) - return self._scheduler.schedule_absolute(duetime, action, state=state) - - def schedule_periodic( - self, - period: typing.RelativeTime, - action: typing.ScheduledPeriodicAction[_TState], - state: Optional[_TState] = None, - ) -> abc.DisposableBase: - """Schedules a periodic piece of work. - - Args: - period: Period in seconds or timedelta for running the - work periodically. - action: Action to be executed. - state: [Optional] Initial state passed to the action upon - the first iteration. - - Returns: - The disposable object used to cancel the scheduled - recurring action (best effort). - """ - - schedule_periodic = getattr(self._scheduler, "schedule_periodic") - if not callable(schedule_periodic): - raise NotImplementedError - - disp: SingleAssignmentDisposable = SingleAssignmentDisposable() - failed: bool = False - - def periodic(state: Optional[_TState] = None) -> Optional[_TState]: - nonlocal failed - if failed: - return None - try: - return action(state) - except Exception as ex: - failed = True - if not self._handler(ex): - raise - disp.dispose() - return None - - scheduler = cast(PeriodicScheduler, self._scheduler) - disp.disposable = scheduler.schedule_periodic(period, periodic, state=state) - return disp - - def _clone(self, scheduler: abc.SchedulerBase) -> "CatchScheduler": - return CatchScheduler(scheduler, self._handler) - - def _wrap( - self, action: typing.ScheduledAction[_TState] - ) -> typing.ScheduledAction[_TState]: - parent = self - - def wrapped_action( - self: abc.SchedulerBase, state: Optional[_TState] - ) -> Optional[abc.DisposableBase]: - try: - return action(parent._get_recursive_wrapper(self), state) - except Exception as ex: - if not parent._handler(ex): - raise - return Disposable() - - return wrapped_action - - def _get_recursive_wrapper(self, scheduler: SchedulerBase) -> "CatchScheduler": - if self._recursive_wrapper is None or self._recursive_original != scheduler: - self._recursive_original = scheduler - wrapper = self._clone(scheduler) - wrapper._recursive_original = scheduler - wrapper._recursive_wrapper = wrapper - self._recursive_wrapper = wrapper - - return self._recursive_wrapper diff --git a/frogpilot/third_party/reactivex/scheduler/currentthreadscheduler.py b/frogpilot/third_party/reactivex/scheduler/currentthreadscheduler.py deleted file mode 100644 index 42a314b9..00000000 --- a/frogpilot/third_party/reactivex/scheduler/currentthreadscheduler.py +++ /dev/null @@ -1,81 +0,0 @@ -import logging -from threading import Thread, current_thread, local -from typing import MutableMapping -from weakref import WeakKeyDictionary - -from .trampoline import Trampoline -from .trampolinescheduler import TrampolineScheduler - -log = logging.getLogger("Rx") - - -class CurrentThreadScheduler(TrampolineScheduler): - """Represents an object that schedules units of work on the current thread. - You should never schedule timeouts using the *CurrentThreadScheduler*, as - that will block the thread while waiting. - - Each instance manages a number of trampolines (and queues), one for each - thread that calls a *schedule* method. These trampolines are automatically - garbage-collected when threads disappear, because they're stored in a weak - key dictionary. - """ - - _global: MutableMapping[type, MutableMapping[Thread, "CurrentThreadScheduler"]] = ( - WeakKeyDictionary() - ) - - @classmethod - def singleton(cls) -> "CurrentThreadScheduler": - """ - Obtain a singleton instance for the current thread. Please note, if you - pass this instance to another thread, it will effectively behave as - if it were created by that other thread (separate trampoline and queue). - - Returns: - The singleton *CurrentThreadScheduler* instance. - """ - thread = current_thread() - class_map = CurrentThreadScheduler._global.get(cls) - if class_map is None: - class_map_: MutableMapping[Thread, "CurrentThreadScheduler"] = ( - WeakKeyDictionary() - ) - CurrentThreadScheduler._global[cls] = class_map_ - else: - class_map_ = class_map - try: - self = class_map_[thread] - except KeyError: - self = CurrentThreadSchedulerSingleton() - class_map_[thread] = self - return self - - # pylint: disable=super-init-not-called - def __init__(self) -> None: - self._tramps: MutableMapping[Thread, Trampoline] = WeakKeyDictionary() - - def get_trampoline(self) -> Trampoline: - thread = current_thread() - tramp = self._tramps.get(thread) - if tramp is None: - tramp = Trampoline() - self._tramps[thread] = tramp - return tramp - - -class _Local(local): - def __init__(self) -> None: - super().__init__() - self.tramp = Trampoline() - - -class CurrentThreadSchedulerSingleton(CurrentThreadScheduler): - - _local = _Local() - - # pylint: disable=super-init-not-called - def __init__(self) -> None: - pass - - def get_trampoline(self) -> Trampoline: - return CurrentThreadSchedulerSingleton._local.tramp diff --git a/frogpilot/third_party/reactivex/scheduler/eventloop/__init__.py b/frogpilot/third_party/reactivex/scheduler/eventloop/__init__.py deleted file mode 100644 index 6a11e13a..00000000 --- a/frogpilot/third_party/reactivex/scheduler/eventloop/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -from .asyncioscheduler import AsyncIOScheduler -from .asynciothreadsafescheduler import AsyncIOThreadSafeScheduler -from .eventletscheduler import EventletScheduler -from .geventscheduler import GEventScheduler -from .ioloopscheduler import IOLoopScheduler -from .twistedscheduler import TwistedScheduler - -__all__ = [ - "AsyncIOScheduler", - "AsyncIOThreadSafeScheduler", - "EventletScheduler", - "GEventScheduler", - "IOLoopScheduler", - "TwistedScheduler", -] diff --git a/frogpilot/third_party/reactivex/scheduler/eventloop/asyncioscheduler.py b/frogpilot/third_party/reactivex/scheduler/eventloop/asyncioscheduler.py deleted file mode 100644 index 16d9f64a..00000000 --- a/frogpilot/third_party/reactivex/scheduler/eventloop/asyncioscheduler.py +++ /dev/null @@ -1,123 +0,0 @@ -import asyncio -import logging -from datetime import datetime -from typing import Optional, TypeVar - -from reactivex import abc, typing -from reactivex.disposable import ( - CompositeDisposable, - Disposable, - SingleAssignmentDisposable, -) - -from ..periodicscheduler import PeriodicScheduler - -_TState = TypeVar("_TState") -log = logging.getLogger("Rx") - - -class AsyncIOScheduler(PeriodicScheduler): - """A scheduler that schedules work via the asyncio mainloop. This class - does not use the asyncio threadsafe methods, if you need those please use - the AsyncIOThreadSafeScheduler class.""" - - def __init__(self, loop: asyncio.AbstractEventLoop) -> None: - """Create a new AsyncIOScheduler. - - Args: - loop: Instance of asyncio event loop to use; typically, you would - get this by asyncio.get_event_loop() - """ - super().__init__() - self._loop: asyncio.AbstractEventLoop = loop - - def schedule( - self, action: typing.ScheduledAction[_TState], state: Optional[_TState] = None - ) -> abc.DisposableBase: - """Schedules an action to be executed. - - Args: - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - sad = SingleAssignmentDisposable() - - def interval() -> None: - sad.disposable = self.invoke_action(action, state=state) - - handle = self._loop.call_soon(interval) - - def dispose() -> None: - handle.cancel() - - return CompositeDisposable(sad, Disposable(dispose)) - - def schedule_relative( - self, - duetime: typing.RelativeTime, - action: typing.ScheduledAction[_TState], - state: Optional[_TState] = None, - ) -> abc.DisposableBase: - """Schedules an action to be executed after duetime. - - Args: - duetime: Relative time after which to execute the action. - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - seconds = self.to_seconds(duetime) - if seconds <= 0: - return self.schedule(action, state) - - sad = SingleAssignmentDisposable() - - def interval() -> None: - sad.disposable = self.invoke_action(action, state=state) - - handle = self._loop.call_later(seconds, interval) - - def dispose() -> None: - handle.cancel() - - return CompositeDisposable(sad, Disposable(dispose)) - - def schedule_absolute( - self, - duetime: typing.AbsoluteTime, - action: typing.ScheduledAction[_TState], - state: Optional[_TState] = None, - ) -> abc.DisposableBase: - """Schedules an action to be executed at duetime. - - Args: - duetime: Absolute time at which to execute the action. - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - duetime = self.to_datetime(duetime) - return self.schedule_relative(duetime - self.now, action, state=state) - - @property - def now(self) -> datetime: - """Represents a notion of time for this scheduler. Tasks being - scheduled on a scheduler will adhere to the time denoted by this - property. - - Returns: - The scheduler's current time, as a datetime instance. - """ - - return self.to_datetime(self._loop.time()) diff --git a/frogpilot/third_party/reactivex/scheduler/eventloop/asynciothreadsafescheduler.py b/frogpilot/third_party/reactivex/scheduler/eventloop/asynciothreadsafescheduler.py deleted file mode 100644 index 9287419a..00000000 --- a/frogpilot/third_party/reactivex/scheduler/eventloop/asynciothreadsafescheduler.py +++ /dev/null @@ -1,157 +0,0 @@ -import asyncio -import logging -from concurrent.futures import Future -from typing import List, Optional, TypeVar - -from reactivex import abc, typing -from reactivex.disposable import ( - CompositeDisposable, - Disposable, - SingleAssignmentDisposable, -) - -from .asyncioscheduler import AsyncIOScheduler - -_TState = TypeVar("_TState") - -log = logging.getLogger("Rx") - - -class AsyncIOThreadSafeScheduler(AsyncIOScheduler): - """A scheduler that schedules work via the asyncio mainloop. This is a - subclass of AsyncIOScheduler which uses the threadsafe asyncio methods. - """ - - def schedule( - self, action: typing.ScheduledAction[_TState], state: Optional[_TState] = None - ) -> abc.DisposableBase: - """Schedules an action to be executed. - - Args: - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - sad = SingleAssignmentDisposable() - - def interval() -> None: - sad.disposable = self.invoke_action(action, state=state) - - handle = self._loop.call_soon_threadsafe(interval) - - def dispose() -> None: - if self._on_self_loop_or_not_running(): - handle.cancel() - return - - future: "Future[int]" = Future() - - def cancel_handle() -> None: - handle.cancel() - future.set_result(0) - - self._loop.call_soon_threadsafe(cancel_handle) - future.result() - - return CompositeDisposable(sad, Disposable(dispose)) - - def schedule_relative( - self, - duetime: typing.RelativeTime, - action: typing.ScheduledAction[_TState], - state: Optional[_TState] = None, - ) -> abc.DisposableBase: - """Schedules an action to be executed after duetime. - - Args: - duetime: Relative time after which to execute the action. - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - seconds = self.to_seconds(duetime) - if seconds <= 0: - return self.schedule(action, state=state) - - sad = SingleAssignmentDisposable() - - def interval() -> None: - sad.disposable = self.invoke_action(action, state=state) - - # the operations on the list used here are atomic, so there is no - # need to protect its access with a lock - handle: List[asyncio.Handle] = [] - - def stage2() -> None: - handle.append(self._loop.call_later(seconds, interval)) - - handle.append(self._loop.call_soon_threadsafe(stage2)) - - def dispose() -> None: - def do_cancel_handles() -> None: - try: - handle.pop().cancel() - handle.pop().cancel() - except Exception: - pass - - if self._on_self_loop_or_not_running(): - do_cancel_handles() - return - - future: "Future[int]" = Future() - - def cancel_handle() -> None: - do_cancel_handles() - future.set_result(0) - - self._loop.call_soon_threadsafe(cancel_handle) - future.result() - - return CompositeDisposable(sad, Disposable(dispose)) - - def schedule_absolute( - self, - duetime: typing.AbsoluteTime, - action: typing.ScheduledAction[_TState], - state: Optional[_TState] = None, - ) -> abc.DisposableBase: - """Schedules an action to be executed at duetime. - - Args: - duetime: Absolute time at which to execute the action. - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - duetime = self.to_datetime(duetime) - return self.schedule_relative(duetime - self.now, action, state=state) - - def _on_self_loop_or_not_running(self) -> bool: - """ - Returns True if either self._loop is not running, or we're currently - executing on self._loop. In both cases, waiting for a future to be - resolved on the loop would result in a deadlock. - """ - if not self._loop.is_running(): - return True - current_loop = None - try: - # In python 3.7 there asyncio.get_running_loop() is prefered. - current_loop = asyncio.get_event_loop() - except RuntimeError: - # If there is no loop in current thread at all, and it is not main - # thread, we get error like: - # RuntimeError: There is no current event loop in thread 'Thread-1' - pass - return self._loop == current_loop diff --git a/frogpilot/third_party/reactivex/scheduler/eventloop/eventletscheduler.py b/frogpilot/third_party/reactivex/scheduler/eventloop/eventletscheduler.py deleted file mode 100644 index 9c6d1faa..00000000 --- a/frogpilot/third_party/reactivex/scheduler/eventloop/eventletscheduler.py +++ /dev/null @@ -1,126 +0,0 @@ -import logging -from datetime import datetime -from typing import Any, Optional, TypeVar - -from reactivex import abc, typing -from reactivex.disposable import ( - CompositeDisposable, - Disposable, - SingleAssignmentDisposable, -) - -from ..periodicscheduler import PeriodicScheduler - -_TState = TypeVar("_TState") -log = logging.getLogger("Rx") - - -class EventletScheduler(PeriodicScheduler): - """A scheduler that schedules work via the eventlet event loop. - - http://eventlet.net/ - """ - - def __init__(self, eventlet: Any) -> None: - """Create a new EventletScheduler. - - Args: - eventlet: The eventlet module to use; typically, you would get this - by import eventlet - """ - - super().__init__() - self._eventlet = eventlet - - def schedule( - self, action: typing.ScheduledAction[_TState], state: Optional[_TState] = None - ) -> abc.DisposableBase: - """Schedules an action to be executed. - - Args: - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - sad = SingleAssignmentDisposable() - - def interval() -> None: - sad.disposable = self.invoke_action(action, state=state) - - timer = self._eventlet.spawn(interval) - - def dispose() -> None: - timer.kill() - - return CompositeDisposable(sad, Disposable(dispose)) - - def schedule_relative( - self, - duetime: typing.RelativeTime, - action: typing.ScheduledAction[_TState], - state: Optional[_TState] = None, - ) -> abc.DisposableBase: - """Schedules an action to be executed after duetime. - - Args: - duetime: Relative time after which to execute the action. - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - seconds = self.to_seconds(duetime) - if seconds <= 0.0: - return self.schedule(action, state=state) - - sad = SingleAssignmentDisposable() - - def interval() -> None: - sad.disposable = self.invoke_action(action, state=state) - - timer = self._eventlet.spawn_after(seconds, interval) - - def dispose() -> None: - timer.kill() - - return CompositeDisposable(sad, Disposable(dispose)) - - def schedule_absolute( - self, - duetime: typing.AbsoluteTime, - action: typing.ScheduledAction[_TState], - state: Optional[_TState] = None, - ) -> abc.DisposableBase: - """Schedules an action to be executed at duetime. - - Args: - duetime: Absolute time at which to execute the action. - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - duetime = self.to_datetime(duetime) - return self.schedule_relative(duetime - self.now, action, state=state) - - @property - def now(self) -> datetime: - """Represents a notion of time for this scheduler. Tasks being - scheduled on a scheduler will adhere to the time denoted by this - property. - - Returns: - The scheduler's current time, as a datetime instance. - """ - - return self.to_datetime(self._eventlet.hubs.get_hub().clock()) diff --git a/frogpilot/third_party/reactivex/scheduler/eventloop/geventscheduler.py b/frogpilot/third_party/reactivex/scheduler/eventloop/geventscheduler.py deleted file mode 100644 index 020b8256..00000000 --- a/frogpilot/third_party/reactivex/scheduler/eventloop/geventscheduler.py +++ /dev/null @@ -1,127 +0,0 @@ -import logging -from datetime import datetime -from typing import Any, Optional, TypeVar - -from reactivex import abc, typing -from reactivex.disposable import ( - CompositeDisposable, - Disposable, - SingleAssignmentDisposable, -) - -from ..periodicscheduler import PeriodicScheduler - -_TState = TypeVar("_TState") -log = logging.getLogger("Rx") - - -class GEventScheduler(PeriodicScheduler): - """A scheduler that schedules work via the GEvent event loop. - - http://www.gevent.org/ - """ - - def __init__(self, gevent: Any) -> None: - """Create a new GEventScheduler. - - Args: - gevent: The gevent module to use; typically ,you would get this by - import gevent - """ - - super().__init__() - self._gevent = gevent - - def schedule( - self, action: typing.ScheduledAction[_TState], state: Optional[_TState] = None - ) -> abc.DisposableBase: - """Schedules an action to be executed. - - Args: - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - sad = SingleAssignmentDisposable() - - def interval() -> None: - sad.disposable = self.invoke_action(action, state=state) - - timer = self._gevent.spawn(interval) - - def dispose() -> None: - timer.kill(block=False) - - return CompositeDisposable(sad, Disposable(dispose)) - - def schedule_relative( - self, - duetime: typing.RelativeTime, - action: typing.ScheduledAction[_TState], - state: Optional[_TState] = None, - ) -> abc.DisposableBase: - """Schedules an action to be executed after duetime. - - Args: - duetime: Relative time after which to execute the action. - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - seconds = self.to_seconds(duetime) - if seconds <= 0.0: - return self.schedule(action, state=state) - - sad = SingleAssignmentDisposable() - - def interval() -> None: - sad.disposable = self.invoke_action(action, state=state) - - log.debug("timeout: %s", seconds) - timer = self._gevent.spawn_later(seconds, interval) - - def dispose() -> None: - timer.kill(block=False) - - return CompositeDisposable(sad, Disposable(dispose)) - - def schedule_absolute( - self, - duetime: typing.AbsoluteTime, - action: typing.ScheduledAction[_TState], - state: Optional[_TState] = None, - ) -> abc.DisposableBase: - """Schedules an action to be executed at duetime. - - Args: - duetime: Absolute time at which to execute the action. - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - duetime = self.to_datetime(duetime) - return self.schedule_relative(duetime - self.now, action, state=state) - - @property - def now(self) -> datetime: - """Represents a notion of time for this scheduler. Tasks being - scheduled on a scheduler will adhere to the time denoted by this - property. - - Returns: - The scheduler's current time, as a datetime instance. - """ - - return self.to_datetime(self._gevent.get_hub().loop.now()) diff --git a/frogpilot/third_party/reactivex/scheduler/eventloop/ioloopscheduler.py b/frogpilot/third_party/reactivex/scheduler/eventloop/ioloopscheduler.py deleted file mode 100644 index 187bc864..00000000 --- a/frogpilot/third_party/reactivex/scheduler/eventloop/ioloopscheduler.py +++ /dev/null @@ -1,132 +0,0 @@ -import logging -from datetime import datetime -from typing import Any, Optional, TypeVar - -from reactivex import abc, typing -from reactivex.disposable import ( - CompositeDisposable, - Disposable, - SingleAssignmentDisposable, -) - -from ..periodicscheduler import PeriodicScheduler - -_TState = TypeVar("_TState") -log = logging.getLogger("Rx") - - -class IOLoopScheduler(PeriodicScheduler): - """A scheduler that schedules work via the Tornado I/O main event loop. - - Note, as of Tornado 6, this is just a wrapper around the asyncio loop. - - http://tornado.readthedocs.org/en/latest/ioloop.html""" - - def __init__(self, loop: Any) -> None: - """Create a new IOLoopScheduler. - - Args: - loop: The ioloop to use; typically, you would get this by - tornado import ioloop; ioloop.IOLoop.current() - """ - - super().__init__() - self._loop = loop - - def schedule( - self, action: typing.ScheduledAction[_TState], state: Optional[_TState] = None - ) -> abc.DisposableBase: - """Schedules an action to be executed. - - Args: - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - sad = SingleAssignmentDisposable() - disposed = False - - def interval() -> None: - if not disposed: - sad.disposable = self.invoke_action(action, state=state) - - self._loop.add_callback(interval) - - def dispose() -> None: - nonlocal disposed - disposed = True - - return CompositeDisposable(sad, Disposable(dispose)) - - def schedule_relative( - self, - duetime: typing.RelativeTime, - action: typing.ScheduledAction[_TState], - state: Optional[_TState] = None, - ) -> abc.DisposableBase: - """Schedules an action to be executed after duetime. - - Args: - duetime: Relative time after which to execute the action. - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - seconds = self.to_seconds(duetime) - if seconds <= 0.0: - return self.schedule(action, state=state) - - sad = SingleAssignmentDisposable() - - def interval() -> None: - sad.disposable = self.invoke_action(action, state=state) - - log.debug("timeout: %s", seconds) - timer = self._loop.call_later(seconds, interval) - - def dispose() -> None: - self._loop.remove_timeout(timer) - self._loop.remove_timeout(timer) - - return CompositeDisposable(sad, Disposable(dispose)) - - def schedule_absolute( - self, - duetime: typing.AbsoluteTime, - action: typing.ScheduledAction[_TState], - state: Optional[_TState] = None, - ) -> abc.DisposableBase: - """Schedules an action to be executed at duetime. - - Args: - duetime: Absolute time at which to execute the action. - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - duetime = self.to_datetime(duetime) - return self.schedule_relative(duetime - self.now, action, state=state) - - @property - def now(self) -> datetime: - """Represents a notion of time for this scheduler. Tasks being - scheduled on a scheduler will adhere to the time denoted by this - property. - - Returns: - The scheduler's current time, as a datetime instance. - """ - - return self.to_datetime(self._loop.time()) diff --git a/frogpilot/third_party/reactivex/scheduler/eventloop/twistedscheduler.py b/frogpilot/third_party/reactivex/scheduler/eventloop/twistedscheduler.py deleted file mode 100644 index ea43a70b..00000000 --- a/frogpilot/third_party/reactivex/scheduler/eventloop/twistedscheduler.py +++ /dev/null @@ -1,113 +0,0 @@ -import logging -from datetime import datetime -from typing import Any, Optional, TypeVar - -from reactivex import abc, typing -from reactivex.disposable import ( - CompositeDisposable, - Disposable, - SingleAssignmentDisposable, -) - -from ..periodicscheduler import PeriodicScheduler - -_TState = TypeVar("_TState") -log = logging.getLogger("Rx") - - -class TwistedScheduler(PeriodicScheduler): - """A scheduler that schedules work via the Twisted reactor mainloop.""" - - def __init__(self, reactor: Any) -> None: - """Create a new TwistedScheduler. - - Args: - reactor: The reactor to use; typically, you would get this - by from twisted.internet import reactor - """ - - super().__init__() - self._reactor = reactor - - def schedule( - self, action: typing.ScheduledAction[_TState], state: Optional[_TState] = None - ) -> abc.DisposableBase: - """Schedules an action to be executed. - - Args: - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - return self.schedule_relative(0.0, action, state=state) - - def schedule_relative( - self, - duetime: typing.RelativeTime, - action: typing.ScheduledAction[_TState], - state: Optional[_TState] = None, - ) -> abc.DisposableBase: - """Schedules an action to be executed after duetime. - - Args: - duetime: Relative time after which to execute the action. - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - seconds = max(0.0, self.to_seconds(duetime)) - - sad = SingleAssignmentDisposable() - - def interval() -> None: - sad.disposable = action(self, state) - - log.debug("timeout: %s", seconds) - timer = self._reactor.callLater(seconds, interval) - - def dispose() -> None: - if not timer.called: - timer.cancel() - - return CompositeDisposable(sad, Disposable(dispose)) - - def schedule_absolute( - self, - duetime: typing.AbsoluteTime, - action: typing.ScheduledAction[_TState], - state: Optional[_TState] = None, - ) -> abc.DisposableBase: - """Schedules an action to be executed at duetime. - - Args: - duetime: Absolute time at which to execute the action. - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - duetime = self.to_datetime(duetime) - return self.schedule_relative(duetime - self.now, action, state=state) - - @property - def now(self) -> datetime: - """Represents a notion of time for this scheduler. Tasks being - scheduled on a scheduler will adhere to the time denoted by this - property. - - Returns: - The scheduler's current time, as a datetime instance. - """ - - return self.to_datetime(float(self._reactor.seconds())) diff --git a/frogpilot/third_party/reactivex/scheduler/eventloopscheduler.py b/frogpilot/third_party/reactivex/scheduler/eventloopscheduler.py deleted file mode 100644 index debda995..00000000 --- a/frogpilot/third_party/reactivex/scheduler/eventloopscheduler.py +++ /dev/null @@ -1,218 +0,0 @@ -import logging -import threading -from collections import deque -from typing import Deque, Optional, TypeVar - -from reactivex import abc, typing -from reactivex.disposable import Disposable -from reactivex.internal.concurrency import default_thread_factory -from reactivex.internal.constants import DELTA_ZERO -from reactivex.internal.exceptions import DisposedException -from reactivex.internal.priorityqueue import PriorityQueue - -from .periodicscheduler import PeriodicScheduler -from .scheduleditem import ScheduledItem - -log = logging.getLogger("Rx") - -_TState = TypeVar("_TState") - - -class EventLoopScheduler(PeriodicScheduler, abc.DisposableBase): - """Creates an object that schedules units of work on a designated thread.""" - - def __init__( - self, - thread_factory: Optional[typing.StartableFactory] = None, - exit_if_empty: bool = False, - ) -> None: - super().__init__() - self._is_disposed = False - - self._thread_factory: typing.StartableFactory = ( - thread_factory or default_thread_factory - ) - self._thread: Optional[typing.Startable] = None - self._condition = threading.Condition(threading.Lock()) - self._queue: PriorityQueue[ScheduledItem] = PriorityQueue() - self._ready_list: Deque[ScheduledItem] = deque() - - self._exit_if_empty = exit_if_empty - - def schedule( - self, action: typing.ScheduledAction[_TState], state: Optional[_TState] = None - ) -> abc.DisposableBase: - """Schedules an action to be executed. - - Args: - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - return self.schedule_absolute(self.now, action, state=state) - - def schedule_relative( - self, - duetime: typing.RelativeTime, - action: typing.ScheduledAction[_TState], - state: Optional[_TState] = None, - ) -> abc.DisposableBase: - """Schedules an action to be executed after duetime. - - Args: - duetime: Relative time after which to execute the action. - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - duetime = max(DELTA_ZERO, self.to_timedelta(duetime)) - return self.schedule_absolute(self.now + duetime, action, state) - - def schedule_absolute( - self, - duetime: typing.AbsoluteTime, - action: typing.ScheduledAction[_TState], - state: Optional[_TState] = None, - ) -> abc.DisposableBase: - """Schedules an action to be executed at duetime. - - Args: - duetime: Absolute time at which to execute the action. - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - if self._is_disposed: - raise DisposedException() - - dt = self.to_datetime(duetime) - si: ScheduledItem = ScheduledItem(self, state, action, dt) - - with self._condition: - if dt <= self.now: - self._ready_list.append(si) - else: - self._queue.enqueue(si) - self._condition.notify() # signal that a new item is available - self._ensure_thread() - - return Disposable(si.cancel) - - def schedule_periodic( - self, - period: typing.RelativeTime, - action: typing.ScheduledPeriodicAction[_TState], - state: Optional[_TState] = None, - ) -> abc.DisposableBase: - """Schedules a periodic piece of work. - - Args: - period: Period in seconds or timedelta for running the - work periodically. - action: Action to be executed. - state: [Optional] Initial state passed to the action upon - the first iteration. - - Returns: - The disposable object used to cancel the scheduled - recurring action (best effort). - """ - - if self._is_disposed: - raise DisposedException() - - return super().schedule_periodic(period, action, state=state) - - def _has_thread(self) -> bool: - """Checks if there is an event loop thread running.""" - with self._condition: - return not self._is_disposed and self._thread is not None - - def _ensure_thread(self) -> None: - """Ensures there is an event loop thread running. Should be - called under the gate.""" - - if not self._thread: - thread = self._thread_factory(self.run) - self._thread = thread - thread.start() - - def run(self) -> None: - """Event loop scheduled on the designated event loop thread. - The loop is suspended/resumed using the condition which gets notified - by calls to Schedule or calls to dispose.""" - - ready: Deque[ScheduledItem] = deque() - - while True: - - with self._condition: - - # The notification could be because of a call to dispose. This - # takes precedence over everything else: We'll exit the loop - # immediately. Subsequent calls to Schedule won't ever create a - # new thread. - if self._is_disposed: - return - - # Sort the ready_list (from recent calls for immediate schedule) - # and the due subset of previously queued items. - time = self.now - while self._queue: - due = self._queue.peek().duetime - while self._ready_list and due > self._ready_list[0].duetime: - ready.append(self._ready_list.popleft()) - if due > time: - break - ready.append(self._queue.dequeue()) - while self._ready_list: - ready.append(self._ready_list.popleft()) - - # Execute the gathered actions - while ready: - item = ready.popleft() - if not item.is_cancelled(): - item.invoke() - - # Wait for next cycle, or if we're done let's exit if so configured - with self._condition: - - if self._ready_list: - continue - - elif self._queue: - time = self.now - item = self._queue.peek() - seconds = (item.duetime - time).total_seconds() - if seconds > 0: - log.debug("timeout: %s", seconds) - self._condition.wait(seconds) - - elif self._exit_if_empty: - self._thread = None - return - - else: - self._condition.wait() - - def dispose(self) -> None: - """Ends the thread associated with this scheduler. All - remaining work in the scheduler queue is abandoned. - """ - - with self._condition: - if not self._is_disposed: - self._is_disposed = True - self._condition.notify() diff --git a/frogpilot/third_party/reactivex/scheduler/historicalscheduler.py b/frogpilot/third_party/reactivex/scheduler/historicalscheduler.py deleted file mode 100644 index e90b21d6..00000000 --- a/frogpilot/third_party/reactivex/scheduler/historicalscheduler.py +++ /dev/null @@ -1,20 +0,0 @@ -from datetime import datetime -from typing import Optional - -from .scheduler import UTC_ZERO -from .virtualtimescheduler import VirtualTimeScheduler - - -class HistoricalScheduler(VirtualTimeScheduler): - """Provides a virtual time scheduler that uses datetime for absolute time - and timedelta for relative time.""" - - def __init__(self, initial_clock: Optional[datetime] = None) -> None: - """Creates a new historical scheduler with the specified initial clock - value. - - Args: - initial_clock: Initial value for the clock. - """ - - super().__init__(initial_clock or UTC_ZERO) diff --git a/frogpilot/third_party/reactivex/scheduler/immediatescheduler.py b/frogpilot/third_party/reactivex/scheduler/immediatescheduler.py deleted file mode 100644 index 070cf3ee..00000000 --- a/frogpilot/third_party/reactivex/scheduler/immediatescheduler.py +++ /dev/null @@ -1,96 +0,0 @@ -from threading import Lock -from typing import MutableMapping, Optional, TypeVar -from weakref import WeakKeyDictionary - -from reactivex import abc, typing -from reactivex.internal.constants import DELTA_ZERO -from reactivex.internal.exceptions import WouldBlockException - -from .scheduler import Scheduler - -_TState = TypeVar("_TState") - - -class ImmediateScheduler(Scheduler): - """Represents an object that schedules units of work to run immediately, - on the current thread. You're not allowed to schedule timeouts using the - ImmediateScheduler since that will block the current thread while waiting. - Attempts to do so will raise a :class:`WouldBlockException`. - """ - - _lock = Lock() - _global: MutableMapping[type, "ImmediateScheduler"] = WeakKeyDictionary() - - @classmethod - def singleton(cls) -> "ImmediateScheduler": - with ImmediateScheduler._lock: - try: - self = ImmediateScheduler._global[cls] - except KeyError: - self = super().__new__(cls) - ImmediateScheduler._global[cls] = self - return self - - def __new__(cls) -> "ImmediateScheduler": - return cls.singleton() - - def schedule( - self, action: typing.ScheduledAction[_TState], state: Optional[_TState] = None - ) -> abc.DisposableBase: - """Schedules an action to be executed. - - Args: - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - return self.invoke_action(action, state) - - def schedule_relative( - self, - duetime: typing.RelativeTime, - action: typing.ScheduledAction[_TState], - state: Optional[_TState] = None, - ) -> abc.DisposableBase: - """Schedules an action to be executed after duetime. - - Args: - duetime: Relative time after which to execute the action. - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - duetime = self.to_timedelta(duetime) - if duetime > DELTA_ZERO: - raise WouldBlockException() - - return self.invoke_action(action, state) - - def schedule_absolute( - self, - duetime: typing.AbsoluteTime, - action: typing.ScheduledAction[_TState], - state: Optional[_TState] = None, - ) -> abc.DisposableBase: - """Schedules an action to be executed at duetime. - - Args: - duetime: Absolute time at which to execute the action. - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - duetime = self.to_datetime(duetime) - return self.schedule_relative(duetime - self.now, action, state) diff --git a/frogpilot/third_party/reactivex/scheduler/mainloop/__init__.py b/frogpilot/third_party/reactivex/scheduler/mainloop/__init__.py deleted file mode 100644 index 3e1d0a3a..00000000 --- a/frogpilot/third_party/reactivex/scheduler/mainloop/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -from .gtkscheduler import GtkScheduler -from .pygamescheduler import PyGameScheduler -from .qtscheduler import QtScheduler -from .tkinterscheduler import TkinterScheduler -from .wxscheduler import WxScheduler - -__all__ = [ - "GtkScheduler", - "PyGameScheduler", - "QtScheduler", - "TkinterScheduler", - "WxScheduler", -] diff --git a/frogpilot/third_party/reactivex/scheduler/mainloop/gtkscheduler.py b/frogpilot/third_party/reactivex/scheduler/mainloop/gtkscheduler.py deleted file mode 100644 index 7f9767e7..00000000 --- a/frogpilot/third_party/reactivex/scheduler/mainloop/gtkscheduler.py +++ /dev/null @@ -1,144 +0,0 @@ -from typing import Any, Optional, TypeVar, cast - -from reactivex import abc, typing -from reactivex.disposable import ( - CompositeDisposable, - Disposable, - SingleAssignmentDisposable, -) - -from ..periodicscheduler import PeriodicScheduler - -_TState = TypeVar("_TState") - - -class GtkScheduler(PeriodicScheduler): - """A scheduler that schedules work via the GLib main loop - used in GTK+ applications. - - See https://wiki.gnome.org/Projects/PyGObject - """ - - def __init__(self, glib: Any) -> None: - """Create a new GtkScheduler. - - Args: - glib: The GLib module to use; typically, you would get this by - >>> import gi - >>> gi.require_version('Gtk', '3.0') - >>> from gi.repository import GLib - """ - - super().__init__() - self._glib = glib - - def _gtk_schedule( - self, - time: typing.AbsoluteOrRelativeTime, - action: typing.ScheduledSingleOrPeriodicAction[_TState], - state: Optional[_TState] = None, - periodic: bool = False, - ) -> abc.DisposableBase: - - msecs = max(0, int(self.to_seconds(time) * 1000.0)) - - sad = SingleAssignmentDisposable() - - stopped = False - - def timer_handler(_: Any) -> bool: - if stopped: - return False - - nonlocal state - if periodic: - state = cast(typing.ScheduledPeriodicAction[_TState], action)(state) - else: - sad.disposable = self.invoke_action( - cast(typing.ScheduledAction[_TState], action), state=state - ) - - return periodic - - self._glib.timeout_add(msecs, timer_handler, None) - - def dispose() -> None: - nonlocal stopped - stopped = True - - return CompositeDisposable(sad, Disposable(dispose)) - - def schedule( - self, action: typing.ScheduledAction[_TState], state: Optional[_TState] = None - ) -> abc.DisposableBase: - """Schedules an action to be executed. - - Args: - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - return self._gtk_schedule(0.0, action, state) - - def schedule_relative( - self, - duetime: typing.RelativeTime, - action: typing.ScheduledAction[_TState], - state: Optional[_TState] = None, - ) -> abc.DisposableBase: - """Schedules an action to be executed after duetime. - - Args: - duetime: Relative time after which to execute the action. - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - return self._gtk_schedule(duetime, action, state=state) - - def schedule_absolute( - self, - duetime: typing.AbsoluteTime, - action: typing.ScheduledAction[_TState], - state: Optional[_TState] = None, - ) -> abc.DisposableBase: - """Schedules an action to be executed at duetime. - - Args: - duetime: Absolute time at which to execute the action. - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - duetime = self.to_datetime(duetime) - return self._gtk_schedule(duetime - self.now, action, state=state) - - def schedule_periodic( - self, - period: typing.RelativeTime, - action: typing.ScheduledPeriodicAction[_TState], - state: Optional[_TState] = None, - ) -> abc.DisposableBase: - """Schedules a periodic piece of work to be executed in the loop. - - Args: - period: Period in seconds for running the work repeatedly. - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - return self._gtk_schedule(period, action, state=state, periodic=True) diff --git a/frogpilot/third_party/reactivex/scheduler/mainloop/pygamescheduler.py b/frogpilot/third_party/reactivex/scheduler/mainloop/pygamescheduler.py deleted file mode 100644 index 14868860..00000000 --- a/frogpilot/third_party/reactivex/scheduler/mainloop/pygamescheduler.py +++ /dev/null @@ -1,113 +0,0 @@ -import logging -import threading -from typing import Any, Optional, TypeVar - -from reactivex import abc, typing -from reactivex.internal import PriorityQueue -from reactivex.internal.constants import DELTA_ZERO - -from ..periodicscheduler import PeriodicScheduler -from ..scheduleditem import ScheduledItem - -_TState = TypeVar("_TState") - -log = logging.getLogger("Rx") - - -class PyGameScheduler(PeriodicScheduler): - """A scheduler that schedules works for PyGame. - - Note that this class expects the caller to invoke run() repeatedly. - - http://www.pygame.org/docs/ref/time.html - http://www.pygame.org/docs/ref/event.html""" - - def __init__(self, pygame: Any): - """Create a new PyGameScheduler. - - Args: - pygame: The PyGame module to use; typically, you would get this by - import pygame - """ - - super().__init__() - self._pygame = pygame # TODO not used, refactor to actually use pygame? - self._lock = threading.Lock() - self._queue: PriorityQueue[ScheduledItem] = PriorityQueue() - - def schedule( - self, action: typing.ScheduledAction[_TState], state: Optional[_TState] = None - ) -> abc.DisposableBase: - """Schedules an action to be executed. - - Args: - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - log.debug("PyGameScheduler.schedule(state=%s)", state) - return self.schedule_absolute(self.now, action, state=state) - - def schedule_relative( - self, - duetime: typing.RelativeTime, - action: typing.ScheduledAction[_TState], - state: Optional[_TState] = None, - ) -> abc.DisposableBase: - """Schedules an action to be executed after duetime. - Args: - duetime: Relative time after which to execute the action. - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - duetime = max(DELTA_ZERO, self.to_timedelta(duetime)) - return self.schedule_absolute(self.now + duetime, action, state=state) - - def schedule_absolute( - self, - duetime: typing.AbsoluteTime, - action: typing.ScheduledAction[_TState], - state: Optional[_TState] = None, - ) -> abc.DisposableBase: - """Schedules an action to be executed at duetime. - - Args: - duetime: Absolute time at which to execute the action. - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - duetime = self.to_datetime(duetime) - si: ScheduledItem = ScheduledItem(self, state, action, duetime) - - with self._lock: - self._queue.enqueue(si) - - return si.disposable - - def run(self) -> None: - while self._queue: - with self._lock: - item: ScheduledItem = self._queue.peek() - diff = item.duetime - self.now - - if diff > DELTA_ZERO: - break - - item = self._queue.dequeue() - - if not item.is_cancelled(): - item.invoke() diff --git a/frogpilot/third_party/reactivex/scheduler/mainloop/qtscheduler.py b/frogpilot/third_party/reactivex/scheduler/mainloop/qtscheduler.py deleted file mode 100644 index bee0101b..00000000 --- a/frogpilot/third_party/reactivex/scheduler/mainloop/qtscheduler.py +++ /dev/null @@ -1,143 +0,0 @@ -import logging -from datetime import timedelta -from typing import Any, Optional, Set, TypeVar - -from reactivex import abc, typing -from reactivex.disposable import ( - CompositeDisposable, - Disposable, - SingleAssignmentDisposable, -) - -from ..periodicscheduler import PeriodicScheduler - -_TState = TypeVar("_TState") - -log = logging.getLogger(__name__) - - -class QtScheduler(PeriodicScheduler): - """A scheduler for a PyQt5/PySide2 event loop.""" - - def __init__(self, qtcore: Any): - """Create a new QtScheduler. - - Args: - qtcore: The QtCore instance to use; typically you would get this by - either import PyQt5.QtCore or import PySide2.QtCore - """ - super().__init__() - self._qtcore = qtcore - self._periodic_timers: Set[Any] = set() - - def schedule( - self, action: typing.ScheduledAction[_TState], state: Optional[_TState] = None - ) -> abc.DisposableBase: - """Schedules an action to be executed. - - Args: - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - return self.schedule_relative(0.0, action, state=state) - - def schedule_relative( - self, - duetime: typing.RelativeTime, - action: typing.ScheduledAction[_TState], - state: Optional[_TState] = None, - ) -> abc.DisposableBase: - """Schedules an action to be executed after duetime. - - Args: - duetime: Relative time after which to execute the action. - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - msecs = max(0, int(self.to_seconds(duetime) * 1000.0)) - sad = SingleAssignmentDisposable() - is_disposed = False - - def invoke_action() -> None: - if not is_disposed: - sad.disposable = action(self, state) - - log.debug("relative timeout: %sms", msecs) - - # Use static method, let Qt C++ handle QTimer lifetime - self._qtcore.QTimer.singleShot(msecs, invoke_action) - - def dispose() -> None: - nonlocal is_disposed - is_disposed = True - - return CompositeDisposable(sad, Disposable(dispose)) - - def schedule_absolute( - self, - duetime: typing.AbsoluteTime, - action: typing.ScheduledAction[_TState], - state: Optional[_TState] = None, - ) -> abc.DisposableBase: - """Schedules an action to be executed at duetime. - - Args: - duetime: Absolute time at which to execute the action. - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - delta: timedelta = self.to_datetime(duetime) - self.now - return self.schedule_relative(delta, action, state=state) - - def schedule_periodic( - self, - period: typing.RelativeTime, - action: typing.ScheduledPeriodicAction[_TState], - state: Optional[_TState] = None, - ) -> abc.DisposableBase: - """Schedules a periodic piece of work to be executed in the loop. - - Args: - period: Period in seconds for running the work repeatedly. - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - msecs = max(0, int(self.to_seconds(period) * 1000.0)) - sad = SingleAssignmentDisposable() - - def interval() -> None: - nonlocal state - state = action(state) - - log.debug("periodic timeout: %sms", msecs) - - timer = self._qtcore.QTimer() - timer.setSingleShot(not period) - timer.timeout.connect(interval) - timer.setInterval(msecs) - self._periodic_timers.add(timer) - timer.start() - - def dispose() -> None: - timer.stop() - self._periodic_timers.remove(timer) - timer.deleteLater() - - return CompositeDisposable(sad, Disposable(dispose)) diff --git a/frogpilot/third_party/reactivex/scheduler/mainloop/tkinterscheduler.py b/frogpilot/third_party/reactivex/scheduler/mainloop/tkinterscheduler.py deleted file mode 100644 index 3f0e2a94..00000000 --- a/frogpilot/third_party/reactivex/scheduler/mainloop/tkinterscheduler.py +++ /dev/null @@ -1,98 +0,0 @@ -from typing import Any, Optional, TypeVar - -from reactivex import abc, typing -from reactivex.disposable import ( - CompositeDisposable, - Disposable, - SingleAssignmentDisposable, -) - -from ..periodicscheduler import PeriodicScheduler - -_TState = TypeVar("_TState") - - -class TkinterScheduler(PeriodicScheduler): - """A scheduler that schedules work via the Tkinter main event loop. - - http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/universal.html - http://effbot.org/tkinterbook/widget.htm""" - - def __init__(self, root: Any) -> None: - """Create a new TkinterScheduler. - - Args: - root: The Tk instance to use; typically, you would get this by - import tkinter; tkinter.Tk() - """ - - super().__init__() - self._root = root - - def schedule( - self, action: typing.ScheduledAction[_TState], state: Optional[_TState] = None - ) -> abc.DisposableBase: - """Schedules an action to be executed. - - Args: - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - return self.schedule_relative(0.0, action, state) - - def schedule_relative( - self, - duetime: typing.RelativeTime, - action: typing.ScheduledAction[_TState], - state: Optional[_TState] = None, - ) -> abc.DisposableBase: - """Schedules an action to be executed after duetime. - - Args: - duetime: Relative time after which to execute the action. - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - sad = SingleAssignmentDisposable() - - def invoke_action() -> None: - sad.disposable = self.invoke_action(action, state=state) - - msecs = max(0, int(self.to_seconds(duetime) * 1000.0)) - timer = self._root.after(msecs, invoke_action) - - def dispose() -> None: - self._root.after_cancel(timer) - - return CompositeDisposable(sad, Disposable(dispose)) - - def schedule_absolute( - self, - duetime: typing.AbsoluteTime, - action: typing.ScheduledAction[_TState], - state: Optional[_TState] = None, - ) -> abc.DisposableBase: - """Schedules an action to be executed at duetime. - - Args: - duetime: Absolute time at which to execute the action. - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - duetime = self.to_datetime(duetime) - return self.schedule_relative(duetime - self.now, action, state=state) diff --git a/frogpilot/third_party/reactivex/scheduler/mainloop/wxscheduler.py b/frogpilot/third_party/reactivex/scheduler/mainloop/wxscheduler.py deleted file mode 100644 index 054edbd4..00000000 --- a/frogpilot/third_party/reactivex/scheduler/mainloop/wxscheduler.py +++ /dev/null @@ -1,177 +0,0 @@ -import logging -from typing import Any, Optional, Set, TypeVar, cast - -from reactivex import abc, typing -from reactivex.disposable import ( - CompositeDisposable, - Disposable, - SingleAssignmentDisposable, -) - -from ..periodicscheduler import PeriodicScheduler - -_TState = TypeVar("_TState") - -log = logging.getLogger("Rx") - - -class WxScheduler(PeriodicScheduler): - """A scheduler for a wxPython event loop.""" - - def __init__(self, wx: Any) -> None: - """Create a new WxScheduler. - - Args: - wx: The wx module to use; typically, you would get this by - import wx - """ - - super().__init__() - self._wx = wx - timer_class: Any = self._wx.Timer - - class Timer(timer_class): - def __init__(self, callback: typing.Action) -> None: - super().__init__() # type: ignore - self.callback = callback - - def Notify(self) -> None: - self.callback() - - self._timer_class = Timer - self._timers: Set[Timer] = set() - - def cancel_all(self) -> None: - """Cancel all scheduled actions. - - Should be called when destroying wx controls to prevent - accessing dead wx objects in actions that might be pending. - """ - for timer in self._timers: - timer.Stop() # type: ignore - - def _wxtimer_schedule( - self, - time: typing.AbsoluteOrRelativeTime, - action: typing.ScheduledSingleOrPeriodicAction[_TState], - state: Optional[_TState] = None, - periodic: bool = False, - ) -> abc.DisposableBase: - scheduler = self - - sad = SingleAssignmentDisposable() - - def interval() -> None: - nonlocal state - if periodic: - state = cast(typing.ScheduledPeriodicAction[_TState], action)(state) - else: - sad.disposable = cast(typing.ScheduledAction[_TState], action)( - scheduler, state - ) - - msecs = max(1, int(self.to_seconds(time) * 1000.0)) # Must be non-zero - - log.debug("timeout wx: %s", msecs) - - timer = self._timer_class(interval) - # A timer can only be used from the main thread - if self._wx.IsMainThread(): - timer.Start(msecs, oneShot=not periodic) # type: ignore - else: - self._wx.CallAfter(timer.Start, msecs, oneShot=not periodic) # type: ignore - self._timers.add(timer) - - def dispose() -> None: - timer.Stop() # type: ignore - self._timers.remove(timer) - - return CompositeDisposable(sad, Disposable(dispose)) - - def schedule( - self, action: typing.ScheduledAction[_TState], state: Optional[_TState] = None - ) -> abc.DisposableBase: - """Schedules an action to be executed. - - Args: - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - sad = SingleAssignmentDisposable() - is_disposed = False - - def invoke_action() -> None: - if not is_disposed: - sad.disposable = action(self, state) - - self._wx.CallAfter(invoke_action) - - def dispose() -> None: - nonlocal is_disposed - is_disposed = True - - return CompositeDisposable(sad, Disposable(dispose)) - - def schedule_relative( - self, - duetime: typing.RelativeTime, - action: typing.ScheduledAction[_TState], - state: Optional[_TState] = None, - ) -> abc.DisposableBase: - """Schedules an action to be executed after duetime. - - Args: - duetime: Relative time after which to execute the action. - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - return self._wxtimer_schedule(duetime, action, state=state) - - def schedule_absolute( - self, - duetime: typing.AbsoluteTime, - action: typing.ScheduledAction[_TState], - state: Optional[_TState] = None, - ) -> abc.DisposableBase: - """Schedules an action to be executed at duetime. - - Args: - duetime: Absolute time at which to execute the action. - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - duetime = self.to_datetime(duetime) - return self._wxtimer_schedule(duetime - self.now, action, state=state) - - def schedule_periodic( - self, - period: typing.RelativeTime, - action: typing.ScheduledPeriodicAction[_TState], - state: Optional[_TState] = None, - ) -> abc.DisposableBase: - """Schedules a periodic piece of work to be executed in the loop. - - Args: - period: Period in seconds for running the work repeatedly. - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - return self._wxtimer_schedule(period, action, state=state, periodic=True) diff --git a/frogpilot/third_party/reactivex/scheduler/newthreadscheduler.py b/frogpilot/third_party/reactivex/scheduler/newthreadscheduler.py deleted file mode 100644 index 481bca17..00000000 --- a/frogpilot/third_party/reactivex/scheduler/newthreadscheduler.py +++ /dev/null @@ -1,136 +0,0 @@ -import logging -import threading -from datetime import datetime -from typing import Optional, TypeVar - -from reactivex import abc, typing -from reactivex.disposable import Disposable -from reactivex.internal.concurrency import default_thread_factory - -from .eventloopscheduler import EventLoopScheduler -from .periodicscheduler import PeriodicScheduler - -_TState = TypeVar("_TState") - -log = logging.getLogger("Rx") - - -class NewThreadScheduler(PeriodicScheduler): - """Creates an object that schedules each unit of work on a separate thread.""" - - def __init__( - self, thread_factory: Optional[typing.StartableFactory] = None - ) -> None: - super().__init__() - self.thread_factory: typing.StartableFactory = ( - thread_factory or default_thread_factory - ) - - def schedule( - self, action: typing.ScheduledAction[_TState], state: Optional[_TState] = None - ) -> abc.DisposableBase: - """Schedules an action to be executed. - - Args: - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - scheduler = EventLoopScheduler( - thread_factory=self.thread_factory, exit_if_empty=True - ) - return scheduler.schedule(action, state) - - def schedule_relative( - self, - duetime: typing.RelativeTime, - action: typing.ScheduledAction[_TState], - state: Optional[_TState] = None, - ) -> abc.DisposableBase: - """Schedules an action to be executed after duetime. - - Args: - duetime: Relative time after which to execute the action. - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - scheduler = EventLoopScheduler( - thread_factory=self.thread_factory, exit_if_empty=True - ) - return scheduler.schedule_relative(duetime, action, state) - - def schedule_absolute( - self, - duetime: typing.AbsoluteTime, - action: typing.ScheduledAction[_TState], - state: Optional[_TState] = None, - ) -> abc.DisposableBase: - """Schedules an action to be executed at duetime. - - Args: - duetime: Absolute time at which to execute the action. - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - dt = self.to_datetime(duetime) - return self.schedule_relative(dt - self.now, action, state=state) - - def schedule_periodic( - self, - period: typing.RelativeTime, - action: typing.ScheduledPeriodicAction[_TState], - state: Optional[_TState] = None, - ) -> abc.DisposableBase: - """Schedules a periodic piece of work. - - Args: - period: Period in seconds or timedelta for running the - work periodically. - action: Action to be executed. - state: [Optional] Initial state passed to the action upon - the first iteration. - - Returns: - The disposable object used to cancel the scheduled - recurring action (best effort). - """ - - seconds: float = self.to_seconds(period) - timeout: float = seconds - disposed: threading.Event = threading.Event() - - def run() -> None: - nonlocal state, timeout - while True: - if timeout > 0.0: - disposed.wait(timeout) - if disposed.is_set(): - return - - time: datetime = self.now - - state = action(state) - - timeout = seconds - (self.now - time).total_seconds() - - thread = self.thread_factory(run) - thread.start() - - def dispose() -> None: - disposed.set() - - return Disposable(dispose) diff --git a/frogpilot/third_party/reactivex/scheduler/periodicscheduler.py b/frogpilot/third_party/reactivex/scheduler/periodicscheduler.py deleted file mode 100644 index cde217b3..00000000 --- a/frogpilot/third_party/reactivex/scheduler/periodicscheduler.py +++ /dev/null @@ -1,60 +0,0 @@ -from datetime import datetime -from typing import Optional, TypeVar - -from reactivex import abc, typing -from reactivex.disposable import Disposable, MultipleAssignmentDisposable - -from .scheduler import Scheduler - -_TState = TypeVar("_TState") - - -class PeriodicScheduler(Scheduler, abc.PeriodicSchedulerBase): - """Base class for the various periodic scheduler implementations in this - package as well as the mainloop sub-package. - """ - - def schedule_periodic( - self, - period: typing.RelativeTime, - action: typing.ScheduledPeriodicAction[_TState], - state: Optional[_TState] = None, - ) -> abc.DisposableBase: - """Schedules a periodic piece of work. - - Args: - period: Period in seconds or timedelta for running the - work periodically. - action: Action to be executed. - state: [Optional] Initial state passed to the action upon - the first iteration. - - Returns: - The disposable object used to cancel the scheduled - recurring action (best effort). - """ - - disp: MultipleAssignmentDisposable = MultipleAssignmentDisposable() - seconds: float = self.to_seconds(period) - - def periodic( - scheduler: abc.SchedulerBase, state: Optional[_TState] = None - ) -> Optional[Disposable]: - if disp.is_disposed: - return None - - now: datetime = scheduler.now - - try: - state = action(state) - except Exception: - disp.dispose() - raise - - time = seconds - (scheduler.now - now).total_seconds() - disp.disposable = scheduler.schedule_relative(time, periodic, state=state) - - return None - - disp.disposable = self.schedule_relative(period, periodic, state=state) - return disp diff --git a/frogpilot/third_party/reactivex/scheduler/scheduleditem.py b/frogpilot/third_party/reactivex/scheduler/scheduleditem.py deleted file mode 100644 index 837fee38..00000000 --- a/frogpilot/third_party/reactivex/scheduler/scheduleditem.py +++ /dev/null @@ -1,47 +0,0 @@ -from datetime import datetime -from typing import Any, Optional - -from reactivex import abc -from reactivex.disposable import SingleAssignmentDisposable - -from .scheduler import Scheduler - - -class ScheduledItem(object): - def __init__( - self, - scheduler: Scheduler, - state: Optional[Any], - action: abc.ScheduledAction[Any], - duetime: datetime, - ) -> None: - self.scheduler: Scheduler = scheduler - self.state: Optional[Any] = state - self.action: abc.ScheduledAction[Any] = action - self.duetime: datetime = duetime - self.disposable: SingleAssignmentDisposable = SingleAssignmentDisposable() - - def invoke(self) -> None: - ret = self.scheduler.invoke_action(self.action, state=self.state) - self.disposable.disposable = ret - - def cancel(self) -> None: - """Cancels the work item by disposing the resource returned by - invoke_core as soon as possible.""" - - self.disposable.dispose() - - def is_cancelled(self) -> bool: - return self.disposable.is_disposed - - def __lt__(self, other: "ScheduledItem") -> bool: - return self.duetime < other.duetime - - def __gt__(self, other: "ScheduledItem") -> bool: - return self.duetime > other.duetime - - def __eq__(self, other: Any) -> bool: - try: - return self.duetime == other.duetime - except AttributeError: - return NotImplemented diff --git a/frogpilot/third_party/reactivex/scheduler/scheduler.py b/frogpilot/third_party/reactivex/scheduler/scheduler.py deleted file mode 100644 index a47dc049..00000000 --- a/frogpilot/third_party/reactivex/scheduler/scheduler.py +++ /dev/null @@ -1,172 +0,0 @@ -from abc import abstractmethod -from datetime import datetime, timedelta, timezone -from typing import Optional, TypeVar - -from reactivex import abc, typing -from reactivex.disposable import Disposable -from reactivex.internal.basic import default_now -from reactivex.internal.constants import UTC_ZERO - -_TState = TypeVar("_TState") - - -class Scheduler(abc.SchedulerBase): - """Base class for the various scheduler implementations in this package as - well as the mainloop sub-package. This does not include an implementation - of schedule_periodic, refer to PeriodicScheduler. - """ - - @property - def now(self) -> datetime: - """Represents a notion of time for this scheduler. Tasks being - scheduled on a scheduler will adhere to the time denoted by this - property. - - Returns: - The scheduler's current time, as a datetime instance. - """ - - return default_now() - - @abstractmethod - def schedule( - self, action: abc.ScheduledAction[_TState], state: Optional[_TState] = None - ) -> abc.DisposableBase: - """Schedules an action to be executed. - - Args: - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - return NotImplemented - - @abstractmethod - def schedule_relative( - self, - duetime: typing.RelativeTime, - action: abc.ScheduledAction[_TState], - state: Optional[_TState] = None, - ) -> abc.DisposableBase: - """Schedules an action to be executed after duetime. - - Args: - duetime: Relative time after which to execute the action. - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - return NotImplemented - - @abstractmethod - def schedule_absolute( - self, - duetime: typing.AbsoluteTime, - action: abc.ScheduledAction[_TState], - state: Optional[_TState] = None, - ) -> abc.DisposableBase: - """Schedules an action to be executed at duetime. - - Args: - duetime: Absolute time at which to execute the action. - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - return NotImplemented - - def invoke_action( - self, action: abc.ScheduledAction[_TState], state: Optional[_TState] = None - ) -> abc.DisposableBase: - """Invoke the given given action. This is typically called by instances - of ScheduledItem. - - Args: - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object returned by the action, if any; or a new - (no-op) disposable otherwise. - """ - - ret = action(self, state) - if isinstance(ret, abc.DisposableBase): - return ret - - return Disposable() - - @classmethod - def to_seconds(cls, value: typing.AbsoluteOrRelativeTime) -> float: - """Converts time value to seconds. This method handles both absolute - (datetime) and relative (timedelta) values. If the argument is already - a float, it is simply returned unchanged. - - Args: - value: the time value to convert to seconds. - - Returns: - The value converted to seconds. - """ - - if isinstance(value, datetime): - value = value - UTC_ZERO - - if isinstance(value, timedelta): - value = value.total_seconds() - - return value - - @classmethod - def to_datetime(cls, value: typing.AbsoluteOrRelativeTime) -> datetime: - """Converts time value to datetime. This method handles both absolute - (float) and relative (timedelta) values. If the argument is already - a datetime, it is simply returned unchanged. - - Args: - value: the time value to convert to datetime. - - Returns: - The value converted to datetime. - """ - - if isinstance(value, timedelta): - value = UTC_ZERO + value - elif not isinstance(value, datetime): - value = datetime.fromtimestamp((value), tz=timezone.utc) - - return value - - @classmethod - def to_timedelta(cls, value: typing.AbsoluteOrRelativeTime) -> timedelta: - """Converts time value to timedelta. This method handles both absolute - (datetime) and relative (float) values. If the argument is already - a timedelta, it is simply returned unchanged. If the argument is an - absolute time, the result value will be the timedelta since the epoch, - January 1st, 1970, 00:00:00. - - Args: - value: the time value to convert to timedelta. - - Returns: - The value converted to timedelta. - """ - - if isinstance(value, datetime): - value = value - UTC_ZERO - elif not isinstance(value, timedelta): - value = timedelta(seconds=value) - - return value diff --git a/frogpilot/third_party/reactivex/scheduler/threadpoolscheduler.py b/frogpilot/third_party/reactivex/scheduler/threadpoolscheduler.py deleted file mode 100644 index 3df4ac6d..00000000 --- a/frogpilot/third_party/reactivex/scheduler/threadpoolscheduler.py +++ /dev/null @@ -1,37 +0,0 @@ -from concurrent.futures import Future, ThreadPoolExecutor -from typing import Any, Optional - -from reactivex import abc, typing - -from .newthreadscheduler import NewThreadScheduler - - -class ThreadPoolScheduler(NewThreadScheduler): - """A scheduler that schedules work via the thread pool.""" - - class ThreadPoolThread(abc.StartableBase): - """Wraps a concurrent future as a thread.""" - - def __init__( - self, executor: ThreadPoolExecutor, target: typing.StartableTarget - ): - self.executor: ThreadPoolExecutor = executor - self.target: typing.StartableTarget = target - self.future: Optional["Future[Any]"] = None - - def start(self) -> None: - self.future = self.executor.submit(self.target) - - def cancel(self) -> None: - if self.future: - self.future.cancel() - - def __init__(self, max_workers: Optional[int] = None) -> None: - self.executor: ThreadPoolExecutor = ThreadPoolExecutor(max_workers=max_workers) - - def thread_factory( - target: typing.StartableTarget, - ) -> ThreadPoolScheduler.ThreadPoolThread: - return self.ThreadPoolThread(self.executor, target) - - super().__init__(thread_factory) diff --git a/frogpilot/third_party/reactivex/scheduler/timeoutscheduler.py b/frogpilot/third_party/reactivex/scheduler/timeoutscheduler.py deleted file mode 100644 index eb87396f..00000000 --- a/frogpilot/third_party/reactivex/scheduler/timeoutscheduler.py +++ /dev/null @@ -1,122 +0,0 @@ -from threading import Lock, Timer -from typing import MutableMapping, Optional, TypeVar -from weakref import WeakKeyDictionary - -from reactivex import abc, typing -from reactivex.disposable import ( - CompositeDisposable, - Disposable, - SingleAssignmentDisposable, -) - -from .periodicscheduler import PeriodicScheduler - -_TState = TypeVar("_TState") - - -class TimeoutScheduler(PeriodicScheduler): - """A scheduler that schedules work via a timed callback.""" - - _lock = Lock() - _global: MutableMapping[type, "TimeoutScheduler"] = WeakKeyDictionary() - - @classmethod - def singleton(cls) -> "TimeoutScheduler": - with TimeoutScheduler._lock: - try: - self = TimeoutScheduler._global[cls] - except KeyError: - self = super().__new__(cls) - TimeoutScheduler._global[cls] = self - return self - - def __new__(cls) -> "TimeoutScheduler": - return cls.singleton() - - def schedule( - self, action: abc.ScheduledAction[_TState], state: Optional[_TState] = None - ) -> abc.DisposableBase: - """Schedules an action to be executed. - - Args: - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - sad = SingleAssignmentDisposable() - - def interval() -> None: - sad.disposable = self.invoke_action(action, state) - - timer = Timer(0, interval) - timer.daemon = True - timer.start() - - def dispose() -> None: - timer.cancel() - - return CompositeDisposable(sad, Disposable(dispose)) - - def schedule_relative( - self, - duetime: typing.RelativeTime, - action: abc.ScheduledAction[_TState], - state: Optional[_TState] = None, - ) -> abc.DisposableBase: - """Schedules an action to be executed after duetime. - - Args: - duetime: Relative time after which to execute the action. - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - seconds = self.to_seconds(duetime) - if seconds <= 0.0: - return self.schedule(action, state) - - sad = SingleAssignmentDisposable() - - def interval() -> None: - sad.disposable = self.invoke_action(action, state) - - timer = Timer(seconds, interval) - timer.daemon = True - timer.start() - - def dispose() -> None: - timer.cancel() - - return CompositeDisposable(sad, Disposable(dispose)) - - def schedule_absolute( - self, - duetime: typing.AbsoluteTime, - action: abc.ScheduledAction[_TState], - state: Optional[_TState] = None, - ) -> abc.DisposableBase: - """Schedules an action to be executed at duetime. - - Args: - duetime: Absolute time at which to execute the action. - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - duetime = self.to_datetime(duetime) - return self.schedule_relative(duetime - self.now, action, state) - - -__all__ = ["TimeoutScheduler"] diff --git a/frogpilot/third_party/reactivex/scheduler/trampoline.py b/frogpilot/third_party/reactivex/scheduler/trampoline.py deleted file mode 100644 index f138b3e1..00000000 --- a/frogpilot/third_party/reactivex/scheduler/trampoline.py +++ /dev/null @@ -1,62 +0,0 @@ -from collections import deque -from threading import Condition, Lock -from typing import Deque - -from reactivex.internal.priorityqueue import PriorityQueue - -from .scheduleditem import ScheduledItem - - -class Trampoline: - def __init__(self) -> None: - self._idle: bool = True - self._queue: PriorityQueue[ScheduledItem] = PriorityQueue() - self._lock: Lock = Lock() - self._condition: Condition = Condition(self._lock) - - def idle(self) -> bool: - with self._lock: - return self._idle - - def run(self, item: ScheduledItem) -> None: - with self._lock: - self._queue.enqueue(item) - if self._idle: - self._idle = False - else: - self._condition.notify() - return - try: - self._run() - finally: - with self._lock: - self._idle = True - self._queue.clear() - - def _run(self) -> None: - ready: Deque[ScheduledItem] = deque() - while True: - with self._lock: - while len(self._queue) > 0: - item: ScheduledItem = self._queue.peek() - if item.duetime <= item.scheduler.now: - self._queue.dequeue() - ready.append(item) - else: - break - - while len(ready) > 0: - item = ready.popleft() - if not item.is_cancelled(): - item.invoke() - - with self._lock: - if len(self._queue) == 0: - break - item = self._queue.peek() - seconds = (item.duetime - item.scheduler.now).total_seconds() - if seconds > 0.0: - self._condition.wait(seconds) - - -__all__ = ["Trampoline"] diff --git a/frogpilot/third_party/reactivex/scheduler/trampolinescheduler.py b/frogpilot/third_party/reactivex/scheduler/trampolinescheduler.py deleted file mode 100644 index a4f92a49..00000000 --- a/frogpilot/third_party/reactivex/scheduler/trampolinescheduler.py +++ /dev/null @@ -1,117 +0,0 @@ -import logging -from typing import Optional, TypeVar - -from reactivex import abc, typing -from reactivex.abc.disposable import DisposableBase -from reactivex.abc.scheduler import ScheduledAction -from reactivex.internal.constants import DELTA_ZERO - -from .scheduleditem import ScheduledItem -from .scheduler import Scheduler -from .trampoline import Trampoline - -_TState = TypeVar("_TState") -log = logging.getLogger("Rx") - - -class TrampolineScheduler(Scheduler): - """Represents an object that schedules units of work on the trampoline. - You should never schedule timeouts using the *TrampolineScheduler*, as - it will block the thread while waiting. - - Each instance has its own trampoline (and queue), and you can schedule work - on it from different threads. Beware though, that the first thread to call - a *schedule* method while the trampoline is idle will then remain occupied - until the queue is empty. - """ - - def __init__(self) -> None: - - self._tramp = Trampoline() - - def get_trampoline(self) -> Trampoline: - return self._tramp - - def schedule( - self, action: abc.ScheduledAction[_TState], state: Optional[_TState] = None - ) -> abc.DisposableBase: - """Schedules an action to be executed. - - Args: - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - return self.schedule_absolute(self.now, action, state=state) - - def schedule_relative( - self, - duetime: typing.RelativeTime, - action: abc.ScheduledAction[_TState], - state: Optional[_TState] = None, - ) -> abc.DisposableBase: - """Schedules an action to be executed after duetime. - - Args: - duetime: Relative time after which to execute the action. - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - duetime = max(DELTA_ZERO, self.to_timedelta(duetime)) - return self.schedule_absolute(self.now + duetime, action, state=state) - - def schedule_absolute( - self, - duetime: typing.AbsoluteTime, - action: abc.ScheduledAction[_TState], - state: Optional[_TState] = None, - ) -> abc.DisposableBase: - """Schedules an action to be executed at duetime. - - Args: - duetime: Absolute time at which to execute the action. - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - dt = self.to_datetime(duetime) - if dt > self.now: - log.warning("Do not schedule blocking work!") - item: ScheduledItem = ScheduledItem(self, state, action, dt) - - self.get_trampoline().run(item) - - return item.disposable - - def schedule_required(self) -> bool: - """Test if scheduling is required. - - Gets a value indicating whether the caller must call a - schedule method. If the trampoline is active, then it returns - False; otherwise, if the trampoline is not active, then it - returns True. - """ - return self.get_trampoline().idle() - - def ensure_trampoline( - self, action: ScheduledAction[_TState] - ) -> Optional[DisposableBase]: - """Method for testing the TrampolineScheduler.""" - - if self.schedule_required(): - return self.schedule(action) - - return action(self, None) diff --git a/frogpilot/third_party/reactivex/scheduler/virtualtimescheduler.py b/frogpilot/third_party/reactivex/scheduler/virtualtimescheduler.py deleted file mode 100644 index 97e82941..00000000 --- a/frogpilot/third_party/reactivex/scheduler/virtualtimescheduler.py +++ /dev/null @@ -1,251 +0,0 @@ -import logging -import threading -from datetime import datetime, timedelta -from typing import Any, Optional, TypeVar - -from reactivex import abc, typing -from reactivex.abc.scheduler import AbsoluteTime -from reactivex.internal import ArgumentOutOfRangeException, PriorityQueue - -from .periodicscheduler import PeriodicScheduler -from .scheduleditem import ScheduledItem - -log = logging.getLogger("Rx") - -MAX_SPINNING = 100 - -_TState = TypeVar("_TState") - - -class VirtualTimeScheduler(PeriodicScheduler): - """Virtual Scheduler. This scheduler should work with either - datetime/timespan or ticks as int/int""" - - def __init__(self, initial_clock: AbsoluteTime = 0) -> None: - """Creates a new virtual time scheduler with the specified - initial clock value. - - Args: - initial_clock: Initial value for the clock. - """ - - super().__init__() - self._clock: AbsoluteTime = initial_clock - self._is_enabled = False - self._lock: threading.Lock = threading.Lock() - self._queue: PriorityQueue[ScheduledItem] = PriorityQueue() - - def _get_clock(self) -> typing.AbsoluteTime: - with self._lock: - return self._clock - - clock = property(fget=_get_clock) - - @property - def now(self) -> datetime: - """Represents a notion of time for this scheduler. Tasks being - scheduled on a scheduler will adhere to the time denoted by this - property. - - Returns: - The scheduler's current time, as a datetime instance. - """ - - return self.to_datetime(self._clock) - - def schedule( - self, action: typing.ScheduledAction[_TState], state: Optional[_TState] = None - ) -> abc.DisposableBase: - """Schedules an action to be executed. - - Args: - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - return self.schedule_absolute(self._clock, action, state=state) - - def schedule_relative( - self, - duetime: typing.RelativeTime, - action: abc.ScheduledAction[_TState], - state: Optional[_TState] = None, - ) -> abc.DisposableBase: - """Schedules an action to be executed after duetime. - - Args: - duetime: Relative time after which to execute the action. - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - time: typing.AbsoluteTime = self.add(self._clock, duetime) - return self.schedule_absolute(time, action, state=state) - - def schedule_absolute( - self, - duetime: typing.AbsoluteTime, - action: abc.ScheduledAction[_TState], - state: Optional[_TState] = None, - ) -> abc.DisposableBase: - """Schedules an action to be executed at duetime. - - Args: - duetime: Absolute time at which to execute the action. - action: Action to be executed. - state: [Optional] state to be given to the action function. - - Returns: - The disposable object used to cancel the scheduled action - (best effort). - """ - - dt = self.to_datetime(duetime) - si: ScheduledItem = ScheduledItem(self, state, action, dt) - with self._lock: - self._queue.enqueue(si) - return si.disposable - - def start(self) -> Any: - """Starts the virtual time scheduler.""" - - with self._lock: - if self._is_enabled: - return - self._is_enabled = True - - spinning: int = 0 - - while True: - with self._lock: - if not self._is_enabled or not self._queue: - break - - item: ScheduledItem = self._queue.dequeue() - - if item.duetime > self.now: - if isinstance(self._clock, datetime): - self._clock = item.duetime - else: - self._clock = self.to_seconds(item.duetime) - spinning = 0 - - elif spinning > MAX_SPINNING: - if isinstance(self._clock, datetime): - self.clock += timedelta(microseconds=1000) - else: - self._clock += 1.0 - spinning = 0 - - if not item.is_cancelled(): - item.invoke() - spinning += 1 - - self.stop() - - def stop(self) -> None: - """Stops the virtual time scheduler.""" - - with self._lock: - self._is_enabled = False - - def advance_to(self, time: typing.AbsoluteTime) -> None: - """Advances the schedulers clock to the specified absolute time, - running all work til that point. - - Args: - time: Absolute time to advance the schedulers clock to. - """ - item: ScheduledItem - dt: datetime = self.to_datetime(time) - with self._lock: - if self.now > dt: - raise ArgumentOutOfRangeException() - - if self.now == dt or self._is_enabled: - return - - self._is_enabled = True - - while True: - with self._lock: - if not self._is_enabled or not self._queue: - break - - item = self._queue.peek() - - if item.duetime > dt: - break - - if item.duetime > self.now: - if isinstance(self._clock, datetime): - self._clock = item.duetime - else: - self._clock = self.to_seconds(item.duetime) - - self._queue.dequeue() - - if not item.is_cancelled(): - item.invoke() - - with self._lock: - self._is_enabled = False - if isinstance(self._clock, datetime): - self._clock = dt - else: - self._clock = self.to_seconds(dt) - - def advance_by(self, time: typing.RelativeTime) -> None: - """Advances the schedulers clock by the specified relative time, - running all work scheduled for that timespan. - - Args: - time: Relative time to advance the schedulers clock by. - """ - - log.debug("VirtualTimeScheduler.advance_by(time=%s)", time) - - self.advance_to(self.add(self.now, self.to_timedelta(time))) - - def sleep(self, time: typing.RelativeTime) -> None: - """Advances the schedulers clock by the specified relative time. - - Args: - time: Relative time to advance the schedulers clock by. - """ - - absolute = self.add(self.now, self.to_timedelta(time)) - dt: datetime = self.to_datetime(absolute) - - if self.now > dt: - raise ArgumentOutOfRangeException() - - with self._lock: - if isinstance(self._clock, datetime): - self._clock = dt - else: - self._clock = self.to_seconds(dt) - - @classmethod - def add( - cls, absolute: typing.AbsoluteTime, relative: typing.RelativeTime - ) -> typing.AbsoluteTime: - """Adds a relative time value to an absolute time value. - - Args: - absolute: Absolute virtual time value. - relative: Relative virtual time value to add. - - Returns: - The resulting absolute virtual time sum value. - """ - - return cls.to_datetime(absolute) + cls.to_timedelta(relative) diff --git a/frogpilot/third_party/reactivex/subject/__init__.py b/frogpilot/third_party/reactivex/subject/__init__.py deleted file mode 100644 index 563688b8..00000000 --- a/frogpilot/third_party/reactivex/subject/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -from .asyncsubject import AsyncSubject -from .behaviorsubject import BehaviorSubject -from .replaysubject import ReplaySubject -from .subject import Subject - -__all__ = ["Subject", "AsyncSubject", "BehaviorSubject", "ReplaySubject"] diff --git a/frogpilot/third_party/reactivex/subject/asyncsubject.py b/frogpilot/third_party/reactivex/subject/asyncsubject.py deleted file mode 100644 index 5950f2b1..00000000 --- a/frogpilot/third_party/reactivex/subject/asyncsubject.py +++ /dev/null @@ -1,85 +0,0 @@ -from typing import Optional, TypeVar, cast - -from .. import abc -from ..disposable import Disposable -from .innersubscription import InnerSubscription -from .subject import Subject - -_T = TypeVar("_T") - - -class AsyncSubject(Subject[_T]): - """Represents the result of an asynchronous operation. The last value - before the close notification, or the error received through - on_error, is sent to all subscribed observers.""" - - def __init__(self) -> None: - """Creates a subject that can only receive one value and that value is - cached for all future observations.""" - - super().__init__() - - self.value: _T = cast(_T, None) - self.has_value: bool = False - - def _subscribe_core( - self, - observer: abc.ObserverBase[_T], - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - with self.lock: - self.check_disposed() - if not self.is_stopped: - self.observers.append(observer) - return InnerSubscription(self, observer) - - ex = self.exception - has_value = self.has_value - value = self.value - - if ex: - observer.on_error(ex) - elif has_value: - observer.on_next(value) - observer.on_completed() - else: - observer.on_completed() - - return Disposable() - - def _on_next_core(self, value: _T) -> None: - """Remember the value. Upon completion, the most recently received value - will be passed on to all subscribed observers. - - Args: - value: The value to remember until completion - """ - with self.lock: - self.value = value - self.has_value = True - - def _on_completed_core(self) -> None: - """Notifies all subscribed observers of the end of the sequence. The - most recently received value, if any, will now be passed on to all - subscribed observers.""" - - with self.lock: - observers = self.observers.copy() - self.observers.clear() - value = self.value - has_value = self.has_value - - if has_value: - for observer in observers: - observer.on_next(value) - observer.on_completed() - else: - for observer in observers: - observer.on_completed() - - def dispose(self) -> None: - """Unsubscribe all observers and release resources.""" - - with self.lock: - self.value = cast(_T, None) - super().dispose() diff --git a/frogpilot/third_party/reactivex/subject/behaviorsubject.py b/frogpilot/third_party/reactivex/subject/behaviorsubject.py deleted file mode 100644 index be670625..00000000 --- a/frogpilot/third_party/reactivex/subject/behaviorsubject.py +++ /dev/null @@ -1,69 +0,0 @@ -from typing import Optional, TypeVar, cast - -from .. import abc -from ..disposable import Disposable -from .innersubscription import InnerSubscription -from .subject import Subject - -_T = TypeVar("_T") - - -class BehaviorSubject(Subject[_T]): - """Represents a value that changes over time. Observers can - subscribe to the subject to receive the last (or initial) value and - all subsequent notifications. - """ - - def __init__(self, value: _T) -> None: - """Initializes a new instance of the BehaviorSubject class which - creates a subject that caches its last value and starts with the - specified value. - - Args: - value: Initial value sent to observers when no other value has been - received by the subject yet. - """ - - super().__init__() - - self.value: _T = value - - def _subscribe_core( - self, - observer: abc.ObserverBase[_T], - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - with self.lock: - self.check_disposed() - if not self.is_stopped: - self.observers.append(observer) - observer.on_next(self.value) - return InnerSubscription(self, observer) - ex = self.exception - - if ex: - observer.on_error(ex) - else: - observer.on_completed() - - return Disposable() - - def _on_next_core(self, value: _T) -> None: - """Notifies all subscribed observers with the value.""" - with self.lock: - observers = self.observers.copy() - self.value = value - - for observer in observers: - observer.on_next(value) - - def dispose(self) -> None: - """Release all resources. - - Releases all resources used by the current instance of the - BehaviorSubject class and unsubscribe all observers. - """ - - with self.lock: - self.value = cast(_T, None) - super().dispose() diff --git a/frogpilot/third_party/reactivex/subject/innersubscription.py b/frogpilot/third_party/reactivex/subject/innersubscription.py deleted file mode 100644 index 98315377..00000000 --- a/frogpilot/third_party/reactivex/subject/innersubscription.py +++ /dev/null @@ -1,26 +0,0 @@ -import threading -from typing import TYPE_CHECKING, Optional, TypeVar - -from .. import abc - -if TYPE_CHECKING: - from .subject import Subject - -_T = TypeVar("_T") - - -class InnerSubscription(abc.DisposableBase): - def __init__( - self, subject: "Subject[_T]", observer: Optional[abc.ObserverBase[_T]] = None - ): - self.subject = subject - self.observer = observer - - self.lock = threading.RLock() - - def dispose(self) -> None: - with self.lock: - if not self.subject.is_disposed and self.observer: - if self.observer in self.subject.observers: - self.subject.observers.remove(self.observer) - self.observer = None diff --git a/frogpilot/third_party/reactivex/subject/replaysubject.py b/frogpilot/third_party/reactivex/subject/replaysubject.py deleted file mode 100644 index 84fa93af..00000000 --- a/frogpilot/third_party/reactivex/subject/replaysubject.py +++ /dev/null @@ -1,141 +0,0 @@ -import sys -from collections import deque -from datetime import datetime, timedelta -from typing import Any, Deque, NamedTuple, Optional, TypeVar, cast - -from reactivex.observer.scheduledobserver import ScheduledObserver -from reactivex.scheduler import CurrentThreadScheduler - -from .. import abc, typing -from ..observer import Observer -from .subject import Subject - -_T = TypeVar("_T") - - -class RemovableDisposable(abc.DisposableBase): - def __init__(self, subject: Subject[_T], observer: Observer[_T]): - self.subject = subject - self.observer = observer - - def dispose(self) -> None: - self.observer.dispose() - if not self.subject.is_disposed and self.observer in self.subject.observers: - self.subject.observers.remove(self.observer) - - -class QueueItem(NamedTuple): - interval: datetime - value: Any - - -class ReplaySubject(Subject[_T]): - """Represents an object that is both an observable sequence as well - as an observer. Each notification is broadcasted to all subscribed - and future observers, subject to buffer trimming policies. - """ - - def __init__( - self, - buffer_size: Optional[int] = None, - window: Optional[typing.RelativeTime] = None, - scheduler: Optional[abc.SchedulerBase] = None, - ) -> None: - """Initializes a new instance of the ReplaySubject class with - the specified buffer size, window and scheduler. - - Args: - buffer_size: [Optional] Maximum element count of the replay - buffer. - window [Optional]: Maximum time length of the replay buffer. - scheduler: [Optional] Scheduler the observers are invoked on. - """ - - super().__init__() - self.buffer_size = sys.maxsize if buffer_size is None else buffer_size - self.scheduler = scheduler or CurrentThreadScheduler.singleton() - self.window = ( - timedelta.max if window is None else self.scheduler.to_timedelta(window) - ) - self.queue: Deque[QueueItem] = deque() - - def _subscribe_core( - self, - observer: abc.ObserverBase[_T], - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - so = ScheduledObserver(self.scheduler, observer) - subscription = RemovableDisposable(self, so) - - with self.lock: - self.check_disposed() - self._trim(self.scheduler.now) - self.observers.append(so) - - for item in self.queue: - so.on_next(item.value) - - if self.exception is not None: - so.on_error(self.exception) - elif self.is_stopped: - so.on_completed() - - so.ensure_active() - return subscription - - def _trim(self, now: datetime) -> None: - while len(self.queue) > self.buffer_size: - self.queue.popleft() - - while self.queue and (now - self.queue[0].interval) > self.window: - self.queue.popleft() - - def _on_next_core(self, value: _T) -> None: - """Notifies all subscribed observers with the value.""" - - with self.lock: - observers = self.observers.copy() - now = self.scheduler.now - self.queue.append(QueueItem(interval=now, value=value)) - self._trim(now) - - for observer in observers: - observer.on_next(value) - - for observer in observers: - cast(ScheduledObserver[_T], observer).ensure_active() - - def _on_error_core(self, error: Exception) -> None: - """Notifies all subscribed observers with the exception.""" - - with self.lock: - observers = self.observers.copy() - self.observers.clear() - self.exception = error - now = self.scheduler.now - self._trim(now) - - for observer in observers: - observer.on_error(error) - cast(ScheduledObserver[_T], observer).ensure_active() - - def _on_completed_core(self) -> None: - """Notifies all subscribed observers of the end of the sequence.""" - - with self.lock: - observers = self.observers.copy() - self.observers.clear() - now = self.scheduler.now - self._trim(now) - - for observer in observers: - observer.on_completed() - cast(ScheduledObserver[_T], observer).ensure_active() - - def dispose(self) -> None: - """Releases all resources used by the current instance of the - ReplaySubject class and unsubscribe all observers.""" - - with self.lock: - self.queue.clear() - super().dispose() diff --git a/frogpilot/third_party/reactivex/subject/subject.py b/frogpilot/third_party/reactivex/subject/subject.py deleted file mode 100644 index c67ae3b3..00000000 --- a/frogpilot/third_party/reactivex/subject/subject.py +++ /dev/null @@ -1,110 +0,0 @@ -import threading -from typing import List, Optional, TypeVar - -from .. import abc -from ..disposable import Disposable -from ..internal import DisposedException -from ..observable import Observable -from ..observer import Observer -from .innersubscription import InnerSubscription - -_T = TypeVar("_T") - - -class Subject(Observable[_T], Observer[_T], abc.SubjectBase[_T]): - """Represents an object that is both an observable sequence as well - as an observer. Each notification is broadcasted to all subscribed - observers. - """ - - def __init__(self) -> None: - super().__init__() - - self.is_disposed = False - self.observers: List[abc.ObserverBase[_T]] = [] - self.exception: Optional[Exception] = None - - self.lock = threading.RLock() - - def check_disposed(self) -> None: - if self.is_disposed: - raise DisposedException() - - def _subscribe_core( - self, - observer: abc.ObserverBase[_T], - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - with self.lock: - self.check_disposed() - if not self.is_stopped: - self.observers.append(observer) - return InnerSubscription(self, observer) - - if self.exception is not None: - observer.on_error(self.exception) - else: - observer.on_completed() - return Disposable() - - def on_next(self, value: _T) -> None: - """Notifies all subscribed observers with the value. - - Args: - value: The value to send to all subscribed observers. - """ - - with self.lock: - self.check_disposed() - super().on_next(value) - - def _on_next_core(self, value: _T) -> None: - with self.lock: - observers = self.observers.copy() - - for observer in observers: - observer.on_next(value) - - def on_error(self, error: Exception) -> None: - """Notifies all subscribed observers with the exception. - - Args: - error: The exception to send to all subscribed observers. - """ - - with self.lock: - self.check_disposed() - super().on_error(error) - - def _on_error_core(self, error: Exception) -> None: - with self.lock: - observers = self.observers.copy() - self.observers.clear() - self.exception = error - - for observer in observers: - observer.on_error(error) - - def on_completed(self) -> None: - """Notifies all subscribed observers of the end of the sequence.""" - - with self.lock: - self.check_disposed() - super().on_completed() - - def _on_completed_core(self) -> None: - with self.lock: - observers = self.observers.copy() - self.observers.clear() - - for observer in observers: - observer.on_completed() - - def dispose(self) -> None: - """Unsubscribe all observers and release resources.""" - - with self.lock: - self.is_disposed = True - self.observers = [] - self.exception = None - super().dispose() diff --git a/frogpilot/third_party/reactivex/testing/__init__.py b/frogpilot/third_party/reactivex/testing/__init__.py deleted file mode 100644 index bf8af0b6..00000000 --- a/frogpilot/third_party/reactivex/testing/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -from .mockdisposable import MockDisposable -from .reactivetest import OnErrorPredicate, OnNextPredicate, ReactiveTest, is_prime -from .recorded import Recorded -from .testscheduler import TestScheduler - -__all__ = [ - "MockDisposable", - "OnErrorPredicate", - "OnNextPredicate", - "ReactiveTest", - "Recorded", - "TestScheduler", - "is_prime", -] diff --git a/frogpilot/third_party/reactivex/testing/coldobservable.py b/frogpilot/third_party/reactivex/testing/coldobservable.py deleted file mode 100644 index 01177158..00000000 --- a/frogpilot/third_party/reactivex/testing/coldobservable.py +++ /dev/null @@ -1,57 +0,0 @@ -from typing import Any, List, Optional, TypeVar - -from reactivex import Notification, Observable, abc -from reactivex.disposable import CompositeDisposable, Disposable -from reactivex.scheduler import VirtualTimeScheduler - -from .recorded import Recorded -from .subscription import Subscription - -_T = TypeVar("_T") - - -class ColdObservable(Observable[_T]): - def __init__( - self, scheduler: VirtualTimeScheduler, messages: List[Recorded[_T]] - ) -> None: - super().__init__() - - self.scheduler = scheduler - self.messages = messages - self.subscriptions: List[Subscription] = [] - - def _subscribe_core( - self, - observer: Optional[abc.ObserverBase[_T]] = None, - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - self.subscriptions.append(Subscription(self.scheduler.clock)) - index = len(self.subscriptions) - 1 - disp = CompositeDisposable() - - def get_action(notification: Notification[_T]) -> abc.ScheduledAction[_T]: - def action( - scheduler: abc.SchedulerBase, state: Any = None - ) -> abc.DisposableBase: - if observer: - notification.accept(observer) - return Disposable() - - return action - - for message in self.messages: - notification = message.value - if not isinstance(notification, Notification): - raise ValueError("Must be notification") - - # Don't make closures within a loop - action = get_action(notification) - disp.add(self.scheduler.schedule_relative(message.time, action)) - - def dispose() -> None: - start = self.subscriptions[index].subscribe - end = self.scheduler.to_seconds(self.scheduler.now) - self.subscriptions[index] = Subscription(start, int(end)) - disp.dispose() - - return Disposable(dispose) diff --git a/frogpilot/third_party/reactivex/testing/hotobservable.py b/frogpilot/third_party/reactivex/testing/hotobservable.py deleted file mode 100644 index e69a84c1..00000000 --- a/frogpilot/third_party/reactivex/testing/hotobservable.py +++ /dev/null @@ -1,61 +0,0 @@ -from typing import Any, List, Optional, TypeVar - -from reactivex import Observable, abc -from reactivex.disposable import Disposable -from reactivex.notification import Notification -from reactivex.scheduler import VirtualTimeScheduler - -from .recorded import Recorded -from .subscription import Subscription - -_T = TypeVar("_T") - - -class HotObservable(Observable[_T]): - def __init__( - self, scheduler: VirtualTimeScheduler, messages: List[Recorded[_T]] - ) -> None: - super().__init__() - - self.scheduler = scheduler - self.messages = messages - self.subscriptions: List[Subscription] = [] - self.observers: List[abc.ObserverBase[_T]] = [] - - observable = self - - def get_action(notification: Notification[_T]) -> abc.ScheduledAction[_T]: - def action(scheduler: abc.SchedulerBase, state: Any) -> abc.DisposableBase: - for observer in observable.observers[:]: - notification.accept(observer) - return Disposable() - - return action - - for message in self.messages: - notification = message.value - if not isinstance(notification, Notification): - raise ValueError("Must be notification") - - # Warning: Don't make closures within a loop - action = get_action(notification) - scheduler.schedule_absolute(message.time, action) - - def _subscribe_core( - self, - observer: Optional[abc.ObserverBase[_T]] = None, - scheduler: Optional[abc.SchedulerBase] = None, - ) -> abc.DisposableBase: - if observer: - self.observers.append(observer) - self.subscriptions.append(Subscription(self.scheduler.clock)) - index = len(self.subscriptions) - 1 - - def dispose_action() -> None: - if observer: - self.observers.remove(observer) - start = self.subscriptions[index].subscribe - end = self.scheduler.clock - self.subscriptions[index] = Subscription(start, end) - - return Disposable(dispose_action) diff --git a/frogpilot/third_party/reactivex/testing/marbles.py b/frogpilot/third_party/reactivex/testing/marbles.py deleted file mode 100644 index 7b852a0a..00000000 --- a/frogpilot/third_party/reactivex/testing/marbles.py +++ /dev/null @@ -1,197 +0,0 @@ -from contextlib import contextmanager -from typing import Any, Dict, Generator, List, NamedTuple, Optional, Tuple, Union -from warnings import warn - -import reactivex -from reactivex import Observable, typing -from reactivex.notification import Notification, OnError, OnNext -from reactivex.observable.marbles import parse -from reactivex.scheduler import NewThreadScheduler -from reactivex.typing import Callable, RelativeTime - -from .reactivetest import ReactiveTest -from .recorded import Recorded -from .testscheduler import TestScheduler - -new_thread_scheduler = NewThreadScheduler() - - -class MarblesContext(NamedTuple): - start: Callable[ - [Union[Observable[Any], Callable[[], Observable[Any]]]], List[Recorded[Any]] - ] - cold: Callable[ - [str, Optional[Dict[Union[str, float], Any]], Optional[Exception]], - Observable[Any], - ] - hot: Callable[ - [str, Optional[Dict[Union[str, float], Any]], Optional[Exception]], - Observable[Any], - ] - exp: Callable[ - [str, Optional[Dict[Union[str, float], Any]], Optional[Exception]], - List[Recorded[Any]], - ] - - -@contextmanager -def marbles_testing( - timespan: RelativeTime = 1.0, -) -> Generator[MarblesContext, None, None]: - """ - Initialize a :class:`rx.testing.TestScheduler` and return a namedtuple - containing the following functions that wrap its methods. - - :func:`cold()`: - Parse a marbles string and return a cold observable - - :func:`hot()`: - Parse a marbles string and return a hot observable - - :func:`start()`: - Start the test scheduler, invoke the create function, - subscribe to the resulting sequence, dispose the subscription and - return the resulting records - - :func:`exp()`: - Parse a marbles string and return a list of records - - Examples: - >>> with marbles_testing() as (start, cold, hot, exp): - ... obs = hot("-a-----b---c-|") - ... ex = exp( "-a-----b---c-|") - ... results = start(obs) - ... assert results == ex - - The underlying test scheduler is initialized with the following - parameters: - - created time = 100.0s - - subscribed = 200.0s - - disposed = 1000.0s - - **IMPORTANT**: regarding :func:`hot()`, a marble declared as the - first character will be skipped by the test scheduler. - E.g. hot("a--b--") will only emit b. - """ - - scheduler = TestScheduler() - created = 100.0 - disposed = 1000.0 - subscribed = 200.0 - start_called = False - outside_of_context = False - - def check() -> None: - if outside_of_context: - warn( - "context functions should not be called outside of with statement.", - UserWarning, - stacklevel=3, - ) - - if start_called: - warn( - "start() should only be called one time inside a with statement.", - UserWarning, - stacklevel=3, - ) - - def test_start( - create: Union[Observable[Any], Callable[[], Observable[Any]]], - ) -> List[Recorded[Any]]: - nonlocal start_called - check() - - if isinstance(create, Observable): - create_ = create - - def default_create() -> Observable[Any]: - return create_ - - create_function = default_create - else: - create_function = create - - mock_observer = scheduler.start( - create=create_function, - created=created, - subscribed=subscribed, - disposed=disposed, - ) - start_called = True - return mock_observer.messages - - def test_expected( - string: str, - lookup: Optional[Dict[Union[str, float], Any]] = None, - error: Optional[Exception] = None, - ) -> List[Recorded[Any]]: - messages = parse( - string, - timespan=timespan, - time_shift=subscribed, - lookup=lookup, - error=error, - ) - return messages_to_records(messages) - - def test_cold( - string: str, - lookup: Optional[Dict[Union[str, float], Any]] = None, - error: Optional[Exception] = None, - ) -> Observable[Any]: - check() - return reactivex.from_marbles( - string, - timespan=timespan, - lookup=lookup, - error=error, - ) - - def test_hot( - string: str, - lookup: Optional[Dict[Union[str, float], Any]] = None, - error: Optional[Exception] = None, - ) -> Observable[Any]: - check() - hot_obs: Observable[Any] = reactivex.hot( - string, - timespan=timespan, - duetime=subscribed, - lookup=lookup, - error=error, - scheduler=scheduler, - ) - return hot_obs - - try: - yield MarblesContext(test_start, test_cold, test_hot, test_expected) - finally: - outside_of_context = True - - -def messages_to_records( - messages: List[Tuple[typing.RelativeTime, Notification[Any]]], -) -> List[Recorded[Any]]: - """ - Helper function to convert messages returned by parse() to a list of - Recorded. - """ - records: List[Recorded[Any]] = [] - - for message in messages: - time, notification = message - if isinstance(time, (int, float)): - time_ = int(time) - else: - time_ = time.microseconds // 1000 - - if isinstance(notification, OnNext): - record = ReactiveTest.on_next(time_, notification.value) - elif isinstance(notification, OnError): - record = ReactiveTest.on_error(time_, notification.exception) - else: - record = ReactiveTest.on_completed(time_) - records.append(record) - - return records diff --git a/frogpilot/third_party/reactivex/testing/mockdisposable.py b/frogpilot/third_party/reactivex/testing/mockdisposable.py deleted file mode 100644 index 1baafae8..00000000 --- a/frogpilot/third_party/reactivex/testing/mockdisposable.py +++ /dev/null @@ -1,14 +0,0 @@ -from typing import List - -from reactivex import abc, typing -from reactivex.scheduler import VirtualTimeScheduler - - -class MockDisposable(abc.DisposableBase): - def __init__(self, scheduler: VirtualTimeScheduler): - self.scheduler = scheduler - self.disposes: List[typing.AbsoluteTime] = [] - self.disposes.append(self.scheduler.clock) - - def dispose(self) -> None: - self.disposes.append(self.scheduler.clock) diff --git a/frogpilot/third_party/reactivex/testing/mockobserver.py b/frogpilot/third_party/reactivex/testing/mockobserver.py deleted file mode 100644 index ba5b5992..00000000 --- a/frogpilot/third_party/reactivex/testing/mockobserver.py +++ /dev/null @@ -1,24 +0,0 @@ -from typing import List, TypeVar - -from reactivex import abc -from reactivex.notification import OnCompleted, OnError, OnNext -from reactivex.scheduler import VirtualTimeScheduler - -from .recorded import Recorded - -_T = TypeVar("_T") - - -class MockObserver(abc.ObserverBase[_T]): - def __init__(self, scheduler: VirtualTimeScheduler) -> None: - self.scheduler = scheduler - self.messages: List[Recorded[_T]] = [] - - def on_next(self, value: _T) -> None: - self.messages.append(Recorded(self.scheduler.clock, OnNext(value))) - - def on_error(self, error: Exception) -> None: - self.messages.append(Recorded(self.scheduler.clock, OnError(error))) - - def on_completed(self) -> None: - self.messages.append(Recorded(self.scheduler.clock, OnCompleted())) diff --git a/frogpilot/third_party/reactivex/testing/reactivetest.py b/frogpilot/third_party/reactivex/testing/reactivetest.py deleted file mode 100644 index d41f6dc7..00000000 --- a/frogpilot/third_party/reactivex/testing/reactivetest.py +++ /dev/null @@ -1,84 +0,0 @@ -import math -import types -from typing import Any, Generic, TypeVar, Union - -from reactivex import typing -from reactivex.notification import OnCompleted, OnError, OnNext - -from .recorded import Recorded -from .subscription import Subscription - -_T = TypeVar("_T") - - -def is_prime(i: int) -> bool: - """Tests if number is prime or not""" - - if i <= 1: - return False - - _max = int(math.floor(math.sqrt(i))) - for j in range(2, _max + 1): - if not i % j: - return False - - return True - - -# New predicate tests -class OnNextPredicate(Generic[_T]): - def __init__(self, predicate: typing.Predicate[_T]) -> None: - self.predicate = predicate - - def __eq__(self, other: Any) -> bool: - if other == self: - return True - if other is None: - return False - if other.kind != "N": - return False - return self.predicate(other.value) - - -class OnErrorPredicate(Generic[_T]): - def __init__(self, predicate: typing.Predicate[_T]): - self.predicate = predicate - - def __eq__(self, other: Any) -> bool: - if other == self: - return True - if other is None: - return False - if other.kind != "E": - return False - return self.predicate(other.exception) - - -class ReactiveTest: - created = 100 - subscribed = 200 - disposed = 1000 - - @staticmethod - def on_next(ticks: int, value: _T) -> Recorded[_T]: - if isinstance(value, types.FunctionType): - return Recorded(ticks, OnNextPredicate(value)) - - return Recorded(ticks, OnNext(value)) - - @staticmethod - def on_error( - ticks: int, error: Union[Exception, str, types.FunctionType] - ) -> Recorded[Any]: - if isinstance(error, types.FunctionType): - return Recorded(ticks, OnErrorPredicate(error)) - - return Recorded(ticks, OnError(error)) - - @staticmethod - def on_completed(ticks: int) -> Recorded[Any]: - return Recorded(ticks, OnCompleted()) - - @staticmethod - def subscribe(start: int, end: int) -> Subscription: - return Subscription(start, end) diff --git a/frogpilot/third_party/reactivex/testing/recorded.py b/frogpilot/third_party/reactivex/testing/recorded.py deleted file mode 100644 index 64b04d23..00000000 --- a/frogpilot/third_party/reactivex/testing/recorded.py +++ /dev/null @@ -1,41 +0,0 @@ -from typing import TYPE_CHECKING, Any, Generic, TypeVar, Union, cast - -from reactivex import Notification - -if TYPE_CHECKING: - from .reactivetest import OnErrorPredicate, OnNextPredicate - - -_T = TypeVar("_T") - - -class Recorded(Generic[_T]): - def __init__( - self, - time: int, - value: Union[Notification[_T], "OnNextPredicate[_T]", "OnErrorPredicate[_T]"], - # comparer: Optional[typing.Comparer[_T]] = None, - ): - self.time = time - self.value = value - # self.comparer = comparer or default_comparer - - def __eq__(self, other: Any) -> bool: - """Returns true if a recorded value matches another recorded value""" - - if isinstance(other, Recorded): - other_ = cast(Recorded[_T], other) - time_match = self.time == other_.time - if not time_match: - return False - return self.value == other_.value - - return False - - equals = __eq__ - - def __repr__(self) -> str: - return str(self) - - def __str__(self) -> str: - return "%s@%s" % (self.value, self.time) diff --git a/frogpilot/third_party/reactivex/testing/subscription.py b/frogpilot/third_party/reactivex/testing/subscription.py deleted file mode 100644 index 88b29ab4..00000000 --- a/frogpilot/third_party/reactivex/testing/subscription.py +++ /dev/null @@ -1,25 +0,0 @@ -import sys -from typing import Any, Optional - - -class Subscription: - def __init__(self, start: int, end: Optional[int] = None): - self.subscribe = start - self.unsubscribe = end or sys.maxsize - - def equals(self, other: Any) -> bool: - return ( - self.subscribe == other.subscribe and self.unsubscribe == other.unsubscribe - ) - - def __eq__(self, other: Any) -> bool: - return self.equals(other) - - def __repr__(self) -> str: - return str(self) - - def __str__(self) -> str: - unsubscribe = ( - "Infinite" if self.unsubscribe == sys.maxsize else self.unsubscribe - ) - return "(%s, %s)" % (self.subscribe, unsubscribe) diff --git a/frogpilot/third_party/reactivex/testing/testscheduler.py b/frogpilot/third_party/reactivex/testing/testscheduler.py deleted file mode 100644 index 339f8e31..00000000 --- a/frogpilot/third_party/reactivex/testing/testscheduler.py +++ /dev/null @@ -1,164 +0,0 @@ -from typing import Any, Callable, List, Optional, TypeVar, Union, cast - -import reactivex -from reactivex import Observable, abc, typing -from reactivex.disposable import Disposable -from reactivex.scheduler import VirtualTimeScheduler -from reactivex.testing.recorded import Recorded - -from .coldobservable import ColdObservable -from .hotobservable import HotObservable -from .mockobserver import MockObserver -from .reactivetest import ReactiveTest - -_T = TypeVar("_T") - - -class TestScheduler(VirtualTimeScheduler): - """Test time scheduler used for testing applications and libraries - built using Reactive Extensions. All time, both absolute and relative is - specified as integer ticks""" - - __test__ = False - - def schedule_absolute( - self, - duetime: typing.AbsoluteTime, - action: typing.ScheduledAction[Any], - state: Any = None, - ) -> abc.DisposableBase: - """Schedules an action to be executed at the specified virtual - time. - - Args: - duetime: Absolute virtual time at which to execute the - action. - action: Action to be executed. - state: State passed to the action to be executed. - - Returns: - Disposable object used to cancel the scheduled action - (best effort). - """ - - duetime = duetime if isinstance(duetime, float) else self.to_seconds(duetime) - return super().schedule_absolute(duetime, action, state) - - def start( - self, - create: Optional[Callable[[], Observable[_T]]] = None, - created: Optional[float] = None, - subscribed: Optional[float] = None, - disposed: Optional[float] = None, - ) -> MockObserver[_T]: - """Starts the test scheduler and uses the specified virtual - times to invoke the factory function, subscribe to the - resulting sequence, and dispose the subscription. - - Args: - create: Factory method to create an observable sequence. - created: Virtual time at which to invoke the factory to - create an observable sequence. - subscribed: Virtual time at which to subscribe to the - created observable sequence. - disposed: Virtual time at which to dispose the - subscription. - - Returns: - Observer with timestamped recordings of notification - messages that were received during the virtual time window - when the subscription to the source sequence was active. - """ - - # Defaults - created = created or ReactiveTest.created - subscribed = subscribed or ReactiveTest.subscribed - disposed = disposed or ReactiveTest.disposed - - observer = self.create_observer() - subscription: Optional[abc.DisposableBase] = None - source: Optional[abc.ObservableBase[_T]] = None - - def action_create( - scheduler: abc.SchedulerBase, state: Any = None - ) -> abc.DisposableBase: - """Called at create time. Defaults to 100""" - nonlocal source - source = create() if create is not None else reactivex.never() - return Disposable() - - self.schedule_absolute(created, action_create) - - def action_subscribe( - scheduler: abc.SchedulerBase, state: Any = None - ) -> abc.DisposableBase: - """Called at subscribe time. Defaults to 200""" - nonlocal subscription - if source: - subscription = source.subscribe(observer, scheduler=scheduler) - return Disposable() - - self.schedule_absolute(subscribed, action_subscribe) - - def action_dispose( - scheduler: abc.SchedulerBase, state: Any = None - ) -> abc.DisposableBase: - """Called at dispose time. Defaults to 1000""" - if subscription: - subscription.dispose() - return Disposable() - - self.schedule_absolute(disposed, action_dispose) - - super().start() - return observer - - def create_hot_observable( - self, *args: Union[Recorded[_T], List[Recorded[_T]]] - ) -> HotObservable[_T]: - """Creates a hot observable using the specified timestamped - notification messages either as a list or by multiple arguments. - - Args: - messages: Notifications to surface through the created sequence at - their specified absolute virtual times. - - Returns hot observable sequence that can be used to assert the timing - of subscriptions and notifications. - """ - - if args and isinstance(args[0], List): - messages = args[0] - else: - messages = cast(List[Recorded[_T]], list(args)) - return HotObservable(self, messages) - - def create_cold_observable( - self, *args: Union[Recorded[_T], List[Recorded[_T]]] - ) -> ColdObservable[_T]: - """Creates a cold observable using the specified timestamped - notification messages either as an array or arguments. - - Args: - args: Notifications to surface through the created sequence - at their specified virtual time offsets from the - sequence subscription time. - - Returns: - Cold observable sequence that can be used to assert the - timing of subscriptions and notifications. - """ - - if args and isinstance(args[0], list): - messages = args[0] - else: - messages = cast(List[Recorded[_T]], list(args)) - return ColdObservable(self, messages) - - def create_observer(self) -> MockObserver[Any]: - """Creates an observer that records received notification messages and - timestamps those. Return an Observer that can be used to assert the - timing of received notifications. - """ - - return MockObserver(self) diff --git a/frogpilot/third_party/reactivex/typing.py b/frogpilot/third_party/reactivex/typing.py deleted file mode 100644 index baf10c25..00000000 --- a/frogpilot/third_party/reactivex/typing.py +++ /dev/null @@ -1,57 +0,0 @@ -from threading import Thread -from typing import Callable, TypeVar, Union - -from .abc.observable import Subscription -from .abc.observer import OnCompleted, OnError, OnNext -from .abc.periodicscheduler import ( - ScheduledPeriodicAction, - ScheduledSingleOrPeriodicAction, -) -from .abc.scheduler import ( - AbsoluteOrRelativeTime, - AbsoluteTime, - RelativeTime, - ScheduledAction, -) -from .abc.startable import StartableBase - -_TState = TypeVar("_TState") -_T1 = TypeVar("_T1") -_T2 = TypeVar("_T2") - -Action = Callable[[], None] - -Mapper = Callable[[_T1], _T2] -MapperIndexed = Callable[[_T1, int], _T2] -Predicate = Callable[[_T1], bool] -PredicateIndexed = Callable[[_T1, int], bool] -Comparer = Callable[[_T1, _T1], bool] -SubComparer = Callable[[_T1, _T1], int] -Accumulator = Callable[[_TState, _T1], _TState] - - -Startable = Union[StartableBase, Thread] -StartableTarget = Callable[..., None] -StartableFactory = Callable[[StartableTarget], Startable] - -__all__ = [ - "Accumulator", - "AbsoluteTime", - "AbsoluteOrRelativeTime", - "Comparer", - "Mapper", - "MapperIndexed", - "OnNext", - "OnError", - "OnCompleted", - "Predicate", - "PredicateIndexed", - "RelativeTime", - "SubComparer", - "ScheduledPeriodicAction", - "ScheduledSingleOrPeriodicAction", - "ScheduledAction", - "Startable", - "StartableTarget", - "Subscription", -] diff --git a/frogpilot/third_party/timezonefinder-8.1.0.dist-info/METADATA b/frogpilot/third_party/timezonefinder-8.1.0.dist-info/METADATA deleted file mode 100644 index 2695a4cd..00000000 --- a/frogpilot/third_party/timezonefinder-8.1.0.dist-info/METADATA +++ /dev/null @@ -1,3 +0,0 @@ -Metadata-Version: 2.1 -Name: timezonefinder -Version: 8.1.0 diff --git a/frogpilot/third_party/timezonefinder-8.1.0.dist-info/top_level.txt b/frogpilot/third_party/timezonefinder-8.1.0.dist-info/top_level.txt deleted file mode 100644 index 4c2251e4..00000000 --- a/frogpilot/third_party/timezonefinder-8.1.0.dist-info/top_level.txt +++ /dev/null @@ -1 +0,0 @@ -timezonefinder diff --git a/frogpilot/third_party/timezonefinder/build.py b/frogpilot/third_party/timezonefinder/build.py deleted file mode 100644 index 756ea29b..00000000 --- a/frogpilot/third_party/timezonefinder/build.py +++ /dev/null @@ -1,49 +0,0 @@ -"""optionally builds inside polygon algorithm C extension - -Resources: -https://github.com/FirefoxMetzger/mini-extension -https://stackoverflow.com/questions/60073711/how-to-build-c-extensions-via-poetry -https://github.com/libmbd/libmbd/blob/master/build.py -""" - -import pathlib -import re -from typing import Optional -import warnings - -import cffi - -EXTENSION_NAME = "inside_polygon_ext" -H_FILE_NAME = "inside_polygon_int.h" -C_FILE_NAME = "inside_polygon_int.c" -EXTENSION_PATH = pathlib.Path("timezonefinder") / "inside_poly_extension" -h_file_path = EXTENSION_PATH / H_FILE_NAME -c_file_path = EXTENSION_PATH / C_FILE_NAME - -ffibuilder: Optional[cffi.FFI] = None -try: - ffibuilder = cffi.FFI() -except Exception as exc: - # Clang extension should be fully optional - warnings.warn( - f"C lang extension cannot be build, since cffi failed with this error: {exc}" - ) - -if ffibuilder is not None: - ffibuilder.set_source( - "timezonefinder." + EXTENSION_NAME, - source='#include "inside_polygon_int.h"', - sources=[str(c_file_path)], - include_dirs=[str(EXTENSION_PATH)], - ) - with open(h_file_path) as h_file: - # cffi does not like our preprocessor directives, so we remove them - lns = h_file.read().splitlines() - flt = filter(lambda ln: not re.match(r" *#", ln), lns) - - ffibuilder.cdef("\n".join(flt)) - - -if __name__ == "__main__": - if ffibuilder: - ffibuilder.compile(verbose=True) diff --git a/frogpilot/third_party/timezonefinder/command_line.py b/frogpilot/third_party/timezonefinder/command_line.py deleted file mode 100644 index e7fe1ba0..00000000 --- a/frogpilot/third_party/timezonefinder/command_line.py +++ /dev/null @@ -1,122 +0,0 @@ -import argparse -import contextlib -import os -import sys -import tempfile -from typing import Callable, Generator - -from timezonefinder import ( - TimezoneFinderL, - timezone_at, - certain_timezone_at, - timezone_at_land, -) - - -@contextlib.contextmanager -def redirect_stdout_to_temp_file() -> Generator[str, None, None]: - """ - Context manager that redirects stdout to a temporary file for the duration of the context. - The temporary file is created but not deleted when the context exits. - Returns the path to the temporary file. - """ - # Save the original stdout - original_stdout = sys.stdout - - # Create a temporary file that will NOT be automatically deleted - temp_fd, temp_path = tempfile.mkstemp(text=True) - temp_file = os.fdopen(temp_fd, "w") - - try: - # Redirect stdout to the temporary file - sys.stdout = temp_file - yield temp_path - finally: - # Restore the original stdout and close the file - sys.stdout = original_stdout - temp_file.close() - - -def get_timezone_function(function_id: int) -> Callable: - """ - Get the appropriate timezone function based on the function ID. - Uses global functions when available, otherwise creates instances as needed. - """ - # Use global functions for TimezoneFinder methods - if function_id == 0: - return timezone_at - elif function_id == 1: - return certain_timezone_at - elif function_id == 5: - return timezone_at_land - - # For TimezoneFinderL methods, still create an instance - tf_instance = TimezoneFinderL() - functions = { - 3: tf_instance.timezone_at, - 4: tf_instance.timezone_at_land, - } - return functions[function_id] - - -def main() -> None: - parser = argparse.ArgumentParser(description="parse TimezoneFinder parameters") - parser.add_argument("lng", type=float, help="longitude to be queried") - parser.add_argument("lat", type=float, help="latitude to be queried") - parser.add_argument("-v", action="store_true", help="verbosity flag") - parser.add_argument( - "-f", - "--function", - type=int, - choices=[0, 1, 3, 4, 5], - default=0, - help="function to be called:" - "0: TimezoneFinder.timezone_at(), " - "1: TimezoneFinder.certain_timezone_at(), " - "2: removed, " - "3: TimezoneFinderL.timezone_at(), " - "4: TimezoneFinderL.timezone_at_land(), " - "5: TimezoneFinder.timezone_at_land(), ", - ) - parsed_args = parser.parse_args() # takes input from sys.argv - timezone_function = get_timezone_function(parsed_args.function) - - verbose_mode = parsed_args.v - - # Always redirect stdout to a temp file - with redirect_stdout_to_temp_file() as temp_file_path: - print("\n" + "=" * 60) - print("TIMEZONEFINDER LOOKUP DETAILS") - print("-" * 60) - print(f"Coordinates: {parsed_args.lat:.6f}°, {parsed_args.lng:.6f}° (lat, lng)") - print( - f"Function {timezone_function.__name__} (function ID: {parsed_args.function})" - ) - - # Execute the timezone function - tz = timezone_function(lng=parsed_args.lng, lat=parsed_args.lat) - - if tz: - print(f"Result: Found timezone '{tz}'") - else: - print("Result: No timezone found at this location") - print("=" * 60) - - if verbose_mode: - # In verbose mode, print the contents of the temp file - try: - with open(temp_file_path) as f: - captured_output = f.read().strip() - if captured_output: - print(captured_output) - except Exception as e: - print(f"Warning: Could not read captured output: {e}") - else: - # In non-verbose mode, just print the result - print(tz if tz else "") - - # Always clean up the temp file - try: - os.remove(temp_file_path) - except Exception: - pass diff --git a/frogpilot/third_party/timezonefinder/configs.py b/frogpilot/third_party/timezonefinder/configs.py index 7a8f31d5..6fb534ab 100644 --- a/frogpilot/third_party/timezonefinder/configs.py +++ b/frogpilot/third_party/timezonefinder/configs.py @@ -85,5 +85,5 @@ def available_zone_id_dtype_names() -> Tuple[str, ...]: return tuple(sorted(_ZONE_ID_DTYPE_ALIASES)) -DEFAULT_ZONE_ID_DTYPE_NAME = os.getenv("TIMEZONEFINDER_ZONE_ID_DTYPE", "uint8") +DEFAULT_ZONE_ID_DTYPE_NAME = os.getenv("TIMEZONEFINDER_ZONE_ID_DTYPE", "uint16") DEFAULT_ZONE_ID_DTYPE = get_zone_id_dtype(DEFAULT_ZONE_ID_DTYPE_NAME) diff --git a/frogpilot/third_party/timezonefinder/coord_accessors.py b/frogpilot/third_party/timezonefinder/coord_accessors.py index a402d538..eb0b4069 100644 --- a/frogpilot/third_party/timezonefinder/coord_accessors.py +++ b/frogpilot/third_party/timezonefinder/coord_accessors.py @@ -101,9 +101,16 @@ class FileCoordAccessor(AbstractCoordAccessor): def cleanup(self) -> None: """Clean up resources.""" - utils.close_resource(self.coord_file) - utils.close_resource(self.coord_buf) - del self.polygon_collection + # At termination utils may have been tidied up. If we're terminating we don't need to + # worry about closing file handles so just avoid an exception. + close_resource = getattr(utils, "close_resource", None) + if close_resource is None: + return + + # close_resource already ignores None and common close errors + close_resource(getattr(self, "coord_file", None)) + close_resource(getattr(self, "coord_buf", None)) + # polygon_collection is just a FlatBuffers view on coord_buf and owns no resources itself class MemoryCoordAccessor(AbstractCoordAccessor): diff --git a/frogpilot/third_party/timezonefinder/data/boundaries/coordinates.fbs b/frogpilot/third_party/timezonefinder/data/boundaries/coordinates.fbs index 554ce5c1..29b246ad 100644 Binary files a/frogpilot/third_party/timezonefinder/data/boundaries/coordinates.fbs and b/frogpilot/third_party/timezonefinder/data/boundaries/coordinates.fbs differ diff --git a/frogpilot/third_party/timezonefinder/data/boundaries/xmax.npy b/frogpilot/third_party/timezonefinder/data/boundaries/xmax.npy index 8e674caf..04d49efc 100644 Binary files a/frogpilot/third_party/timezonefinder/data/boundaries/xmax.npy and b/frogpilot/third_party/timezonefinder/data/boundaries/xmax.npy differ diff --git a/frogpilot/third_party/timezonefinder/data/boundaries/xmin.npy b/frogpilot/third_party/timezonefinder/data/boundaries/xmin.npy index b9b2f521..719c991a 100644 Binary files a/frogpilot/third_party/timezonefinder/data/boundaries/xmin.npy and b/frogpilot/third_party/timezonefinder/data/boundaries/xmin.npy differ diff --git a/frogpilot/third_party/timezonefinder/data/boundaries/ymax.npy b/frogpilot/third_party/timezonefinder/data/boundaries/ymax.npy index 30f2c598..67fcac6b 100644 Binary files a/frogpilot/third_party/timezonefinder/data/boundaries/ymax.npy and b/frogpilot/third_party/timezonefinder/data/boundaries/ymax.npy differ diff --git a/frogpilot/third_party/timezonefinder/data/boundaries/ymin.npy b/frogpilot/third_party/timezonefinder/data/boundaries/ymin.npy index c605a094..c5e4b6fd 100644 Binary files a/frogpilot/third_party/timezonefinder/data/boundaries/ymin.npy and b/frogpilot/third_party/timezonefinder/data/boundaries/ymin.npy differ diff --git a/frogpilot/third_party/timezonefinder/data/hole_registry.json b/frogpilot/third_party/timezonefinder/data/hole_registry.json index cde3fd6c..6762c2a5 100644 --- a/frogpilot/third_party/timezonefinder/data/hole_registry.json +++ b/frogpilot/third_party/timezonefinder/data/hole_registry.json @@ -1,302 +1,386 @@ { - "10": [ + "1163": [ + 2, + 294 + ], + "1182": [ + 15, + 296 + ], + "1186": [ + 44, + 311 + ], + "1189": [ + 2, + 355 + ], + "1190": [ + 37, + 357 + ], + "1191": [ + 20, + 394 + ], + "1194": [ 1, + 414 + ], + "1197": [ + 28, + 415 + ], + "1198": [ + 3, + 443 + ], + "1202": [ + 1, + 446 + ], + "1203": [ + 16, + 447 + ], + "1206": [ + 4, + 463 + ], + "1210": [ + 2, + 467 + ], + "1212": [ + 1, + 469 + ], + "1215": [ + 2, + 470 + ], + "1216": [ + 5, + 472 + ], + "1217": [ + 3, + 477 + ], + "1218": [ + 14, + 480 + ], + "1223": [ + 12, + 494 + ], + "1224": [ + 6, + 506 + ], + "1227": [ + 1, + 512 + ], + "1231": [ + 1, + 513 + ], + "1233": [ + 7, + 514 + ], + "1238": [ + 21, + 521 + ], + "1243": [ + 3, + 542 + ], + "1252": [ + 1, + 545 + ], + "1255": [ + 5, + 546 + ], + "1263": [ + 2, + 551 + ], + "1267": [ + 1, + 553 + ], + "1269": [ + 2, + 554 + ], + "1272": [ + 2, + 556 + ], + "1273": [ + 4, + 558 + ], + "1275": [ + 13, + 562 + ], + "1277": [ + 17, + 575 + ], + "1280": [ + 2, + 592 + ], + "1282": [ + 1, + 594 + ], + "1283": [ + 11, + 595 + ], + "1287": [ + 2, + 606 + ], + "1291": [ + 13, + 608 + ], + "1292": [ + 1, + 621 + ], + "1293": [ + 4, + 622 + ], + "1296": [ + 6, + 626 + ], + "1297": [ + 13, + 632 + ], + "1301": [ + 6, + 645 + ], + "1304": [ + 4, + 651 + ], + "1307": [ + 32, + 655 + ], + "1311": [ + 34, + 687 + ], + "1314": [ + 37, + 721 + ], + "1317": [ + 22, + 758 + ], + "1318": [ + 1, + 780 + ], + "16": [ + 4, 0 ], - "151": [ + "197": [ + 95, + 20 + ], + "248": [ + 1, + 115 + ], + "259": [ 2, - 21 + 116 ], - "153": [ + "26": [ 1, - 23 - ], - "155": [ - 2, - 24 - ], - "167": [ - 1, - 26 - ], - "177": [ - 1, - 27 - ], - "19": [ - 3, - 1 - ], - "208": [ - 1, - 28 - ], - "218": [ - 21, - 29 - ], - "231": [ - 1, - 50 - ], - "268": [ - 2, - 51 - ], - "316": [ - 8, - 53 - ], - "389": [ - 3, - 61 - ], - "391": [ - 2, - 64 - ], - "40": [ - 8, 4 ], - "41": [ + "280": [ + 1, + 118 + ], + "291": [ + 3, + 119 + ], + "33": [ + 1, + 5 + ], + "335": [ + 1, + 122 + ], + "358": [ + 1, + 123 + ], + "360": [ + 2, + 124 + ], + "370": [ + 1, + 126 + ], + "385": [ + 1, + 127 + ], + "406": [ + 1, + 128 + ], + "452": [ + 1, + 129 + ], + "454": [ 6, - 12 + 130 ], - "410": [ - 5, - 66 - ], - "414": [ - 2, - 71 - ], - "481": [ + "458": [ 1, - 73 + 136 ], - "488": [ - 2, - 74 - ], - "515": [ + "468": [ 1, - 76 + 137 ], - "518": [ + "480": [ 1, - 77 + 138 ], - "522": [ + "494": [ 16, - 78 + 139 ], - "685": [ + "50": [ 2, - 94 + 6 ], - "721": [ - 15, - 96 - ], - "725": [ - 44, - 111 - ], - "728": [ + "506": [ 2, 155 ], - "729": [ - 37, + "519": [ + 28, 157 ], - "730": [ - 20, - 194 - ], - "733": [ + "523": [ 1, - 214 + 185 ], - "736": [ - 28, - 215 - ], - "737": [ - 3, - 243 - ], - "741": [ + "529": [ 1, - 246 + 186 ], - "742": [ - 17, - 247 - ], - "743": [ - 4, - 264 - ], - "748": [ + "539": [ 2, - 268 + 187 + ], + "592": [ + 43, + 189 + ], + "621": [ + 1, + 232 + ], + "673": [ + 8, + 233 ], "750": [ - 1, - 270 - ], - "753": [ - 2, - 271 - ], - "754": [ - 5, - 273 - ], - "755": [ - 3, - 278 - ], - "756": [ - 14, - 281 + 21, + 241 ], "761": [ - 12, - 295 - ], - "762": [ - 3, - 307 - ], - "765": [ - 1, - 310 - ], - "769": [ - 1, - 311 - ], - "771": [ - 7, - 312 - ], - "776": [ - 21, - 319 - ], - "781": [ - 3, - 340 + 2, + 262 ], "790": [ 1, - 343 + 264 ], - "793": [ - 5, - 344 + "797": [ + 1, + 265 + ], + "799": [ + 6, + 266 ], "800": [ - 2, - 349 - ], - "804": [ 1, - 351 + 272 ], - "806": [ - 2, - 352 - ], - "809": [ - 2, - 354 - ], - "810": [ - 4, - 356 - ], - "812": [ - 13, - 360 - ], - "814": [ - 17, - 373 - ], - "817": [ - 2, - 390 - ], - "819": [ - 1, - 392 - ], - "820": [ - 11, - 393 - ], - "824": [ - 2, - 404 - ], - "828": [ - 13, - 406 - ], - "829": [ - 1, - 419 - ], - "830": [ - 4, - 420 - ], - "833": [ + "805": [ 6, - 424 + 273 ], - "834": [ - 13, - 430 + "84": [ + 12, + 8 ], - "838": [ - 6, - 443 - ], - "841": [ - 4, - 449 - ], - "844": [ - 32, - 453 - ], - "848": [ - 34, - 485 - ], - "851": [ - 37, - 519 - ], - "854": [ - 22, - 556 + "843": [ + 2, + 279 ], "855": [ 1, - 578 + 281 ], - "91": [ + "858": [ 1, - 18 + 282 ], - "98": [ + "860": [ 2, - 19 + 283 + ], + "874": [ + 1, + 285 + ], + "884": [ + 2, + 286 + ], + "888": [ + 3, + 288 + ], + "892": [ + 1, + 291 + ], + "912": [ + 2, + 292 ] } diff --git a/frogpilot/third_party/timezonefinder/data/holes/coordinates.fbs b/frogpilot/third_party/timezonefinder/data/holes/coordinates.fbs index 9c286587..998fe019 100644 Binary files a/frogpilot/third_party/timezonefinder/data/holes/coordinates.fbs and b/frogpilot/third_party/timezonefinder/data/holes/coordinates.fbs differ diff --git a/frogpilot/third_party/timezonefinder/data/holes/xmax.npy b/frogpilot/third_party/timezonefinder/data/holes/xmax.npy index fd0bf1db..baf57a9f 100644 Binary files a/frogpilot/third_party/timezonefinder/data/holes/xmax.npy and b/frogpilot/third_party/timezonefinder/data/holes/xmax.npy differ diff --git a/frogpilot/third_party/timezonefinder/data/holes/xmin.npy b/frogpilot/third_party/timezonefinder/data/holes/xmin.npy index 0380c9c7..93257784 100644 Binary files a/frogpilot/third_party/timezonefinder/data/holes/xmin.npy and b/frogpilot/third_party/timezonefinder/data/holes/xmin.npy differ diff --git a/frogpilot/third_party/timezonefinder/data/holes/ymax.npy b/frogpilot/third_party/timezonefinder/data/holes/ymax.npy index 18c258d1..277aa584 100644 Binary files a/frogpilot/third_party/timezonefinder/data/holes/ymax.npy and b/frogpilot/third_party/timezonefinder/data/holes/ymax.npy differ diff --git a/frogpilot/third_party/timezonefinder/data/holes/ymin.npy b/frogpilot/third_party/timezonefinder/data/holes/ymin.npy index 146d61b7..d64a5ff1 100644 Binary files a/frogpilot/third_party/timezonefinder/data/holes/ymin.npy and b/frogpilot/third_party/timezonefinder/data/holes/ymin.npy differ diff --git a/frogpilot/third_party/timezonefinder/data/hybrid_shortcuts_uint16.fbs b/frogpilot/third_party/timezonefinder/data/hybrid_shortcuts_uint16.fbs new file mode 100644 index 00000000..aea273ab Binary files /dev/null and b/frogpilot/third_party/timezonefinder/data/hybrid_shortcuts_uint16.fbs differ diff --git a/frogpilot/third_party/timezonefinder/data/hybrid_shortcuts_uint8.fbs b/frogpilot/third_party/timezonefinder/data/hybrid_shortcuts_uint8.fbs deleted file mode 100644 index c3b4eecb..00000000 Binary files a/frogpilot/third_party/timezonefinder/data/hybrid_shortcuts_uint8.fbs and /dev/null differ diff --git a/frogpilot/third_party/timezonefinder/data/timezone_names.txt b/frogpilot/third_party/timezonefinder/data/timezone_names.txt index d2f5a2ef..89182a8f 100644 --- a/frogpilot/third_party/timezonefinder/data/timezone_names.txt +++ b/frogpilot/third_party/timezonefinder/data/timezone_names.txt @@ -1,70 +1,422 @@ -Etc/UTC Africa/Abidjan -Europe/Moscow -Africa/Lagos -Africa/Johannesburg +Africa/Accra +Africa/Addis_Ababa +Africa/Algiers +Africa/Asmara +Africa/Bamako +Africa/Bangui +Africa/Banjul +Africa/Bissau +Africa/Blantyre +Africa/Brazzaville +Africa/Bujumbura Africa/Cairo Africa/Casablanca -Europe/Paris +Africa/Ceuta +Africa/Conakry +Africa/Dakar +Africa/Dar_es_Salaam +Africa/Djibouti +Africa/Douala +Africa/El_Aaiun +Africa/Freetown +Africa/Gaborone +Africa/Harare +Africa/Johannesburg +Africa/Juba +Africa/Kampala +Africa/Khartoum +Africa/Kigali +Africa/Kinshasa +Africa/Lagos +Africa/Libreville +Africa/Lome +Africa/Luanda +Africa/Lubumbashi +Africa/Lusaka +Africa/Malabo +Africa/Maputo +Africa/Maseru +Africa/Mbabane +Africa/Mogadishu +Africa/Monrovia +Africa/Nairobi +Africa/Ndjamena +Africa/Niamey +Africa/Nouakchott +Africa/Ouagadougou +Africa/Porto-Novo +Africa/Sao_Tome +Africa/Tripoli +Africa/Tunis +Africa/Windhoek America/Adak America/Anchorage +America/Anguilla +America/Antigua +America/Aruba +America/Araguaina +America/Argentina/Buenos_Aires +America/Argentina/Catamarca +America/Argentina/Cordoba +America/Argentina/Jujuy +America/Argentina/La_Rioja +America/Argentina/Mendoza +America/Argentina/Rio_Gallegos +America/Argentina/Salta +America/Argentina/San_Juan +America/Argentina/San_Luis +America/Argentina/Tucuman +America/Argentina/Ushuaia +America/Asuncion +America/Atikokan +America/Bahia +America/Bahia_Banderas +America/Barbados +America/Belem +America/Belize +America/Blanc-Sablon +America/Boa_Vista +America/Bogota +America/Boise +America/Cambridge_Bay +America/Campo_Grande +America/Cancun America/Caracas -America/Sao_Paulo -America/Lima -America/Mexico_City -America/Denver +America/Cayenne +America/Cayman America/Chicago -America/Phoenix -America/New_York +America/Chihuahua +America/Ciudad_Juarez +America/Costa_Rica +America/Coyhaique +America/Creston +America/Cuiaba +America/Curacao +America/Danmarkshavn +America/Dawson +America/Dawson_Creek +America/Denver +America/Detroit +America/Dominica +America/Edmonton +America/Eirunepe +America/El_Salvador +America/Fort_Nelson +America/Fortaleza +America/Glace_Bay +America/Goose_Bay +America/Grand_Turk +America/Grenada +America/Guadeloupe +America/Guatemala +America/Guayaquil +America/Guyana America/Halifax America/Havana +America/Hermosillo +America/Indiana/Indianapolis +America/Indiana/Knox +America/Indiana/Marengo +America/Indiana/Petersburg +America/Indiana/Tell_City +America/Indiana/Vevay +America/Indiana/Vincennes +America/Indiana/Winamac +America/Inuvik +America/Iqaluit +America/Jamaica +America/Juneau +America/Kentucky/Louisville +America/Kentucky/Monticello +America/Kralendijk +America/La_Paz +America/Lima America/Los_Angeles +America/Lower_Princes +America/Maceio +America/Managua +America/Manaus +America/Marigot +America/Martinique +America/Matamoros +America/Mazatlan America/Miquelon +America/Menominee +America/Merida +America/Metlakatla +America/Mexico_City +America/Moncton +America/Monterrey +America/Montevideo +America/Montserrat +America/Nassau +America/New_York +America/Nome America/Noronha +America/North_Dakota/Beulah +America/North_Dakota/Center +America/North_Dakota/New_Salem America/Nuuk +America/Ojinaga +America/Panama +America/Paramaribo +America/Phoenix +America/Port-au-Prince +America/Port_of_Spain +America/Porto_Velho +America/Puerto_Rico +America/Punta_Arenas +America/Rankin_Inlet +America/Recife +America/Regina +America/Resolute +America/Rio_Branco +America/Santarem America/Santiago +America/Santo_Domingo +America/Sao_Paulo +America/Scoresbysund +America/Sitka +America/St_Barthelemy America/St_Johns -Asia/Manila -Asia/Jakarta -Australia/Brisbane -Australia/Sydney -Asia/Karachi -Pacific/Auckland +America/St_Kitts +America/St_Lucia +America/St_Thomas +America/St_Vincent +America/Swift_Current +America/Tegucigalpa +America/Thule +America/Tijuana +America/Toronto +America/Tortola +America/Vancouver +America/Whitehorse +America/Winnipeg +America/Yakutat +Antarctica/Casey +Antarctica/Davis +Antarctica/DumontDUrville +Antarctica/Macquarie +Antarctica/Mawson +Antarctica/McMurdo +Antarctica/Palmer +Antarctica/Rothera +Antarctica/Syowa Antarctica/Troll -Pacific/Fiji -Asia/Dubai +Antarctica/Vostok +Arctic/Longyearbyen +Asia/Aden +Asia/Almaty +Asia/Amman +Asia/Anadyr +Asia/Aqtau +Asia/Aqtobe +Asia/Ashgabat +Asia/Atyrau +Asia/Baghdad +Asia/Bahrain +Asia/Baku +Asia/Bangkok +Asia/Barnaul Asia/Beirut +Asia/Bishkek +Asia/Brunei +Asia/Chita +Asia/Colombo +Asia/Damascus Asia/Dhaka -Asia/Tokyo -Asia/Kolkata -Europe/Athens +Asia/Dili +Asia/Dubai +Asia/Dushanbe +Asia/Famagusta Asia/Gaza +Asia/Hebron +Asia/Ho_Chi_Minh +Asia/Hong_Kong +Asia/Hovd +Asia/Irkutsk +Asia/Jakarta +Asia/Jayapura Asia/Jerusalem Asia/Kabul +Asia/Kamchatka +Asia/Karachi Asia/Kathmandu +Asia/Khandyga +Asia/Kolkata +Asia/Krasnoyarsk +Asia/Kuala_Lumpur +Asia/Kuching +Asia/Kuwait +Asia/Macau +Asia/Magadan +Asia/Makassar +Asia/Manila +Asia/Muscat +Asia/Nicosia +Asia/Novokuznetsk +Asia/Novosibirsk +Asia/Omsk +Asia/Oral +Asia/Phnom_Penh +Asia/Pontianak +Asia/Pyongyang +Asia/Qatar +Asia/Qostanay +Asia/Qyzylorda +Asia/Riyadh Asia/Sakhalin +Asia/Samarkand +Asia/Seoul +Asia/Shanghai +Asia/Singapore +Asia/Srednekolymsk +Asia/Taipei +Asia/Tashkent +Asia/Tbilisi Asia/Tehran +Asia/Thimphu +Asia/Tokyo +Asia/Tomsk +Asia/Ulaanbaatar +Asia/Urumqi +Asia/Ust-Nera +Asia/Vientiane +Asia/Vladivostok +Asia/Yakutsk Asia/Yangon +Asia/Yekaterinburg +Asia/Yerevan Atlantic/Azores -Europe/Lisbon +Atlantic/Bermuda +Atlantic/Canary Atlantic/Cape_Verde +Atlantic/Faroe +Atlantic/Madeira +Atlantic/Reykjavik +Atlantic/South_Georgia +Atlantic/St_Helena +Atlantic/Stanley Australia/Adelaide +Australia/Brisbane +Australia/Broken_Hill Australia/Darwin Australia/Eucla +Australia/Hobart +Australia/Lindeman Australia/Lord_Howe +Australia/Melbourne +Australia/Perth +Australia/Sydney +Etc/UTC +Europe/Amsterdam +Europe/Andorra +Europe/Astrakhan +Europe/Athens +Europe/Belgrade +Europe/Berlin +Europe/Bratislava +Europe/Brussels +Europe/Bucharest +Europe/Budapest +Europe/Busingen Europe/Chisinau +Europe/Copenhagen Europe/Dublin +Europe/Gibraltar +Europe/Guernsey +Europe/Helsinki +Europe/Isle_of_Man +Europe/Istanbul +Europe/Jersey +Europe/Kaliningrad +Europe/Kyiv +Europe/Kirov +Europe/Lisbon +Europe/Ljubljana Europe/London -Pacific/Tongatapu +Europe/Luxembourg +Europe/Madrid +Europe/Malta +Europe/Mariehamn +Europe/Minsk +Europe/Monaco +Europe/Moscow +Europe/Oslo +Europe/Paris +Europe/Podgorica +Europe/Prague +Europe/Riga +Europe/Rome +Europe/Samara +Europe/San_Marino +Europe/Sarajevo +Europe/Saratov +Europe/Simferopol +Europe/Skopje +Europe/Sofia +Europe/Stockholm +Europe/Tallinn +Europe/Tirane +Europe/Ulyanovsk +Europe/Vaduz +Europe/Vatican +Europe/Vienna +Europe/Vilnius +Europe/Volgograd +Europe/Warsaw +Europe/Zagreb +Europe/Zurich +Indian/Antananarivo +Indian/Chagos +Indian/Christmas +Indian/Cocos +Indian/Comoro +Indian/Kerguelen +Indian/Mahe +Indian/Maldives +Indian/Mauritius +Indian/Mayotte +Indian/Reunion +Pacific/Apia +Pacific/Auckland +Pacific/Bougainville Pacific/Chatham +Pacific/Chuuk Pacific/Easter +Pacific/Efate +Pacific/Fakaofo +Pacific/Fiji +Pacific/Funafuti +Pacific/Galapagos Pacific/Gambier +Pacific/Guadalcanal +Pacific/Guam Pacific/Honolulu +Pacific/Kanton Pacific/Kiritimati +Pacific/Kosrae +Pacific/Kwajalein +Pacific/Majuro Pacific/Marquesas -Pacific/Pago_Pago +Pacific/Midway +Pacific/Nauru +Pacific/Niue Pacific/Norfolk +Pacific/Noumea +Pacific/Pago_Pago +Pacific/Palau Pacific/Pitcairn +Pacific/Pohnpei +Pacific/Port_Moresby +Pacific/Rarotonga +Pacific/Saipan +Pacific/Tahiti +Pacific/Tarawa +Pacific/Tongatapu +Pacific/Wake +Pacific/Wallis Etc/GMT-12 Etc/GMT-11 Etc/GMT-10 diff --git a/frogpilot/third_party/timezonefinder/data/zone_ids.npy b/frogpilot/third_party/timezonefinder/data/zone_ids.npy index 8841d0da..d24daf39 100644 Binary files a/frogpilot/third_party/timezonefinder/data/zone_ids.npy and b/frogpilot/third_party/timezonefinder/data/zone_ids.npy differ diff --git a/frogpilot/third_party/timezonefinder/data/zone_positions.npy b/frogpilot/third_party/timezonefinder/data/zone_positions.npy index 6bb52475..22770b52 100644 Binary files a/frogpilot/third_party/timezonefinder/data/zone_positions.npy and b/frogpilot/third_party/timezonefinder/data/zone_positions.npy differ diff --git a/frogpilot/third_party/timezonefinder/flatbuf/schemas/hybrid_shortcuts_uint16.fbs b/frogpilot/third_party/timezonefinder/flatbuf/schemas/hybrid_shortcuts_uint16.fbs deleted file mode 100644 index ff4558f7..00000000 --- a/frogpilot/third_party/timezonefinder/flatbuf/schemas/hybrid_shortcuts_uint16.fbs +++ /dev/null @@ -1,37 +0,0 @@ -namespace timezonefinder.flatbuf.generated.shortcuts_uint16; - -// Table representing a unique zone ID (when all polygons in hex share same zone) -// Optimized for uint16 zone IDs (0-65535) -table UniqueZone { - // Direct zone ID storage - 2 bytes per zone ID - zone_id: ushort; -} - -// Table representing a list of polygon IDs (when hex contains multiple zones) -table PolygonList { - // List of polygon IDs (fixed uint16 as per requirement) - poly_ids: [ushort]; -} - -// Union type for the shortcut value - either unique zone or polygon list -union ShortcutValue { - UniqueZone, - PolygonList -} - -// Individual shortcut entry mapping H3 hex ID to its value -table HybridShortcutEntry { - // H3 hexagon ID (uint64) - hex_id: ulong; - // The value for this hex - either unique zone or polygon list - value: ShortcutValue; -} - -// Root collection containing all shortcut entries -// Optimized for uint16 zone IDs - no metadata overhead -table HybridShortcutCollection { - // All shortcut entries - entries: [HybridShortcutEntry]; -} - -root_type HybridShortcutCollection; diff --git a/frogpilot/third_party/timezonefinder/flatbuf/schemas/hybrid_shortcuts_uint8.fbs b/frogpilot/third_party/timezonefinder/flatbuf/schemas/hybrid_shortcuts_uint8.fbs deleted file mode 100644 index 6551cfe8..00000000 --- a/frogpilot/third_party/timezonefinder/flatbuf/schemas/hybrid_shortcuts_uint8.fbs +++ /dev/null @@ -1,37 +0,0 @@ -namespace timezonefinder.flatbuf.generated.shortcuts_uint8; - -// Table representing a unique zone ID (when all polygons in hex share same zone) -// Optimized for uint8 zone IDs (0-255) -table UniqueZone { - // Direct zone ID storage - 1 byte per zone ID - zone_id: ubyte; -} - -// Table representing a list of polygon IDs (when hex contains multiple zones) -table PolygonList { - // List of polygon IDs (fixed uint16 as per requirement) - poly_ids: [ushort]; -} - -// Union type for the shortcut value - either unique zone or polygon list -union ShortcutValue { - UniqueZone, - PolygonList -} - -// Individual shortcut entry mapping H3 hex ID to its value -table HybridShortcutEntry { - // H3 hexagon ID (uint64) - hex_id: ulong; - // The value for this hex - either unique zone or polygon list - value: ShortcutValue; -} - -// Root collection containing all shortcut entries -// Optimized for uint8 zone IDs - no metadata overhead -table HybridShortcutCollection { - // All shortcut entries - entries: [HybridShortcutEntry]; -} - -root_type HybridShortcutCollection; diff --git a/frogpilot/third_party/timezonefinder/flatbuf/schemas/polygons.fbs b/frogpilot/third_party/timezonefinder/flatbuf/schemas/polygons.fbs deleted file mode 100644 index 831b0afd..00000000 --- a/frogpilot/third_party/timezonefinder/flatbuf/schemas/polygons.fbs +++ /dev/null @@ -1,12 +0,0 @@ -namespace timezonefinder.flatbuf.generated.polygons; - -table Polygon { - // combined x and y coordinates stored as a single vector - coords:[int]; -} - -table PolygonCollection { - polygons:[Polygon]; -} - -root_type PolygonCollection; diff --git a/frogpilot/third_party/timezonefinder/inside_poly_extension/inside_polygon_int.c b/frogpilot/third_party/timezonefinder/inside_poly_extension/inside_polygon_int.c deleted file mode 100644 index 67defef2..00000000 --- a/frogpilot/third_party/timezonefinder/inside_poly_extension/inside_polygon_int.c +++ /dev/null @@ -1,69 +0,0 @@ -#include "inside_polygon_int.h" -#include - -bool inside_polygon_int(int x, int y, int nr_coords, int x_coords[], - int y_coords[]) { - // naive implementation, vulnerable to overflow: - // bool inside; - // for (int i = 0, j = nr_coords - 1; i < nr_coords; j = i++) { - // if (((y_coords[i] > y) != (y_coords[j] > y)) && - // (x < (x_coords[j] - x_coords[i]) * (y - y_coords[i]) / - // (y_coords[j] - y_coords[i]) + - // x_coords[i])) { - // inside = !inside; - // } - // } - // return inside; - - bool inside, y_gt_y1, y_gt_y2, x_le_x1, x_le_x2; - long y1, y2, x1, x2, slope1, slope2; // int64 precision - int i, j; - - inside = false; - // the edge from the last to the first point is checked first - j = nr_coords - 1; - y_gt_y1 = y > y_coords[j]; - for (i = 0; i < nr_coords; j = i++) { - y_gt_y2 = y > y_coords[i]; - if (y_gt_y1 ^ y_gt_y2) { // XOR - // [p1-p2] crosses horizontal line in p - // only count crossings "right" of the point ( >= x) - x_le_x1 = x <= x_coords[j]; - x_le_x2 = x <= x_coords[i]; - if (x_le_x1 || x_le_x2) { - if (x_le_x1 && x_le_x2) { - // p1 and p2 are both to the right -> valid crossing - inside = !inside; - } else { - // compare the slope of the line [p1-p2] and [p-p2] - // depending on the position of p2 this determines whether - // the polygon edge is right or left of the point - // to avoid expensive division the divisors (of the slope dy/dx) - // are brought to the other side ( dy/dx > a == dy > a * dx ) - // only one of the points is to the right - // NOTE: int64 precision required to prevent overflow - y1 = y_coords[j]; - y2 = y_coords[i]; - x1 = x_coords[j]; - x2 = x_coords[i]; - slope1 = (y2 - y) * (x2 - x1); - slope2 = (y2 - y1) * (x2 - x); - // NOTE: accept slope equality to also detect if p lies directly - // on an edge - if (y_gt_y1) { - if (slope1 <= slope2) { - inside = !inside; - } - } else { // NOT y_gt_y1 - if (slope1 >= slope2) { - inside = !inside; - } - } - } - } - } - // next point - y_gt_y1 = y_gt_y2; - } - return inside; -} diff --git a/frogpilot/third_party/timezonefinder/inside_poly_extension/inside_polygon_int.h b/frogpilot/third_party/timezonefinder/inside_poly_extension/inside_polygon_int.h deleted file mode 100644 index d536fe31..00000000 --- a/frogpilot/third_party/timezonefinder/inside_poly_extension/inside_polygon_int.h +++ /dev/null @@ -1,4 +0,0 @@ -#include - -bool inside_polygon_int(int x, int y, int nr_coords, int x_coords[], - int y_coords[]); diff --git a/frogpilot/third_party/timezonefinder/py.typed b/frogpilot/third_party/timezonefinder/py.typed deleted file mode 100644 index e69de29b..00000000 diff --git a/frogpilot/third_party/timezonefinder/timezonefinder.py b/frogpilot/third_party/timezonefinder/timezonefinder.py index 29787977..6757579e 100644 --- a/frogpilot/third_party/timezonefinder/timezonefinder.py +++ b/frogpilot/third_party/timezonefinder/timezonefinder.py @@ -240,7 +240,17 @@ class AbstractTimezoneFinder(ABC): def cleanup(self) -> None: """Clean up resources. Override in subclasses as needed.""" - pass + # At termination utils may have been tidied up. If we're terminating we don't need to + # worry about closing file handles so just avoid an exception. + close_resource = getattr(utils, "close_resource", None) + if close_resource is None: + return + + # PolygonArray exposes underlying accessors that manage their own buffers; + # this is a best-effort close for any objects with a close() method. + close_resource(getattr(self, "boundaries", None)) + close_resource(getattr(self, "holes", None)) + # hole_registry is an in-memory dict only; nothing to close def __enter__(self): """Enter the runtime context for the TimezoneFinder.""" @@ -261,7 +271,9 @@ class TimezoneFinderL(AbstractTimezoneFinder): """ def __init__( - self, bin_file_location: Optional[str] = None, in_memory: bool = False + self, + bin_file_location: Optional[Union[str, Path]] = None, + in_memory: bool = False, ): super().__init__(bin_file_location, in_memory) @@ -320,7 +332,9 @@ class TimezoneFinder(AbstractTimezoneFinder): ] def __init__( - self, bin_file_location: Optional[str] = None, in_memory: bool = False + self, + bin_file_location: Optional[Union[str, Path]] = None, + in_memory: bool = False, ): super().__init__(bin_file_location, in_memory) self.holes_dir = utils.get_holes_dir(self.data_location) @@ -336,9 +350,10 @@ class TimezoneFinder(AbstractTimezoneFinder): def __del__(self) -> None: """Clean up resources when the object is destroyed.""" - del self.boundaries - del self.holes - del self.hole_registry + try: + self.cleanup() + except Exception: + pass def _load_hole_registry(self) -> Dict[int, Tuple[int, int]]: """ diff --git a/frogpilot/ui/qt/offroad/utilities.cc b/frogpilot/ui/qt/offroad/utilities.cc index e74f77a1..f10ee839 100644 --- a/frogpilot/ui/qt/offroad/utilities.cc +++ b/frogpilot/ui/qt/offroad/utilities.cc @@ -1,6 +1,9 @@ #include "frogpilot/ui/qt/offroad/utilities.h" FrogPilotUtilitiesPanel::FrogPilotUtilitiesPanel(FrogPilotSettingsWindow *parent, bool forceOpen) : FrogPilotListWidget(parent), parent(parent) { + networkManager = new QNetworkAccessManager(this); + pairingPollTimer = new QTimer(this); + forceOpenDescriptions = forceOpen; ParamControl *debugModeToggle = new ParamControl("DebugMode", tr("Debug Mode"), tr("Use all of FrogPilot's developer metrics on your next drive to diagnose issues and improve bug reports."), ""); @@ -68,6 +71,173 @@ FrogPilotUtilitiesPanel::FrogPilotUtilitiesPanel(FrogPilotSettingsWindow *parent } addItem(forceStartedButton); + bool paired = params.getBool("PondPaired"); + pondButton = new ButtonControl( + tr("Pair to \"The Pond\""), + paired ? tr("UNPAIR") : tr("PAIR"), + tr("Pair this device with your frogpilot.com account to remotely manage settings from anywhere.") + ); + QObject::connect(pondButton, &ButtonControl::clicked, [this]() { + if (!frogpilotUIState()->frogpilot_scene.online) { + ConfirmationDialog::alert(tr("Please connect to the internet first!"), this); + return; + } + + bool isPaired = params.getBool("PondPaired"); + + if (isPaired && !ConfirmationDialog::confirm(tr("Are you sure you want to unpair from \"The Pond\"?"), tr("Unpair"), this)) { + return; + } + + pondButton->setEnabled(false); + pondButton->setValue(isPaired ? tr("Unpairing...") : tr("Requesting code...")); + + QJsonObject payload; + payload["api_token"] = QString::fromStdString(params.get("FrogPilotApiToken")); + payload["device"] = QString::fromStdString(Hardware::get_name()).trimmed().remove(QChar('\0')); + payload["frogpilot_dongle_id"] = QString::fromStdString(params.get("FrogPilotDongleId")); + + QString buildMetadataStr = QString::fromStdString(params.get("BuildMetadata")); + if (!buildMetadataStr.isEmpty()) { + QJsonDocument bmDoc = QJsonDocument::fromJson(buildMetadataStr.toUtf8()); + if (!bmDoc.isNull()) { + payload["build_metadata"] = bmDoc.object(); + } + } + + QNetworkRequest request(QUrl(QString("https://www.frogpilot.com/api/pond/pair/") + (isPaired ? "unpair" : "request"))); + request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json"); + request.setRawHeader("User-Agent", "frogpilot-api/1.0"); + + QByteArray postData = QJsonDocument(payload).toJson(QJsonDocument::Compact); + + QNetworkReply *reply = networkManager->post(request, postData); + QObject::connect(reply, &QNetworkReply::finished, [this, reply, isPaired, payload]() { + QByteArray responseBody = reply->readAll(); + + reply->deleteLater(); + + pondButton->setEnabled(true); + pondButton->setValue(""); + + if (reply->error() != QNetworkReply::NoError) { + QString errorDetail; + QString serverError = QJsonDocument::fromJson(responseBody).object().value("error").toString(); + + int statusCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); + if (statusCode == 401) { + errorDetail = tr("Authentication failed. Please restart your device."); + } else if (statusCode == 403) { + errorDetail = serverError.contains("build", Qt::CaseInsensitive) + ? tr("Unofficial or modified build detected.") + : tr("Access denied: %1").arg(serverError); + } else if (statusCode == 429) { + errorDetail = tr("Too many attempts. Please wait and try again."); + } else if (statusCode == 503) { + errorDetail = tr("Server is temporarily unavailable. Please try again later."); + } else if (statusCode > 0) { + errorDetail = tr("Server error (%1): %2").arg(statusCode).arg(serverError.isEmpty() ? tr("Unknown error") : serverError); + } else { + errorDetail = tr("Network error: %1").arg(reply->errorString()); + } + + if (isPaired) { + pondButton->setValue(tr("Failed to unpair")); + + QTimer::singleShot(2500, [this]() { + pondButton->setValue(""); + }); + } else { + ConfirmationDialog::alert(tr("Failed to get pairing code.\n\n%1").arg(errorDetail), this); + } + return; + } + + if (isPaired) { + params.putBool("PondPaired", false); + + pondButton->setText(tr("PAIR")); + pondButton->setValue(tr("Unpaired!")); + + QTimer::singleShot(2500, [this]() { + pondButton->setValue(""); + }); + return; + } + + QString code = QJsonDocument::fromJson(responseBody).object().value("code").toString(); + if (code.isEmpty()) { + ConfirmationDialog::alert(tr("Failed to get pairing code. Please try again."), this); + return; + } + + pondButton->setValue(tr("Code: %1").arg(code)); + + ConfirmationDialog::alert(tr("Go to \"frogpilot.com/the_pond\" and enter this code: %1").arg(code), this); + + QString dongleId = payload["frogpilot_dongle_id"].toString(); + QString apiToken = payload["api_token"].toString(); + + pairingPollTimer->disconnect(); + + int pollCount = 0; + QObject::connect(pairingPollTimer, &QTimer::timeout, [this, code, dongleId, apiToken, pollCount]() mutable { + if (++pollCount > 200) { + pairingPollTimer->stop(); + + pondButton->setValue(tr("Code expired")); + + QTimer::singleShot(2500, [this]() { + pondButton->setValue(""); + }); + return; + } + + QNetworkRequest statusRequest{QUrl(QString("https://www.frogpilot.com/api/pond/pair/status?code=%1&dongle_id=%2&api_token=%3").arg(code, dongleId, apiToken))}; + statusRequest.setRawHeader("User-Agent", "frogpilot-api/1.0"); + + QNetworkReply *statusReply = networkManager->get(statusRequest); + QObject::connect(statusReply, &QNetworkReply::finished, [this, statusReply]() { + statusReply->deleteLater(); + if (statusReply->error() != QNetworkReply::NoError) { + return; + } + + QString status = QJsonDocument::fromJson(statusReply->readAll()).object().value("status").toString(); + if (status == "paired") { + pairingPollTimer->stop(); + + params.putBool("PondPaired", true); + + pondButton->setText(tr("UNPAIR")); + pondButton->setValue(tr("Paired!")); + + ConfirmationDialog::alert(tr("Device successfully paired to \"The Pond\"!"), this); + + QTimer::singleShot(2500, [this]() { + pondButton->setValue(""); + }); + } else if (status == "expired") { + pairingPollTimer->stop(); + + pondButton->setValue(tr("Code expired")); + + QTimer::singleShot(2500, [this]() { + pondButton->setValue(""); + }); + } + }); + }); + + pairingPollTimer->start(3000); + }); + }); + if (forceOpenDescriptions) { + pondButton->showDescription(); + } + addItem(pondButton); + pondButton->setVisible(QString::fromStdString(params.get("GitRemote")).toLower() == "https://github.com/frogai/openpilot.git"); + ButtonControl *reportIssueButton = new ButtonControl(tr("Report a Bug or an Issue"), tr("REPORT"), tr("Send a bug report so we can help fix the problem!")); QObject::connect(reportIssueButton, &ButtonControl::clicked, [this]() { if (!frogpilotUIState()->frogpilot_scene.online) { @@ -190,3 +360,10 @@ FrogPilotUtilitiesPanel::FrogPilotUtilitiesPanel(FrogPilotSettingsWindow *parent } addItem(resetTogglesButtonStock); } + +void FrogPilotUtilitiesPanel::showEvent(QShowEvent *event) { + FrogPilotListWidget::showEvent(event); + + bool isPaired = params.getBool("PondPaired"); + pondButton->setText(isPaired ? tr("UNPAIR") : tr("PAIR")); +} diff --git a/frogpilot/ui/qt/offroad/utilities.h b/frogpilot/ui/qt/offroad/utilities.h index 01d1ac51..646ecd14 100644 --- a/frogpilot/ui/qt/offroad/utilities.h +++ b/frogpilot/ui/qt/offroad/utilities.h @@ -8,14 +8,23 @@ class FrogPilotUtilitiesPanel : public FrogPilotListWidget { public: explicit FrogPilotUtilitiesPanel(FrogPilotSettingsWindow *parent, bool forceOpen = false); +protected: + void showEvent(QShowEvent *event) override; + private: bool forceOpenDescriptions; + ButtonControl *pondButton; + FrogPilotSettingsWindow *parent; Params params; Params params_memory{"", true}; + QNetworkAccessManager *networkManager; + + QTimer *pairingPollTimer; + std::set excluded_keys = { "AvailableModels", "AvailableModelNames", "FrogPilotStats", "GithubSshKeys", "GithubUsername", "MapBoxRequests", diff --git a/system/manager/process_config.py b/system/manager/process_config.py index a8a4173c..c61fec8d 100644 --- a/system/manager/process_config.py +++ b/system/manager/process_config.py @@ -132,6 +132,7 @@ if HARDWARE.get_device_type() == "mici": elif TICI: procs.append(NativeProcess("ui", "selfdrive/ui", ["./ui"], always_run, watchdog_max_dt=5)), procs += [ + PythonProcess("device_syncd", "frogpilot.system.device_syncd", always_run), PythonProcess("frogpilot_process", "frogpilot.frogpilot_process", always_run), NativeProcess("mapd", "frogpilot/navigation", ["./mapd"], always_run), PythonProcess("speed_limit_filler", "frogpilot.system.speed_limit_filler", run_speed_limit_filler), diff --git a/system/sentry.py b/system/sentry.py index eac5bb44..36625195 100644 --- a/system/sentry.py +++ b/system/sentry.py @@ -1,5 +1,4 @@ """Install exception handler for process crash.""" -import os import sentry_sdk import traceback from datetime import datetime @@ -12,14 +11,15 @@ from openpilot.system.hardware import HARDWARE, PC from openpilot.common.swaglog import cloudlog from openpilot.system.version import get_build_metadata, get_version +from openpilot.frogpilot.common.frogpilot_utilities import get_sentry_dsn from openpilot.frogpilot.common.frogpilot_variables import ERROR_LOGS_PATH class SentryProject(Enum): # python project - SELFDRIVE = os.environ.get("SENTRY_DSN", "") + SELFDRIVE = "https://6f3c7076c1e14b2aa10f5dde6dda0cc4@o33823.ingest.sentry.io/77924" # native project - SELFDRIVE_NATIVE = os.environ.get("SENTRY_DSN", "") + SELFDRIVE_NATIVE = "https://3e4b586ed21a4479ad5d85083b639bc6@o33823.ingest.sentry.io/157615" def report_tombstone(fn: str, message: str, contents: str) -> None: @@ -85,7 +85,7 @@ def init(project: SentryProject) -> bool: short_branch = build_metadata.channel if short_branch in ["COMMA", "HEAD"]: - return + return False elif short_branch == "FrogPilot-Development": env = "Development" elif build_metadata.release_channel: @@ -101,7 +101,7 @@ def init(project: SentryProject) -> bool: if project == SentryProject.SELFDRIVE: integrations.append(ThreadingIntegration(propagate_hub=True)) - sentry_sdk.init(project.value, + sentry_sdk.init(get_sentry_dsn(), default_integrations=False, release=get_version(), integrations=integrations,